From 6474ab9a22f10312f990060bb7af949ed3b8a3a7 Mon Sep 17 00:00:00 2001 From: Rainer Kottenhoff Date: Wed, 16 Aug 2017 22:58:37 +0200 Subject: [PATCH 1/2] + Save Edit.c and Version.h as UTF-8 w/BOM to make Unicode chars independant from encoding ANSI local codepage. + remove some unneccessary comments with unicode chars --- src/Edit.c | 9 +++++---- src/Notepad3.c | 9 --------- src/Version.h | 10 +++++----- 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/src/Edit.c b/src/Edit.c index 3123e265f..c27a6d95f 100644 --- a/src/Edit.c +++ b/src/Edit.c @@ -1,4 +1,4 @@ -/****************************************************************************** +/****************************************************************************** * * * * * Notepad3 * @@ -1776,11 +1776,12 @@ void EditTitleCase(HWND hwnd) else { - //Slightly enhanced function to make Title Case: Added some '-characters and bPrevWasSpace makes it better (for example "'Don't'" will now work) + // Slightly enhanced function to make Title Case: + // Added some '-characters and bPrevWasSpace makes it better (for example "'Don't'" will now work) bPrevWasSpace = TRUE; for (i = 0; i < cchTextW; i++) { - if (!IsCharAlphaNumericW(pszTextW[i]) && (!StrChr(L"'`´’",pszTextW[i]) || bPrevWasSpace ) ) + if (!IsCharAlphaNumericW(pszTextW[i]) && (!StrChr(L"'`΄’",pszTextW[i]) || bPrevWasSpace ) ) { bNewWord = TRUE; } @@ -4068,7 +4069,7 @@ void EditWrapToColumn(HWND hwnd,int nColumn/*,int nTabWidth*/) cchConvW = 0; iLineLength = 0; -#define ISDELIMITER(wc) StrChr(L",;.:-+%&¦|/*?!\"\'~´#=",wc) +#define ISDELIMITER(wc) StrChr(L",;.:-+%&¦|/*?!\"\'~΄#=",wc) #define ISWHITE(wc) StrChr(L" \t",wc) #define ISWORDEND(wc) (/*ISDELIMITER(wc) ||*/ StrChr(L" \t\r\n",wc)) diff --git a/src/Notepad3.c b/src/Notepad3.c index 0d1d3eaa1..7afd05b16 100644 --- a/src/Notepad3.c +++ b/src/Notepad3.c @@ -3774,10 +3774,6 @@ LRESULT MsgCommand(HWND hwnd,WPARAM wParam,LPARAM lParam) } else { - // define (behöver bara göra detta en gÃ¥ng egentligen) - //SendMessage( hwndEdit , SCI_MARKERSETBACK , 0 , 74 | (203 << 8) | (0 << 16) ); //behöver bara göra detta en gÃ¥ng egentligen - //SendMessage( hwndEdit , SCI_MARKERDEFINE , 0 , SC_MARK_ARROWS ); //behöver bara göra detta en gÃ¥ng egentligen - if( bShowSelectionMargin ) { SendMessage( hwndEdit , SCI_MARKERDEFINEPIXMAP , 0 , (LPARAM)bookmark_pixmap ); @@ -3788,11 +3784,6 @@ LRESULT MsgCommand(HWND hwnd,WPARAM wParam,LPARAM lParam) SendMessage( hwndEdit , SCI_MARKERSETALPHA , 0 , 20); SendMessage( hwndEdit , SCI_MARKERDEFINE , 0 , SC_MARK_BACKGROUND ); } - - - //SendMessage( hwndEdit , SCI_MARKERSETBACK , 0 , 180 | (255 << 8) | (180 << 16) ); //behöver bara göra detta en gÃ¥ng egentligen - //SendMessage( hwndEdit , SCI_MARKERDEFINE , 0 , SC_MARK_BACKGROUND ); //behöver bara göra detta en gÃ¥ng egentligen - // set SendMessage( hwndEdit , SCI_MARKERADD , iLine , 0 ); //SendMessage( hwndEdit , SCI_MARKERADD , iLine , 1 ); diff --git a/src/Version.h b/src/Version.h index 0ac4803f1..dd5624f60 100644 --- a/src/Version.h +++ b/src/Version.h @@ -1,4 +1,4 @@ -/****************************************************************************** +/****************************************************************************** * * * * * Notepad3 * @@ -32,11 +32,11 @@ #define VERSION_FILEVERSION_NUM VERSION_MAJOR,VERSION_MINOR,VERSION_REV,VERSION_BUILD #define VERSION_FILEVERSION STRINGIFY(VERSION_MAJOR) "." STRINGIFY(VERSION_MINOR) "." \ STRINGIFY(VERSION_REV) "." STRINGIFY(VERSION_BUILD) -#define VERSION_LEGALCOPYRIGHT L"Copyright © 2008-2017 Rizonesoft" -//#define VERSION_LEGALCOPYRIGHT_LONG L"© Rizonesoft 2008-2016" -#define VERSION_AUTHORNAME L"Rizonesoft" +#define VERSION_LEGALCOPYRIGHT L"Copyright © 2008-2017 Rizonesoft" +//#define VERSION_LEGALCOPYRIGHT_LONG L"© Rizonesoft 2008-2017" +#define VERSION_AUTHORNAME L"© Rizonesoft" #define VERSION_WEBPAGEDISPLAY L"https://www.rizonesoft.com" -#define VERSION_COMPANYNAME L"Rizonesoft" +#define VERSION_COMPANYNAME L"© Rizonesoft" #define VERSION_MODPAGEDISPLAY L"https://xhmikosr.github.io/notepad2-mod/" #define VERSION_WEBPAGE2DISPLAY L"http://www.flos-freeware.ch" #define VERSION_SCIVERSION L"Scintilla Library Version: 375" From 362738769a13a0efaa1a0f8eebcd75567fd1a20a Mon Sep 17 00:00:00 2001 From: Rainer Kottenhoff Date: Thu, 17 Aug 2017 08:47:57 +0200 Subject: [PATCH 2/2] + update to Scintilla 376 (root of long term maintenance branch avoiding C++14, C++17 and later features) (one change only: the Baan lexer correctly highlights numbers when followed by an operator.) --- scintilla/lexers/LexBaan.cxx | 2 +- scintilla/version.txt | 2 +- src/Version.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scintilla/lexers/LexBaan.cxx b/scintilla/lexers/LexBaan.cxx index ab96a0db5..98ff94a16 100644 --- a/scintilla/lexers/LexBaan.cxx +++ b/scintilla/lexers/LexBaan.cxx @@ -523,7 +523,7 @@ void SCI_METHOD LexerBaan::Lex(Sci_PositionU startPos, Sci_Position length, int sc.SetState(SCE_BAAN_DEFAULT); break; case SCE_BAAN_NUMBER: - if (IsASpaceOrTab(sc.ch) || sc.ch == '\r' || sc.ch == '\n') { + if (IsASpaceOrTab(sc.ch) || sc.ch == '\r' || sc.ch == '\n' || IsAnOperator(sc.ch)) { sc.SetState(SCE_BAAN_DEFAULT); } else if ((numberIsHex && !(MakeLowerCase(sc.ch) == 'x' || MakeLowerCase(sc.ch) == 'e' || diff --git a/scintilla/version.txt b/scintilla/version.txt index d9061d95d..100000a67 100644 --- a/scintilla/version.txt +++ b/scintilla/version.txt @@ -1 +1 @@ -375 +376 diff --git a/src/Version.h b/src/Version.h index dd5624f60..c496a9c90 100644 --- a/src/Version.h +++ b/src/Version.h @@ -39,7 +39,7 @@ #define VERSION_COMPANYNAME L"© Rizonesoft" #define VERSION_MODPAGEDISPLAY L"https://xhmikosr.github.io/notepad2-mod/" #define VERSION_WEBPAGE2DISPLAY L"http://www.flos-freeware.ch" -#define VERSION_SCIVERSION L"Scintilla Library Version: 375" +#define VERSION_SCIVERSION L"Scintilla Library Version: 376" #if defined(_WIN64) #define VERSION_FILEVERSION_LONG L"Notepad3 (64-bit) " STRINGIFY(VERSION_MAJOR) L" Build " \