fix(editor): update SQL search escaping and match counts
This commit is contained in:
4 files changed
+75
-7
No files matched your search
@@ -0,0 +1,18 @@
|
||||
import { SearchQuery } from "@codemirror/search";
|
||||
|
||||
export interface EditorSearchQueryOptions {
|
||||
search: string;
|
||||
replace?: string;
|
||||
caseSensitive: boolean;
|
||||
useRegex: boolean;
|
||||
}
|
||||
|
||||
export function createEditorSearchQuery(options: EditorSearchQueryOptions): SearchQuery {
|
||||
return new SearchQuery({
|
||||
search: options.search,
|
||||
replace: options.replace ?? "",
|
||||
caseSensitive: options.caseSensitive,
|
||||
regexp: options.useRegex,
|
||||
literal: !options.useRegex,
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user