From 2f6454a085b772f17d3052e28d7f9d674218a725 Mon Sep 17 00:00:00 2001 From: Don HO Date: Wed, 9 Dec 2020 03:34:18 +0100 Subject: [PATCH] Fix Search result line number highlighting inaccurate issue --- PowerEditor/src/stylers.model.xml | 2 +- scintilla/lexers/LexSearchResult.cxx | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/PowerEditor/src/stylers.model.xml b/PowerEditor/src/stylers.model.xml index 699bd910..9ff25af5 100644 --- a/PowerEditor/src/stylers.model.xml +++ b/PowerEditor/src/stylers.model.xml @@ -1364,7 +1364,7 @@ - + diff --git a/scintilla/lexers/LexSearchResult.cxx b/scintilla/lexers/LexSearchResult.cxx index b8105d5a..b00adb2f 100644 --- a/scintilla/lexers/LexSearchResult.cxx +++ b/scintilla/lexers/LexSearchResult.cxx @@ -62,15 +62,15 @@ static void ColouriseSearchResultLine(SearchResultMarkings* pMarkings, char *lin } else if (lineBuffer[0] == ' ')// \t - line info { - const unsigned int firstTokenLen = 4; - unsigned int currentPos; + unsigned int firstTokenLen = 0; + unsigned int currentPos = 0; - styler.ColourTo(startLine + firstTokenLen, SCE_SEARCHRESULT_DEFAULT); - for (currentPos = firstTokenLen; lineBuffer[currentPos] != ':'; currentPos++) - { - // Just make currentPos mover forward - } + for (; !(lineBuffer[firstTokenLen] >= '0' && lineBuffer[firstTokenLen] <= '9'); firstTokenLen++); + + styler.ColourTo(startLine + firstTokenLen - 1, SCE_SEARCHRESULT_DEFAULT); + + for (currentPos = firstTokenLen; lineBuffer[currentPos] != ':'; currentPos++); styler.ColourTo(startLine + currentPos - 1, SCE_SEARCHRESULT_LINE_NUMBER);