mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-26 23:34:44 +02:00
Fix bug with smart highlight of data and end-of-file
Fix #8908, close #8911
This commit is contained in:
parent
9ab554a129
commit
a08784fa43
@ -127,7 +127,7 @@ void SmartHighlighter::highlightView(ScintillaEditView * pHighlightView, Scintil
|
|||||||
|
|
||||||
auto curPos = pHighlightView->execute(SCI_GETCURRENTPOS);
|
auto curPos = pHighlightView->execute(SCI_GETCURRENTPOS);
|
||||||
auto range = pHighlightView->getSelection();
|
auto range = pHighlightView->getSelection();
|
||||||
int textlen = range.cpMax - range.cpMin + 1;
|
int textlen = range.cpMax - range.cpMin;
|
||||||
|
|
||||||
// Determine mode for SmartHighlighting
|
// Determine mode for SmartHighlighting
|
||||||
bool isWordOnly = true;
|
bool isWordOnly = true;
|
||||||
@ -162,8 +162,8 @@ void SmartHighlighter::highlightView(ScintillaEditView * pHighlightView, Scintil
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
char * text2Find = new char[textlen];
|
char * text2Find = new char[textlen + 1];
|
||||||
pHighlightView->getSelectedText(text2Find, textlen, false); //do not expand selection (false)
|
pHighlightView->getSelectedText(text2Find, textlen + 1, false); //do not expand selection (false)
|
||||||
|
|
||||||
WcharMbcsConvertor& wmc = WcharMbcsConvertor::getInstance();
|
WcharMbcsConvertor& wmc = WcharMbcsConvertor::getInstance();
|
||||||
UINT cp = static_cast<UINT>(pHighlightView->execute(SCI_GETCODEPAGE));
|
UINT cp = static_cast<UINT>(pHighlightView->execute(SCI_GETCODEPAGE));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user