()
| 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; |
no outgoing calls
no test coverage detected