From 40e44f3f44d9d8dfad145fc69d7e7709b617eb34 Mon Sep 17 00:00:00 2001 From: "METANEOCORTEX\\Kotti" Date: Sun, 19 Feb 2023 12:24:40 +0100 Subject: [PATCH] +fix: representation of EOLs in case of GDI technology (use default) --- src/Notepad3.c | 9 +-------- src/SciCall.h | 1 + src/Styles.c | 13 +++++++++++++ 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/Notepad3.c b/src/Notepad3.c index 52bc44bf4..e48063852 100644 --- a/src/Notepad3.c +++ b/src/Notepad3.c @@ -2529,13 +2529,6 @@ static void _InitializeSciEditCtrl(HWND hwndEditCtrl) SciCall_SetMarginOptions(SC_MARGINOPTION_SUBLINESELECT); // Nonprinting characters - SciCall_SetRepresentation("\r", "\xE2\x86\x90"); - SciCall_SetRepresentationAppearance("\r", SC_REPRESENTATION_COLOUR); - SciCall_SetRepresentation("\n", "\xE2\x86\x93"); - SciCall_SetRepresentationAppearance("\n", SC_REPRESENTATION_COLOUR); - SciCall_SetRepresentation("\r\n", "\xE2\x86\xB2"); // "\xE2\xAE\x92" - SciCall_SetRepresentationAppearance("\r\n", SC_REPRESENTATION_COLOUR); - /// (!) -> SciCall_SetRepresentationColour() in Styles.c SciCall_SetViewWS(Settings.ViewWhiteSpace ? SCWS_VISIBLEALWAYS : SCWS_INVISIBLE); SciCall_SetViewEOL(Settings.ViewEOLs); @@ -6399,7 +6392,7 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam) Settings.Bidirectional = SciCall_GetBidirectional(); if ((prevRT != Settings.RenderingTechnology) || (prevBD != Settings.Bidirectional)) { - UpdateMargins(true); + Style_ResetCurrentLexer(Globals.hwndEdit); } } break; diff --git a/src/SciCall.h b/src/SciCall.h index 9d076ef82..3bcaf2581 100644 --- a/src/SciCall.h +++ b/src/SciCall.h @@ -204,6 +204,7 @@ DeclareSciCallV01(GetPunctuationChars, GETPUNCTUATIONCHARS, char*, ptxt); DeclareSciCallV2(SetRepresentation, SETREPRESENTATION, const char*, encChar, const char*, represent); DeclareSciCallV2(SetRepresentationColour, SETREPRESENTATIONCOLOUR, const char*, encChar, COLORALPHAREF, colour); DeclareSciCallV2(SetRepresentationAppearance, SETREPRESENTATIONAPPEARANCE, const char*, encChar, int, appear); +DeclareSciCallV0(ClearAllRepresentations, CLEARALLREPRESENTATIONS); // Document Pointer Handling DeclareSciCallR0(GetDocPointer, GETDOCPOINTER, sptr_t); diff --git a/src/Styles.c b/src/Styles.c index fc0e82567..f9da94493 100644 --- a/src/Styles.c +++ b/src/Styles.c @@ -1533,6 +1533,19 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) //@@@SciCall_SetWhiteSpaceSize(MulDiv(iValue, SciCall_GetZoom(), 100)); // needs update on zoom SciCall_SetWhiteSpaceSize(iValue); + // Nonprinting characters + if (SciCall_GetTechnology() == SC_TECHNOLOGY_DEFAULT) { + SciCall_ClearAllRepresentations(); + } + else { + SciCall_SetRepresentation("\r", "\xE2\x86\x90"); + SciCall_SetRepresentationAppearance("\r", SC_REPRESENTATION_COLOUR); + SciCall_SetRepresentation("\n", "\xE2\x86\x93"); + SciCall_SetRepresentationAppearance("\n", SC_REPRESENTATION_COLOUR); + SciCall_SetRepresentation("\r\n", "\xE2\x86\xB2"); // "\xE2\xAE\x92" + SciCall_SetRepresentationAppearance("\r\n", SC_REPRESENTATION_COLOUR); + } + // whitespace colors rgb = RGB(0, 0, 0); rgbWrt = rgb;