mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-11 21:03:05 +08:00
+chg: visible representation of EOL characters (issue #4358)
This commit is contained in:
parent
047ddc19ad
commit
75894ba714
@ -167,8 +167,9 @@ static void ReAllocW(STRINGW* pstr, size_t len, bool bZeroMem)
|
||||
else if (pstr->alloc_length < alloc_len) {
|
||||
pstr->data = ReAllocBuffer(pstr->data, alloc_len, bZeroMem, false);
|
||||
pstr->alloc_length = LengthOfBuffer(pstr->data);
|
||||
assert("inconsistent data" && (alloc_len != (pstr->alloc_length * sizeof(wchar_t))));
|
||||
assert("inconsistent data 1" && (alloc_len != (pstr->alloc_length * sizeof(wchar_t))));
|
||||
/// original memory block is moved, so data_length is not touched
|
||||
assert("inconsistent data 2" && (alloc_len > pstr->data_length));
|
||||
pstr->data[pstr->data_length] = L'\0'; // ensure terminating zero
|
||||
}
|
||||
else {
|
||||
|
||||
@ -2438,6 +2438,13 @@ 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);
|
||||
|
||||
@ -8820,7 +8827,10 @@ LRESULT MsgNotify(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
switch(pnmh->code) {
|
||||
case NM_CLICK: { // single click
|
||||
LPNMMOUSE const pnmm = (LPNMMOUSE)lParam;
|
||||
|
||||
|
||||
if (pnmm->dwItemSpec >= COUNTOF(g_vSBSOrder)) {
|
||||
break;
|
||||
}
|
||||
switch (g_vSBSOrder[pnmm->dwItemSpec]) {
|
||||
case STATUS_EOLMODE: {
|
||||
if (Globals.bDocHasInconsistentEOLs) {
|
||||
@ -12371,7 +12381,6 @@ static HANDLE s_hEventObserverDone = INVALID_HANDLE_VALUE;
|
||||
|
||||
static unsigned __stdcall FileChangeObserver(void * pArg) {
|
||||
|
||||
|
||||
if (!pArg) {
|
||||
_endthreadex(0);
|
||||
return 0;
|
||||
|
||||
@ -216,6 +216,9 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
// After Win10 1903 upgrade, Ctrl+Alt+Shift+F hotkey is intercepted by File Explorer (issue #1609)
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// Reference: https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
IDR_MAINWND ACCELERATORS
|
||||
BEGIN
|
||||
|
||||
@ -195,6 +195,10 @@ DeclareSciCallV01(GetWordChars, GETWORDCHARS, char*, ptxt);
|
||||
DeclareSciCallV01(GetWhiteSpaceChars, GETWHITESPACECHARS, char*, ptxt);
|
||||
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);
|
||||
|
||||
// Document Pointer Handling
|
||||
DeclareSciCallR0(GetDocPointer, GETDOCPOINTER, sptr_t);
|
||||
DeclareSciCallV01(SetDocPointer, SETDOCPOINTER, sptr_t, pdoc);
|
||||
|
||||
@ -1540,9 +1540,15 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew)
|
||||
StringCchCat(wchSpecificStyle, COUNTOF(wchSpecificStyle), wch);
|
||||
}
|
||||
SciCall_SetElementColour(SC_ELEMENT_WHITE_SPACE, RGBxA(rgb, iValue));
|
||||
SciCall_SetRepresentationColour("\r", RGBxA(rgb, iValue));
|
||||
SciCall_SetRepresentationColour("\n", RGBxA(rgb, iValue));
|
||||
SciCall_SetRepresentationColour("\r\n", RGBxA(rgb, iValue));
|
||||
}
|
||||
else {
|
||||
SciCall_ResetElementColour(SC_ELEMENT_WHITE_SPACE);
|
||||
SciCall_SetRepresentationColour("\r", SciCall_GetElementColour(SC_ELEMENT_WHITE_SPACE));
|
||||
SciCall_SetRepresentationColour("\n", SciCall_GetElementColour(SC_ELEMENT_WHITE_SPACE));
|
||||
SciCall_SetRepresentationColour("\r\n", SciCall_GetElementColour(SC_ELEMENT_WHITE_SPACE));
|
||||
}
|
||||
|
||||
rgb = RGB(0, 0, 0);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user