cleanup of find in text implementation

This commit is contained in:
zadam
2023-05-18 13:41:32 +02:00
parent 1089e84f56
commit 074820dae5
4 changed files with 12 additions and 43 deletions

View File

@@ -16,23 +16,6 @@ export default class FindInCode {
return this.parent.noteContext.getCodeEditor();
}
async getInitialSearchTerm() {
const codeEditor = await this.getCodeEditor();
// highlightSelectionMatches is the overlay that highlights
// the words under the cursor. This occludes the search
// markers style, save it, disable it. Will be restored when
// the focus is back into the note
this.oldHighlightSelectionMatches = codeEditor.getOption("highlightSelectionMatches");
codeEditor.setOption("highlightSelectionMatches", false);
// Fill in the findbox with the current selection if any
const selectedText = codeEditor.getSelection()
if (selectedText !== "") {
return selectedText;
}
}
async performFind(searchTerm, matchCase, wholeWord) {
let findResult = null;
let totalFound = 0;