mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-14 21:09:05 +08:00
Merge pull request #479 from RaiKoHoff/Bugfixes_RC2_V
+ fix: bug, where styling stopped after hotspot highlighting
This commit is contained in:
commit
f25db39bb1
31
src/Edit.c
31
src/Edit.c
@ -5250,7 +5250,6 @@ INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wParam,LPARA
|
||||
_IGNORE_NOTIFY_CHANGE_;
|
||||
if (EditToggleView(g_hwndEdit, false)) { _DeleteLineStateAll(LINESTATE_OCCURRENCE_MARK); }
|
||||
StringCchCopyA(g_lastFind, COUNTOF(g_lastFind), sg_pefrData->szFind);
|
||||
g_iMarkOccurrencesCount = 0;
|
||||
RegExResult_t match = _FindHasMatch(g_hwndEdit, sg_pefrData, (sg_pefrData->bMarkOccurences), false);
|
||||
if (regexMatch != match) {
|
||||
regexMatch = match;
|
||||
@ -6689,6 +6688,7 @@ static bool __fastcall _HighlightIfBrace(HWND hwnd, DocPos iPos)
|
||||
//=============================================================================
|
||||
//
|
||||
// EditApplyLexerStyle()
|
||||
// if iRangeEnd == -1 : apply style from iRangeStart to document end
|
||||
//
|
||||
void EditApplyLexerStyle(HWND hwnd, DocPos iRangeStart, DocPos iRangeEnd)
|
||||
{
|
||||
@ -6703,20 +6703,33 @@ void EditApplyLexerStyle(HWND hwnd, DocPos iRangeStart, DocPos iRangeEnd)
|
||||
//
|
||||
void EditFinalizeStyling(HWND hwnd, DocPos iEndPos)
|
||||
{
|
||||
if (iEndPos <= 0) {
|
||||
iEndPos = Sci_GetDocEndPosition();
|
||||
}
|
||||
|
||||
DocPos const iEndStyled = SciCall_GetEndStyled();
|
||||
|
||||
if (iEndStyled < iEndPos)
|
||||
if ((iEndPos < 0) || (iEndStyled < iEndPos))
|
||||
{
|
||||
DocLn const iStartLine = SciCall_LineFromPosition(iEndStyled) + 1;
|
||||
DocPos const iStartStyling = SciCall_PositionFromLine(iStartLine);
|
||||
EditApplyLexerStyle(hwnd, iStartStyling, iEndPos);
|
||||
EditApplyLexerStyle(hwnd, iEndStyled, iEndPos);
|
||||
}
|
||||
}
|
||||
|
||||
//void EditFinalizeStyling(HWND hwnd, DocPos iEndPos)
|
||||
//{
|
||||
// if (iEndPos <= 0) {
|
||||
// iEndPos = Sci_GetDocEndPosition();
|
||||
// }
|
||||
//
|
||||
// DocPos const iEndStyled = SciCall_GetEndStyled();
|
||||
//
|
||||
// if (iEndStyled < iEndPos)
|
||||
// {
|
||||
// DocLn const iStartLine = SciCall_LineFromPosition(iEndStyled) + 1;
|
||||
// DocPos const iStartStyling = SciCall_PositionFromLine(iStartLine);
|
||||
// EditApplyLexerStyle(hwnd, iStartStyling, iEndPos);
|
||||
// }
|
||||
//}
|
||||
//
|
||||
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
|
||||
@ -1440,7 +1440,8 @@ static void __fastcall _InitializeSciEditCtrl(HWND hwndEditCtrl)
|
||||
// SC_PERFORMED_UNDO, SC_PERFORMED_REDO, SC_MULTISTEPUNDOREDO, SC_LASTSTEPINUNDOREDO, SC_MOD_CHANGEMARKER,
|
||||
// SC_MOD_BEFOREINSERT, SC_MOD_BEFOREDELETE, SC_MULTILINEUNDOREDO, and SC_MODEVENTMASKALL.
|
||||
//
|
||||
int const evtMask1 = SC_MOD_CONTAINER | SC_PERFORMED_USER | SC_PERFORMED_UNDO | SC_PERFORMED_REDO | SC_MOD_CHANGESTYLE;
|
||||
///~ Don't use: SC_PERFORMED_USER | SC_MOD_CHANGESTYLE;
|
||||
int const evtMask1 = SC_MOD_CONTAINER | SC_PERFORMED_UNDO | SC_PERFORMED_REDO;
|
||||
int const evtMask2 = SC_MOD_INSERTTEXT | SC_MOD_DELETETEXT | SC_MOD_BEFOREINSERT | SC_MOD_BEFOREDELETE;
|
||||
|
||||
SendMessage(hwndEditCtrl, SCI_SETMODEVENTMASK, (WPARAM)(evtMask1 | evtMask2), 0);
|
||||
@ -5770,12 +5771,6 @@ LRESULT MsgNotify(HWND hwnd,WPARAM wParam,LPARAM lParam)
|
||||
RestoreAction(scn->token, REDO);
|
||||
}
|
||||
}
|
||||
else if (iModType & SC_MOD_CHANGESTYLE) {
|
||||
const DocPos iStartPos = (DocPos)scn->position;
|
||||
const DocPos iEndPos = (DocPos)(scn->position + scn->length);
|
||||
EditUpdateUrlHotspots(g_hwndEdit, iStartPos, iEndPos, g_bHyperlinkHotspot);
|
||||
bModified = false; // not yet
|
||||
}
|
||||
if (bModified) {
|
||||
if (g_iMarkOccurrences > 0) {
|
||||
MarkAllOccurrences(iUpdateDelayMarkAllCoccurrences, true);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user