From ffb2e95f5cb8c33e186f04ae2e66d5e773430462 Mon Sep 17 00:00:00 2001 From: Rainer Kottenhoff Date: Sat, 23 Dec 2017 10:51:36 +0100 Subject: [PATCH] + fix: set standard lexer (Default Text) on new (empty) files --- src/Notepad3.c | 8 +++----- src/Styles.c | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Notepad3.c b/src/Notepad3.c index 893c61548..435348410 100644 --- a/src/Notepad3.c +++ b/src/Notepad3.c @@ -1159,11 +1159,9 @@ LRESULT CALLBACK MainWndProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam) // update Scintilla colors case WM_SYSCOLORCHANGE: - { - Style_SetLexer(g_hwndEdit,NULL); // uses current lexer - UpdateLineNumberWidth(); - return DefWindowProc(hwnd,umsg,wParam,lParam); - } + SendMessage(g_hwndEdit, SCI_COLOURISE, 0, (LPARAM)-1); + UpdateLineNumberWidth(); + return DefWindowProc(hwnd,umsg,wParam,lParam); //case WM_TIMER: // return DefWindowProc(hwnd,umsg,wParam,lParam); diff --git a/src/Styles.c b/src/Styles.c index 02bac0c56..0073f3503 100644 --- a/src/Styles.c +++ b/src/Styles.c @@ -3129,9 +3129,9 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { WCHAR wchFontName[64] = { '\0' }; WCHAR wchCaretStyle[64] = { L'\0' }; - // Select current if NULL is specified + // Select standard if NULL is specified if (!pLexNew) { - pLexNew = g_pLexCurrent; // initially current lexer is default lexer + pLexNew = &lexStandard; } // Lexer