From b3934afd9210f7f580355c7eb54f263d425ebd43 Mon Sep 17 00:00:00 2001 From: ozone10 Date: Fri, 6 Jan 2023 08:27:39 +0100 Subject: [PATCH] Fix Notpad++ hangs while deleting search results results When deleting search results use setLexer only when lexer is SCLEX_NULL. Fix #12555, clos #12765 --- PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp index 332eb2bf5..1fa0d8448 100644 --- a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp @@ -610,7 +610,10 @@ void Finder::deleteResult() auto end = _scintView.execute(SCI_GETLINEENDPOSITION, lno); if (start + 2 >= end) return; // avoid empty lines - _scintView.setLexer(L_SEARCHRESULT, LIST_NONE); // Restore searchResult lexer in case the lexer was changed to SCLEX_NULL in GotoFoundLine() + if (_scintView.execute(SCI_GETLEXER) == SCLEX_NULL) + { + _scintView.setLexer(L_SEARCHRESULT, LIST_NONE); // Restore searchResult lexer in case the lexer was changed to SCLEX_NULL in GotoFoundLine() + } if (_scintView.execute(SCI_GETFOLDLEVEL, lno) & SC_FOLDLEVELHEADERFLAG) // delete a folder {