MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / applySearchQuery

Function applySearchQuery

src/handlers/quickTools.js:777–792  ·  view source on GitHub ↗
(editor, searchValue, replaceValue)

Source from the content-addressed store, hash-verified

775}
776
777function applySearchQuery(editor, searchValue, replaceValue) {
778 if (!editor) return null;
779 const options = appSettings?.value?.search ?? {};
780 const queryConfig = {
781 search: String(searchValue ?? ""),
782 caseSensitive: !!options.caseSensitive,
783 regexp: !!options.regExp,
784 wholeWord: !!options.wholeWord,
785 };
786 if (replaceValue !== undefined) {
787 queryConfig.replace = String(replaceValue ?? "");
788 }
789 const query = new SearchQuery(queryConfig);
790 editor.dispatch({ effects: setSearchQuery.of(query) });
791 return query;
792}
793
794function clearSearchQuery(editor) {
795 if (!editor) return;

Callers 2

actionsFunction · 0.85
findFunction · 0.85

Calls 1

StringInterface · 0.85

Tested by

no test coverage detected