MCPcopy Create free account
hub / github.com/UNLINEARITY/Obsidian-CodeSpace / getSelectedTextForSearch

Method getSelectedTextForSearch

src/code_view.ts:897–907  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

895 }
896
897 private getSelectedTextForSearch(): string | null {
898 if (!this.editorView) return null;
899
900 const sel = this.editorView.state.selection.main;
901 if (sel.empty) return null;
902
903 const text = this.editorView.state.sliceDoc(sel.from, sel.to);
904 // Avoid huge selections being dumped into the search box.
905 if (text.length > 500) return null;
906 return text;
907 }
908
909 private openSearchFromHotkey(mode: "find" | "replace") {
910 if (!this.searchPanel) return;

Callers 1

openSearchFromHotkeyMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected