@codemirror/search
Advanced tools
Comparing version 0.20.0 to 0.20.1
@@ -0,1 +1,7 @@ | ||
## 0.20.1 (2022-04-22) | ||
### New features | ||
It is now possible to disable backslash escapes in search queries with the `literal` option. | ||
## 0.20.0 (2022-04-20) | ||
@@ -2,0 +8,0 @@ |
@@ -241,2 +241,8 @@ import * as _codemirror_state from '@codemirror/state'; | ||
/** | ||
By default, string search will replace `\n`, `\r`, and `\t` in | ||
the query with newline, return, and tab characters. When this | ||
is set to true, that behavior is disabled. | ||
*/ | ||
literal?: boolean; | ||
/** | ||
When true, interpret the search string as a regular expression. | ||
@@ -243,0 +249,0 @@ */ |
@@ -574,3 +574,3 @@ import { showPanel, EditorView, getPanel, Decoration, ViewPlugin, runScopeHandlers } from '@codemirror/view'; | ||
this.valid = !!this.search && (!this.regexp || validRegExp(this.search)); | ||
this.unquoted = this.search.replace(/\\([nrt\\])/g, (_, ch) => ch == "n" ? "\n" : ch == "r" ? "\r" : ch == "t" ? "\t" : "\\"); | ||
this.unquoted = config.literal ? this.search : this.search.replace(/\\([nrt\\])/g, (_, ch) => ch == "n" ? "\n" : ch == "r" ? "\r" : ch == "t" ? "\t" : "\\"); | ||
} | ||
@@ -577,0 +577,0 @@ /** |
{ | ||
"name": "@codemirror/search", | ||
"version": "0.20.0", | ||
"version": "0.20.1", | ||
"description": "Search functionality for the CodeMirror code editor", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
105692
2556