Merge remote-tracking branch 'upstream/master' into Dev_DarkMode

This commit is contained in:
RaiKoHoff 2020-09-01 10:03:28 +02:00
commit e9eb372e12
14 changed files with 178 additions and 175 deletions

View File

@ -33,7 +33,7 @@ SUP - (S)et(UP) / Installer Package
========================================================
Current BETA/RC Version 5.20.830.(build_#) (2020-08-30)
Current BETA/RC Version 5.20.831.(build_#) (2020-08-31)
========================================================
--------------------------------------------------------
@ -100,6 +100,8 @@ ENHANCEMENT:
FIXES:
--------------------------------------------------------
[.###.#]-
[.831.1]- Recent File List (File History): Disable OK/Remove on empty list.
[.831.1]- Enhanced internal icon/bitmap handling.
[.830.1]- Remove needless function.
[.830.1]- F/R Dialog: Auto-Esc-Chars handling.
[.830.1]- F/R Dialog: Clear F/R History - remove entries from .ini-file too.

View File

@ -13,9 +13,10 @@ Notepad3 is a fast and light-weight Scintilla-based text editor with syntax high
* Latest changelog (release notes) - https://www.rizonesoft.com/downloads/notepad3/update
* Notepad3 Documentation - https://www.rizonesoft.com/documents/notepad3
## Message Rizonesoft
## Rizonesoft Support
As an added service for Notepad3 users; Rizonesoft uses [Telegram](https://telegram.org) to provide free support. Simply download Telegram on your preferred device and use [this link](https://t.me/rizonesoft) to message us.
* **[GET IN TOUCH](https://www.rizonesoft.com/#contact)**
* **Premium Support** - On Rizonesoft, support is free and we will assist you the best we can. Please be patient when contacting us; there are mainly volunteers working on Rizonesoft projects and time is a precious commodity.
## Changes compared to Flo's official [Notepad2](http://www.flos-freeware.ch/notepad2.html) (made in [Notepad2-mod](https://xhmikosr.github.io/notepad2-mod/)):
@ -59,10 +60,11 @@ As an added service for Notepad3 users; Rizonesoft uses [Telegram](https://teleg
# References
Review of **Notepad3** posted by the moderator [Karston](https://www.nsaneforums.com/profile/12756-karlston/) at [nsane.forums](https://www.nsaneforums.com/)
Seen on Nsane Forums: [Notepad3 is an advanced text editor...](https://www.nsaneforums.com/topic/382910-guidereview-notepad3-is-an-advanced-text-editor-that-supports-many-programming-languages/)
Seen on Nsane Forums: [Notepad3 is an advanced text editor...](https://www.nsaneforums.com/topic/382910-guidereview-notepad3-is-an-advanced-text-editor-that-supports-many-programming-languages/), a review of **Notepad3** posted by the moderator [Karston](https://www.nsaneforums.com/profile/12756-karlston/) at [nsane.forums](https://www.nsaneforums.com/).
To be correct and complete, this **Notepad3's review** is written on 2020-08-11 by **[Ashwin](https://www.ghacks.net/author/ashwin/)** and posted on **[gHacks](https://www.ghacks.net/)**.
Original source: **[Notepad3 is an advanced text editor that supports many programming languages](https://www.ghacks.net/2020/08/11/notepad3-is-an-advanced-text-editor-that-supports-many-programming-languages/)**
Original source: **[Notepad3 is an advanced text editor that supports many programming languages](https://www.ghacks.net/2020/08/11/notepad3-is-an-advanced-text-editor-that-supports-many-programming-languages/)**.
<hr/>

View File

@ -1 +1 @@
830
831

View File

@ -455,7 +455,7 @@ END
STRINGTABLE
BEGIN
IDS_LEX_STR_63357 "Dla każdej definicji"
IDS_LEX_STR_63358 "While Definition"
IDS_LEX_STR_63358 "Cała definicja"
IDS_LEX_STR_63359 "Matematyka"
IDS_LEX_STR_63360 "Skalar"
IDS_LEX_STR_63361 "Zastąpienie"
@ -464,8 +464,8 @@ BEGIN
IDS_LEX_STR_63364 "Nazwa własności"
IDS_LEX_STR_63365 "Klucz LD"
IDS_LEX_STR_63366 "Sekwencja ESC"
IDS_LEX_STR_63367 "Unicode-Point Hover"
IDS_LEX_STR_63368 "2nd Unicode-Point Hover"
IDS_LEX_STR_63367 "Punkt najechania Unicode"
IDS_LEX_STR_63368 "Drugi punkt najechania Unicode"
END
STRINGTABLE

View File

@ -64,9 +64,9 @@ BEGIN
MENUITEM "Zapisz &kopię...\tCtrl+F6", IDM_FILE_SAVECOPY
MENUITEM "Zapisz oryginalny plik, datę / czas\tCtrl+Alt+F6", IDM_FILE_PRESERVE_FILEMODTIME
MENUITEM SEPARATOR
MENUITEM "&Tylko do odczytu", IDM_FILE_READONLY
MENUITEM "&Tylko do odczytu", IDM_FILE_READONLY
MENUITEM SEPARATOR
MENUITEM "Ustaw hasło szyfrowania...", IDM_SETPASS
MENUITEM "Ustaw hasło szyfrowania...", IDM_SETPASS
MENUITEM SEPARATOR
POPUP "Ścieżka do Schowka"
BEGIN
@ -93,23 +93,23 @@ BEGIN
MENUITEM "Otwórz Eksplorator pliku", IDM_FILE_EXPLORE_DIR
END
MENUITEM SEPARATOR
MENUITEM "Re&vert from File\tF5", IDM_FILE_REVERT
MENUITEM "Powróć z pliku\tF5", IDM_FILE_REVERT
POPUP "&Kodowanie"
BEGIN
POPUP "&Revert from File as"
POPUP "&Powróć z pliku jako"
BEGIN
MENUITEM "&Default (Setting)", CMD_RECODEDEFAULT
MENUITEM "&Domyślnie (Setting)", CMD_RECODEDEFAULT
MENUITEM "&ANSI\tCtrl+Shift+A", CMD_RECODEANSI
MENUITEM "&OEM\tCtrl+Shift+O", CMD_RECODEOEM
MENUITEM "&GB18030\tCtrl+Shift+F10", CMD_RECODEGB18030
MENUITEM SEPARATOR
MENUITEM "ASCII jako UTF-&8\tCtrl+Shift+F8", CMD_RELOADASCIIASUTF8
MENUITEM "Force U&CHARDET Analysis", CMD_RELOADFORCEDETECTION
MENUITEM "Wymuś analizę U&CHARDET", CMD_RELOADFORCEDETECTION
MENUITEM "Ignoruj znaczniki &kodowania\tAlt+F8", CMD_RELOADNOFILEVARS
MENUITEM SEPARATOR
MENUITEM "&More Encodings...\tF8", IDM_ENCODING_RECODE
MENUITEM "&Więcej kodowań...\tF8", IDM_ENCODING_RECODE
END
POPUP "&Set Document as"
POPUP "&Ustaw dokument jako"
BEGIN
MENUITEM "&ANSI", IDM_ENCODING_ANSI
MENUITEM "&Unicode", IDM_ENCODING_UNICODE
@ -117,10 +117,10 @@ BEGIN
MENUITEM "UTF-&8\tShift+F8", IDM_ENCODING_UTF8
MENUITEM "UTF-8 z &sygnaturą", IDM_ENCODING_UTF8SIGN
MENUITEM SEPARATOR
MENUITEM "&More Encodings...\tF9", IDM_ENCODING_SELECT
MENUITEM "&Więcej kodowań...\tF9", IDM_ENCODING_SELECT
END
MENUITEM SEPARATOR
MENUITEM "Set Encoding &Defaults...", IDM_ENCODING_SETDEFAULT
MENUITEM "Ustawienia domyślne kodowania...", IDM_ENCODING_SETDEFAULT
END
POPUP "Znak końca wiersza"
BEGIN
@ -179,10 +179,10 @@ BEGIN
MENUITEM "Przenieś w górę\tCtrl+Shift+ ↑", IDM_EDIT_MOVELINEUP
MENUITEM "&Przenieś w dół\tCtrl+Shift+ ↓", IDM_EDIT_MOVELINEDOWN
MENUITEM SEPARATOR
MENUITEM "Wytnij wybór lub bieżący wiersz\tCtrl+X", IDM_EDIT_CUT
MENUITEM "Wytnij cały wiersz wyboru\tCtrl+Shift+X", IDM_EDIT_CUTLINE
MENUITEM "&Kopiuj wybór lub bieżący wiersz\tCtrl+C", IDM_EDIT_COPY
MENUITEM "Kopiuj cały wiersz wyboru\tCtrl+Shift+C", IDM_EDIT_COPYLINE
MENUITEM "Wytnij wybór lub bieżący wiersz\tCtrl+X", IDM_EDIT_CUT
MENUITEM "Wytnij cały wiersz wyboru\tCtrl+Shift+X", IDM_EDIT_CUTLINE
MENUITEM "&Kopiuj wybór lub bieżący wiersz\tCtrl+C", IDM_EDIT_COPY
MENUITEM "Kopiuj cały wiersz wyboru\tCtrl+Shift+C", IDM_EDIT_COPYLINE
MENUITEM SEPARATOR
MENUITEM "&Utwórz duplikat wiersza/wyboru\tCtrl+D", IDM_EDIT_DUPLINEORSELECTION
MENUITEM "&Zamień wiersze\tAlt+D", IDM_EDIT_LINETRANSPOSE
@ -232,9 +232,9 @@ BEGIN
MENUITEM "Usuń niewidoczne końcowe znaki\tAlt+W", IDM_EDIT_TRIMLINES
MENUITEM "Skompresuj niewidoczne znaki\tCtrl+Alt+P", IDM_EDIT_COMPRESS_BLANKS
MENUITEM SEPARATOR
MENUITEM "&Modyfikuj wiersze...\tAlt+M", IDM_EDIT_MODIFYLINES
MENUITEM "&Wyrównaj wiersze...\tAlt+J", IDM_EDIT_ALIGN
MENUITEM "&Posortuj wiersze...\tAlt+O", IDM_EDIT_SORTLINES
MENUITEM "&Modyfikuj wiersze...\tAlt+M", IDM_EDIT_MODIFYLINES
MENUITEM "&Wyrównaj wiersze...\tAlt+J", IDM_EDIT_ALIGN
MENUITEM "&Posortuj wiersze...\tAlt+O", IDM_EDIT_SORTLINES
END
POPUP "Ko&nwertuj"
BEGIN
@ -275,7 +275,7 @@ BEGIN
END
POPUP "&Różne"
BEGIN
MENUITEM "Kopiuj&GUID do Schowka\tCtrl+Shift+.", IDM_EDIT_INSERT_GUID
MENUITEM "Kopiuj&GUID do Schowka\tCtrl+Shift+.", IDM_EDIT_INSERT_GUID
MENUITEM SEPARATOR
MENUITEM "&Znaki ucieczki\tCtrl+Alt+E", IDM_EDIT_ESCAPECCHARS
MENUITEM "&Usuń znaki ucieczki\tCtrl+Alt+R", IDM_EDIT_UNESCAPECCHARS
@ -292,7 +292,7 @@ BEGIN
MENUITEM "Zaznacz wyraz lub wiersz\tCtrl+Spc", IDM_EDIT_SELECTWORD
MENUITEM "Multiwybór-wszystko pasujące\tCtrl+Shift+Spc", IDM_EDIT_SELECTALLMATCHES
MENUITEM SEPARATOR
MENUITEM "Podział operacji cofania przy przenoszeniu wierszy", IDM_VIEW_SPLIT_UNDOTYPSEQ_LNBRK
MENUITEM "Podział operacji cofania przy przenoszeniu wierszy", IDM_VIEW_SPLIT_UNDOTYPSEQ_LNBRK
END
MENUITEM SEPARATOR
POPUP "Zakładki"
@ -317,7 +317,7 @@ BEGIN
MENUITEM "Zamień następny\tF4", IDM_EDIT_REPLACENEXT
MENUITEM "&Przejdź do wiersza...\tCtrl+G", IDM_EDIT_GOTOLINE
MENUITEM SEPARATOR
MENUITEM "&Szukaj w plikach\tCtrl+Shift+F", IDM_GREP_WIN_SEARCH
MENUITEM "&Szukaj w plikach\tCtrl+Shift+F", IDM_GREP_WIN_SEARCH
END
END
POPUP "&Widok"
@ -338,7 +338,7 @@ BEGIN
MENUITEM "&A+RGB" IDM_VIEW_COLOR_ARGB
MENUITEM "&BGRA" IDM_VIEW_COLOR_BGRA
END
MENUITEM "Highlight &Unicode-Points", IDM_VIEW_UNICODE_POINTS
MENUITEM "Podświetl punkty &Unicode", IDM_VIEW_UNICODE_POINTS
MENUITEM "&Wyróżnianie pasujących nawiasów\tCtrl+Shift+V", IDM_VIEW_MATCHBRACES
POPUP "Wyróżnianie bieżącego wiersza\tCtrl+Shift+I"
BEGIN
@ -349,7 +349,7 @@ BEGIN
POPUP "Oznacz zdarzenia"
BEGIN
MENUITEM "&Aktywuj\tAlt+A", IDM_VIEW_MARKOCCUR_ONOFF
MENUITEM "Use &Bookmarks too", IDM_VIEW_MARKOCCUR_BOOKMARKS
MENUITEM "Użyj też zakładek", IDM_VIEW_MARKOCCUR_BOOKMARKS
MENUITEM SEPARATOR
MENUITEM "Dopasuj tylko widoczne", IDM_VIEW_MARKOCCUR_VISIBLE
MENUITEM SEPARATOR
@ -363,7 +363,7 @@ BEGIN
END
MENUITEM SEPARATOR
MENUITEM "Numery wierszy\tCtrl+Shift+N", IDM_VIEW_LINENUMBERS
MENUITEM "Bookmark &Margin\tCtrl+Shift+M", IDM_VIEW_BOOKMARK_MARGIN
MENUITEM "&Margines zakładki\tCtrl+Shift+M", IDM_VIEW_BOOKMARK_MARGIN
MENUITEM SEPARATOR
POPUP "&Składanie"
BEGIN
@ -379,13 +379,13 @@ BEGIN
POPUP "&Pokaż"
BEGIN
MENUITEM "Widok skupiony\tCtrl+Alt+V", IDM_VIEW_TOGGLE_VIEW
POPUP "View Mode"
POPUP "Tryb podglądu"
BEGIN
MENUITEM "Fold", IDM_VIEW_FV_FOLD
MENUITEM "Bookmark", IDM_VIEW_FV_BOOKMARK
MENUITEM "Highlight", IDM_VIEW_FV_HIGHLIGHT
MENUITEM "Bookmark && Fold", IDM_VIEW_FV_BKMRKFOLD
MENUITEM "Highlight && Fold", IDM_VIEW_FV_HIGHLGFOLD
MENUITEM "Zwiń", IDM_VIEW_FV_FOLD
MENUITEM "Zakładka", IDM_VIEW_FV_BOOKMARK
MENUITEM "Podświetlenie", IDM_VIEW_FV_HIGHLIGHT
MENUITEM "Zakładka && zagięcie", IDM_VIEW_FV_BKMRKFOLD
MENUITEM "Podświetlenie && zagięcie", IDM_VIEW_FV_HIGHLGFOLD
END
MENUITEM SEPARATOR
MENUITEM "Dziennik &monitorowania", IDM_VIEW_CHASING_DOCTAIL
@ -402,7 +402,7 @@ BEGIN
MENUITEM "&Załaduj motyw paska narzędzi...", IDM_VIEW_LOADTHEMETB
MENUITEM "Dostosuj pasek narzędzi...", IDM_VIEW_CUSTOMIZETB
MENUITEM "Przełącz paski narzędzi", IDM_VIEW_TOGGLETB
MENUITEM "&Pasek narzędzi w skali DPI", IDM_VIEW_DPISCALETB
MENUITEM "&Pasek narzędzi w skali DPI", IDM_VIEW_DPISCALETB
END
POPUP "&Powiększenie"
BEGIN
@ -418,7 +418,7 @@ BEGIN
MENUITEM "Wyczyść zapisaną domyślną pozycję", CMD_CLEARSAVEDWINPOS
MENUITEM "Pozycja początkowa\tCtrl+F11", CMD_INITIALWINPOS
MENUITEM "Przełącz pozycję całego obszaru\tF11", CMD_FULLSCRWINPOS
MENUITEM "Stała pozycja okna", IDM_VIEW_STICKYWINPOS
MENUITEM "Stała pozycja okna", IDM_VIEW_STICKYWINPOS
END
END
POPUP "&Wygląd"
@ -440,7 +440,7 @@ BEGIN
MENUITEM "Automatyczne wcięcie", IDM_VIEW_AUTOINDENTTEXT
MENUITEM "Automatyczne zamykanie &HTML/XML\tCtrl+Shift+H", IDM_VIEW_AUTOCLOSETAGS
MENUITEM "A&utouzupełnianie wyrazów", IDM_VIEW_AUTOCOMPLETEWORDS
MENUITEM "Autouzupełnianie Lekserem", IDM_VIEW_AUTOCLEXKEYWORDS
MENUITEM "Autouzupełnianie Lekserem", IDM_VIEW_AUTOCLEXKEYWORDS
MENUITEM "Przyspieszona nawigacja wyrazów\tCtrl+Alt+A", IDM_VIEW_ACCELWORDNAV
MENUITEM "Włącz edycję wierszy bloku komentarzy", IDM_VIEW_EDIT_LINECOMMENT
MENUITEM SEPARATOR
@ -454,7 +454,7 @@ BEGIN
MENUITEM "Zamknij Notepad3", IDM_VIEW_ESCEXIT
END
MENUITEM "Zapisz przed uruchomieniem narzędzi", IDM_VIEW_SAVEBEFORERUNNINGTOOLS
MENUITEM "Calculate Tiny-E&xpressions", IDM_VIEW_EVALTINYEXPRONSEL
MENUITEM "Przelicz niewielkie wyrażenia", IDM_VIEW_EVALTINYEXPRONSEL
MENUITEM SEPARATOR
POPUP "&Zapamiętaj"
BEGIN
@ -467,7 +467,7 @@ BEGIN
POPUP "Wyświetlenie tytułu okna"
BEGIN
MENUITEM "Tylko nazwa pliku", IDM_VIEW_SHOWFILENAMEONLY
MENUITEM "Nazwapliku i katalog", IDM_VIEW_SHOWFILENAMEFIRST
MENUITEM "Nazwa pliku i katalog", IDM_VIEW_SHOWFILENAMEFIRST
MENUITEM "Pełna ścieżka", IDM_VIEW_SHOWFULLPATH
MENUITEM "&Fragment tekstu\tCtrl+9", IDM_VIEW_SHOWEXCERPT
END
@ -485,10 +485,10 @@ BEGIN
MENUITEM "Direct&Write GDI DC", IDM_SET_RENDER_TECH_D2DDC
MENUITEM "&GDI (bez ligatury)", IDM_SET_RENDER_TECH_GDI
END
POPUP "R&TL Layout (GDI)"
POPUP "Układ R&TL (GDI)"
BEGIN
MENUITEM "&Edit Area", IDM_SET_RTL_LAYOUT_EDIT
MENUITEM "&Other Dialogs", IDM_SET_RTL_LAYOUT_DLG
MENUITEM "&Edytuj obszar", IDM_SET_RTL_LAYOUT_EDIT
MENUITEM "&Inne dialogi", IDM_SET_RTL_LAYOUT_DLG
END
POPUP "&Dwukierunkowa"
BEGIN
@ -551,14 +551,14 @@ BEGIN
END
POPUP "+"
BEGIN
MENUITEM "Clear Marker", IDM_EDIT_CLEAR_MARKER
MENUITEM "Cut Lines of Marker-Type", IDM_EDIT_CUT_MARKED
MENUITEM "Copy Lines of Marker-Type", IDM_EDIT_COPY_MARKED
MENUITEM "Delete Lines of Marker-Type", IDM_EDIT_DELETE_MARKED
MENUITEM "Wyczyść znacznik", IDM_EDIT_CLEAR_MARKER
MENUITEM "Wytnij linie typu znacznika", IDM_EDIT_CUT_MARKED
MENUITEM "Kopiuj linie typu znacznika", IDM_EDIT_COPY_MARKED
MENUITEM "Usuń linie typu znacznika", IDM_EDIT_DELETE_MARKED
MENUITEM SEPARATOR
MENUITEM "Składanie kodu", IDM_VIEW_FOLDING
MENUITEM "Numery wierszy", IDM_VIEW_LINENUMBERS
MENUITEM "Bookmark Margin", IDM_VIEW_BOOKMARK_MARGIN
MENUITEM "Margines zakładki", IDM_VIEW_BOOKMARK_MARGIN
END
POPUP "+"
BEGIN

View File

@ -159,7 +159,7 @@ BEGIN
IDS_MUI_EOLMODENAME_LF "Unix/Mac (LF)"
IDS_MUI_EOLMODENAME_CR "Old Mac (CR)"
IDS_MUI_WARN_NORMALIZE_EOLS
"Do you want to normalise all line endings to be '%s'?"
"Czy chcesz znormalizować wszystkie zakończenia linii '%s'?"
END
STRINGTABLE
@ -255,11 +255,11 @@ BEGIN
IDM_THEMES_FILE_ITEM "&Ustawienia standardowe"
IDS_MUI_STATUSBAR_PREFIXES "Ln ,kol ,Sel ,Sb ,SLn ,Occ ,,,,,,,Ch ,Repl ,Podn ,"
IDS_MUI_STATUSBAR_POSTFIXES ",,,,,,,,,,,,,,,"
IDS_CLEAR_ALL "Clear All"
IDS_CLEAR_ALL "Wyczyść wszystko"
IDS_MUI_CLEAR_FIND_HISTORY
"Clear Find History"
"Wyczyść Znajdź Historię"
IDS_MUI_CLEAR_REPL_HISTORY
"Clear Replace History"
"Wyczyść Zamień Historię"
END
STRINGTABLE

View File

@ -3,7 +3,7 @@
<assemblyIdentity
name="Notepad3"
processorArchitecture="*"
version="5.20.830.1"
version="5.20.831.1"
type="win32"
/>
<description>Notepad3 rc</description>

View File

@ -1569,7 +1569,7 @@ void LoadSettings()
IniSectionGetString(IniSecSettings2, L"DefaultWindowPosition", Defaults2.DefaultWindowPosition,
Settings2.DefaultWindowPosition, COUNTOF(Settings2.DefaultWindowPosition));
bool const bExplicitDefaultWinPos = (StringCchLenW(Settings2.DefaultWindowPosition, 0) != 0);
bool const bExplicitDefaultWinPos = StrIsNotEmpty(Settings2.DefaultWindowPosition);
// 1st set default window position
@ -2495,7 +2495,7 @@ void MRU_Save(LPMRULIST pmru)
StringCchPrintf(tchName, COUNTOF(tchName), L"ANC%.2i", i + 1);
IniSectionSetPos(RegKey_Section, tchName, pmru->iSelAnchPos[i]);
}
if (pmru->pszBookMarks[i] && (StringCchLenW(pmru->pszBookMarks[i], MRU_BMRK_SIZE) > 0)) {
if (StrIsNotEmpty(pmru->pszBookMarks[i])) {
StringCchPrintf(tchName, COUNTOF(tchName), L"BMRK%.2i", i + 1);
IniSectionSetString(RegKey_Section, tchName, pmru->pszBookMarks[i]);
}

View File

@ -254,7 +254,8 @@ void EditInitWordDelimiter(HWND hwnd)
StringCchCopyA(WhiteSpaceCharsAccelerated, COUNTOF(WhiteSpaceCharsAccelerated), WhiteSpaceCharsDefault);
// add only 7-bit-ASCII chars to accelerated whitespace list
for (size_t i = 0; i < StringCchLenA(whitesp, ANSI_CHAR_BUFFER); i++) {
size_t const wsplen = StringCchLenA(whitesp, ANSI_CHAR_BUFFER);
for (size_t i = 0; i < wsplen; i++) {
if (whitesp[i] & 0x7F) {
if (!StrChrA(WhiteSpaceCharsAccelerated, whitesp[i])) {
StringCchCatNA(WhiteSpaceCharsAccelerated, COUNTOF(WhiteSpaceCharsAccelerated), &(whitesp[i]), 1);
@ -265,7 +266,8 @@ void EditInitWordDelimiter(HWND hwnd)
// construct word char array
StringCchCopyA(WordCharsAccelerated, COUNTOF(WordCharsAccelerated), WordCharsDefault); // init
// add punctuation chars not listed in white-space array
for (size_t i = 0; i < StringCchLenA(PunctuationCharsDefault, ANSI_CHAR_BUFFER); i++) {
size_t const pcdlen = StringCchLenA(PunctuationCharsDefault, ANSI_CHAR_BUFFER);
for (size_t i = 0; i < pcdlen; i++) {
if (!StrChrA(WhiteSpaceCharsAccelerated, PunctuationCharsDefault[i])) {
StringCchCatNA(WordCharsAccelerated, COUNTOF(WordCharsAccelerated), &(PunctuationCharsDefault[i]), 1);
}
@ -4757,7 +4759,7 @@ void EditSortLines(HWND hwnd, int iSortFlags)
if (iSortFlags & SORT_REMWSPACELN) {
StrTrimA(pmsz, "\t\v \r\n"); // try clean line
if (StringCchLenA(pmsz, cchm) == 0) {
if (StrIsEmptyA(pmsz)) {
// white-space only - remove
continue;
}
@ -5346,50 +5348,47 @@ static void _SetSearchFlags(HWND hwnd, LPEDITFINDREPLACE lpefr)
// Wildcard search uses the regexp engine to perform a simple search with * ? as wildcards
// instead of more advanced and user-unfriendly regexp syntax
// for speed, we only need POSIX syntax here
static void _EscapeWildcards(char* szFind2, LPCEDITFINDREPLACE lpefr)
static void _EscapeWildcards(char* szFind2, size_t cch, LPCEDITFINDREPLACE lpefr)
{
char szWildcardEscaped[FNDRPL_BUFFER] = { '\0' };
int iSource = 0;
int iDest = 0;
lpefr->fuFlags |= SCFIND_REGEXP;
while (szFind2[iSource] != '\0')
char *const szWildcardEscaped = (char *)AllocMem((cch<<1) + 1, HEAP_ZERO_MEMORY);
if (szWildcardEscaped)
{
char c = szFind2[iSource];
if (c == '*')
size_t iSource = 0;
size_t iDest = 0;
lpefr->fuFlags |= SCFIND_REGEXP;
while ((iSource < cch) && (szFind2[iSource] != '\0'))
{
szWildcardEscaped[iDest++] = '.';
}
else if (c == '?')
{
c = '.';
}
else
{
if (c == '^' ||
c == '$' ||
c == '(' ||
c == ')' ||
c == '[' ||
c == ']' ||
c == '{' ||
c == '}' ||
c == '.' ||
c == '+' ||
c == '|' ||
c == '\\')
{
szWildcardEscaped[iDest++] = '\\';
char c = szFind2[iSource];
if (c == '*') {
szWildcardEscaped[iDest++] = '.';
} else if (c == '?') {
c = '.';
} else {
if (c == '^' ||
c == '$' ||
c == '(' ||
c == ')' ||
c == '[' ||
c == ']' ||
c == '{' ||
c == '}' ||
c == '.' ||
c == '+' ||
c == '|' ||
c == '\\') {
szWildcardEscaped[iDest++] = '\\';
}
}
szWildcardEscaped[iDest++] = c;
++iSource;
}
szWildcardEscaped[iDest++] = c;
iSource++;
StringCchCopyNA(szFind2, cch, szWildcardEscaped, (cch<<1));
FreeMem(szWildcardEscaped);
}
szWildcardEscaped[iDest] = '\0';
StringCchCopyNA(szFind2, FNDRPL_BUFFER, szWildcardEscaped, COUNTOF(szWildcardEscaped));
}
@ -5397,33 +5396,32 @@ static void _EscapeWildcards(char* szFind2, LPCEDITFINDREPLACE lpefr)
//
// _EditGetFindStrg()
//
static int _EditGetFindStrg(HWND hwnd, LPCEDITFINDREPLACE lpefr, LPSTR szFind, int cchCnt)
{
static size_t _EditGetFindStrg(HWND hwnd, LPCEDITFINDREPLACE lpefr, LPSTR szFind, size_t cchCnt) {
UNUSED(hwnd);
if (StringCchLenA(lpefr->szFind, COUNTOF(lpefr->szFind))) {
StringCchCopyA(szFind, cchCnt, lpefr->szFind);
if (!lpefr) { return 0; }
if (!StrIsEmptyA(lpefr->szFind)) {
StringCchCopyNA(szFind, cchCnt, lpefr->szFind, COUNTOF(lpefr->szFind));
}
else {
CopyFindPatternMB(szFind, cchCnt);
StringCchCopyA(lpefr->szFind, COUNTOF(lpefr->szFind), szFind);
StringCchCopyNA(lpefr->szFind, COUNTOF(lpefr->szFind), szFind, cchCnt);
}
if (StrIsEmptyA(lpefr->szFind)) {
return 0;
}
if (!StringCchLenA(szFind, cchCnt)) { return 0; }
bool const bIsRegEx = (lpefr->fuFlags & SCFIND_REGEXP);
if (lpefr->bTransformBS || bIsRegEx) {
TransformBackslashes(szFind, bIsRegEx, Encoding_SciCP, NULL);
}
if (StringCchLenA(szFind, FNDRPL_BUFFER) > 0) {
if (lpefr->bWildcardSearch)
_EscapeWildcards(szFind, lpefr);
if (!StrIsEmptyA(szFind) && (lpefr->bWildcardSearch)) {
_EscapeWildcards(szFind, cchCnt, lpefr);
}
return (int)StringCchLenA(szFind, FNDRPL_BUFFER);
return StringCchLenA(szFind, cchCnt);
}
//=============================================================================
//
// _FindInTarget()
@ -5488,46 +5486,45 @@ typedef enum { MATCH = 0, NO_MATCH = 1, INVALID = 2 } RegExResult_t;
static RegExResult_t _FindHasMatch(HWND hwnd, LPCEDITFINDREPLACE lpefr, DocPos iStartPos, bool bMarkAll, bool bFirstMatchOnly)
{
char szFind[FNDRPL_BUFFER];
DocPos const slen = _EditGetFindStrg(hwnd, lpefr, szFind, COUNTOF(szFind));
if (slen == 0) { return NO_MATCH; }
int const sFlags = (int)(lpefr->fuFlags);
char szFind[FNDRPL_BUFFER] = { '\0' };
DocPos const slen = _EditGetFindStrg(hwnd, lpefr, szFind, COUNTOF(szFind));
if (slen == 0) {
return NO_MATCH;
}
int const sFlags = (int)(lpefr->fuFlags);
DocPos const iStart = bFirstMatchOnly ? iStartPos : 0;
DocPos const iTextEnd = Sci_GetDocEndPosition();
DocPos const iStart = bFirstMatchOnly ? iStartPos : 0;
DocPos const iTextEnd = Sci_GetDocEndPosition();
DocPos start = iStart;
DocPos end = iTextEnd;
DocPos const iPos = _FindInTarget(szFind, slen, sFlags, &start, &end, false, FRMOD_IGNORE);
DocPos start = iStart;
DocPos end = iTextEnd;
DocPos const iPos = _FindInTarget(szFind, slen, sFlags, &start, &end, false, FRMOD_IGNORE);
if (bFirstMatchOnly && !Globals.bReplaceInitialized) {
if (IsWindow(Globals.hwndDlgFindReplace) && (GetForegroundWindow() == Globals.hwndDlgFindReplace)) {
if (iPos >= 0) {
SciCall_SetSel(start, end);
}
else {
SciCall_ScrollCaret();
}
}
if (bFirstMatchOnly && !Globals.bReplaceInitialized) {
if (IsWindow(Globals.hwndDlgFindReplace) && (GetForegroundWindow() == Globals.hwndDlgFindReplace)) {
if (iPos >= 0) {
SciCall_SetSel(start, end);
} else {
SciCall_ScrollCaret();
}
}
else // mark all matches
{
if (bMarkAll) {
EditClearAllOccurrenceMarkers(hwnd);
if (iPos >= 0) {
EditMarkAll(szFind, (int)(lpefr->fuFlags), 0, iTextEnd, false);
if (FocusedView.HideNonMatchedLines) {
EditFoldMarkedLineRange(lpefr->hwnd, true);
}
}
else {
if (FocusedView.HideNonMatchedLines) {
EditFoldMarkedLineRange(lpefr->hwnd, false);
}
}
} else // mark all matches
{
if (bMarkAll) {
EditClearAllOccurrenceMarkers(hwnd);
if (iPos >= 0) {
EditMarkAll(szFind, (int)(lpefr->fuFlags), 0, iTextEnd, false);
if (FocusedView.HideNonMatchedLines) {
EditFoldMarkedLineRange(lpefr->hwnd, true);
}
} else {
if (FocusedView.HideNonMatchedLines) {
EditFoldMarkedLineRange(lpefr->hwnd, false);
}
}
}
return ((iPos >= 0) ? MATCH : ((iPos == (DocPos)(-1)) ? NO_MATCH : INVALID));
}
return ((iPos >= 0) ? MATCH : ((iPos == (DocPos)(-1)) ? NO_MATCH : INVALID));
}
@ -5831,7 +5828,7 @@ static INT_PTR CALLBACK EditFindReplaceDlgProc(HWND hwnd,UINT umsg,WPARAM wParam
{
if (s_anyMatch == MATCH) {
// Save MRUs
if (StringCchLenA(sg_pefrData->szFind, COUNTOF(sg_pefrData->szFind))) {
if (!StrIsEmptyA(sg_pefrData->szFind)) {
if (GetDlgItemText(hwnd, IDC_FINDTEXT, s_tchBuf, COUNTOF(s_tchBuf))) {
MRU_Add(Globals.pMRUfind, s_tchBuf, 0, -1, -1, NULL);
SetFindPattern(s_tchBuf);
@ -6255,12 +6252,12 @@ static INT_PTR CALLBACK EditFindReplaceDlgProc(HWND hwnd,UINT umsg,WPARAM wParam
if (!s_bSwitchedFindReplace) {
// Save MRUs
if (StringCchLenA(sg_pefrData->szFind, COUNTOF(sg_pefrData->szFind))) {
if (!StrIsEmptyA(sg_pefrData->szFind)) {
MultiByteToWideChar(Encoding_SciCP, 0, sg_pefrData->szFind, -1, s_tchBuf, (int)COUNTOF(s_tchBuf));
MRU_Add(Globals.pMRUfind, s_tchBuf, 0, -1, -1, NULL);
SetFindPattern(s_tchBuf);
}
if (StringCchLenA(sg_pefrData->szReplace, COUNTOF(sg_pefrData->szReplace))) {
if (!StrIsEmptyA(sg_pefrData->szReplace)) {
MultiByteToWideChar(Encoding_SciCP, 0, sg_pefrData->szReplace, -1, s_tchBuf, (int)COUNTOF(s_tchBuf));
MRU_Add(Globals.pMRUreplace, s_tchBuf, 0, -1, -1, NULL);
}
@ -6835,23 +6832,25 @@ void EditSelectionMultiSelectAllEx(EDITFINDREPLACE edFndRpl)
//
// _GetReplaceString()
//
static char* _GetReplaceString(HWND hwnd, LPCEDITFINDREPLACE lpefr, int* iReplaceMsg)
static char* _GetReplaceString(HWND hwnd, LPCEDITFINDREPLACE lpefr, int* iReplaceMsg)
{
char* pszReplace = NULL; // replace text of arbitrary size
if (StringCchCompareNIA(lpefr->szReplace, FNDRPL_BUFFER, "^c", 2) == 0) {
if (StringCchCompareNIA(lpefr->szReplace, COUNTOF(lpefr->szReplace), "^c", 2) == 0) {
*iReplaceMsg = SCI_REPLACETARGET;
pszReplace = EditGetClipboardText(hwnd, true, NULL, NULL);
}
else {
size_t const size = StringCchLenA(lpefr->szReplace,0) + 1;
pszReplace = (char*)AllocMem(size, HEAP_ZERO_MEMORY);
StringCchCopyA(pszReplace, size, lpefr->szReplace);
bool const bIsRegEx = (lpefr->fuFlags & SCFIND_REGEXP);
if (lpefr->bTransformBS || bIsRegEx) {
TransformBackslashes(pszReplace, bIsRegEx, Encoding_SciCP, iReplaceMsg);
size_t const cch = StringCchLenA(lpefr->szReplace, COUNTOF(lpefr->szReplace));
pszReplace = (char*)AllocMem(cch + 1, HEAP_ZERO_MEMORY);
if (pszReplace) {
StringCchCopyA(pszReplace, cch, lpefr->szReplace);
bool const bIsRegEx = (lpefr->fuFlags & SCFIND_REGEXP);
if (lpefr->bTransformBS || bIsRegEx) {
TransformBackslashes(pszReplace, bIsRegEx, Encoding_SciCP, iReplaceMsg);
}
}
}
return pszReplace;
return pszReplace; // move ownership
}
@ -6944,7 +6943,7 @@ int EditReplaceAllInRange(HWND hwnd, LPCEDITFINDREPLACE lpefr, DocPos iStartPos,
if (iStartPos > iEndPos) { swapos(&iStartPos, &iEndPos); }
char szFind[FNDRPL_BUFFER];
int const slen = _EditGetFindStrg(hwnd, lpefr, szFind, COUNTOF(szFind));
size_t const slen = _EditGetFindStrg(hwnd, lpefr, szFind, COUNTOF(szFind));
if (slen <= 0) { return 0; }
int const sFlags = (int)(lpefr->fuFlags);

View File

@ -1606,7 +1606,7 @@ UINT CharSetFromCodePage(const UINT uCodePage) {
* This is used to get control characters into the regular expresion engine
* w/o interfering with group referencing ('\0').
*/
unsigned int UnSlashLowOctal(char* s) {
ptrdiff_t UnSlashLowOctal(char* s) {
char* sStart = s;
char* o = s;
while (*s) {
@ -1625,7 +1625,7 @@ unsigned int UnSlashLowOctal(char* s) {
++s;
}
*o = '\0';
return (unsigned int)(o - sStart);
return (ptrdiff_t)(o - sStart);
}

View File

@ -328,8 +328,8 @@ size_t UnSlashChar(LPWSTR pchInOut, WCHAR wch);
size_t SlashCtrlW(LPWSTR pchOutput, size_t cchOutLen, LPCWSTR pchInput);
size_t UnSlashCtrlW(LPWSTR pchInOut);
void TransformBackslashes(char *pszInput, bool, UINT cpEdit, int *iReplaceMsg);
void TransformMetaChars(char* pszInput, bool, int iEOLMode);
void TransformBackslashes(char *pszInput, bool bRegEx, UINT cpEdit, int *iReplaceMsg);
void TransformMetaChars(char *pszInput, bool bRegEx, int iEOLMode);
//==== Large Text Conversion ==================================================

View File

@ -3664,7 +3664,7 @@ LRESULT MsgInitMenu(HWND hwnd, WPARAM wParam, LPARAM lParam)
CheckCmd(hmenu, IDM_VIEW_CHANGENOTIFY, Settings.FileWatchingMode);
if (StringCchLenW(s_wchTitleExcerpt, COUNTOF(s_wchTitleExcerpt)))
if (StrIsNotEmpty(s_wchTitleExcerpt))
i = IDM_VIEW_SHOWEXCERPT;
else if (Settings.PathNameFormat == 0)
i = IDM_VIEW_SHOWFILENAMEONLY;
@ -3687,7 +3687,7 @@ LRESULT MsgInitMenu(HWND hwnd, WPARAM wParam, LPARAM lParam)
EnableCmd(hmenu, CMD_WEBACTION1, !se && !mrs && bPosInSel && !bIsHLink);
EnableCmd(hmenu, CMD_WEBACTION2, !se && !mrs && bPosInSel && !bIsHLink);
i = (int)StringCchLenW(Settings2.AdministrationTool, COUNTOF(Settings2.AdministrationTool));
i = (int)StrIsNotEmpty(Settings2.AdministrationTool);
EnableCmd(hmenu, IDM_HELP_ADMINEXE, i);
for (int lng = 0; lng < MuiLanguages_CountOf(); ++lng) {
@ -10341,7 +10341,7 @@ bool FileSave(bool bSaveAlways, bool bAsk, bool bSaveAs, bool bSaveCopy, bool bP
{
WCHAR tchFile[MAX_PATH] = { L'\0' };
WCHAR tchInitialDir[MAX_PATH] = { L'\0' };
if (bSaveCopy && StringCchLenW(s_tchLastSaveCopyDir, COUNTOF(s_tchLastSaveCopyDir))) {
if (bSaveCopy && StrIsNotEmpty(s_tchLastSaveCopyDir)) {
StringCchCopy(tchInitialDir, COUNTOF(tchInitialDir), s_tchLastSaveCopyDir);
StringCchCopy(tchFile, COUNTOF(tchFile), s_tchLastSaveCopyDir);
PathCchAppend(tchFile, COUNTOF(tchFile), PathFindFileName(Globals.CurrentFile));
@ -10482,7 +10482,7 @@ bool OpenFileDlg(HWND hwnd,LPWSTR lpstrFile,int cchFile,LPCWSTR lpstrInitialDir)
StringCchCopy(tchInitialDir,COUNTOF(tchInitialDir),Globals.CurrentFile);
PathCchRemoveFileSpec(tchInitialDir, COUNTOF(tchInitialDir));
}
else if (StringCchLenW(Settings2.DefaultDirectory,COUNTOF(Settings2.DefaultDirectory))) {
else if (StrIsNotEmpty(Settings2.DefaultDirectory)) {
ExpandEnvironmentStrings(Settings2.DefaultDirectory,tchInitialDir,COUNTOF(tchInitialDir));
if (PathIsRelative(tchInitialDir)) {
WCHAR tchModule[MAX_PATH] = { L'\0' };
@ -10504,7 +10504,7 @@ bool OpenFileDlg(HWND hwnd,LPWSTR lpstrFile,int cchFile,LPCWSTR lpstrInitialDir)
ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | /* OFN_NOCHANGEDIR |*/
OFN_DONTADDTORECENT | OFN_PATHMUSTEXIST |
OFN_SHAREAWARE /*| OFN_NODEREFERENCELINKS*/;
ofn.lpstrDefExt = (StringCchLenW(Settings2.DefaultExtension,COUNTOF(Settings2.DefaultExtension))) ? Settings2.DefaultExtension : NULL;
ofn.lpstrDefExt = StrIsNotEmpty(Settings2.DefaultExtension) ? Settings2.DefaultExtension : NULL;
if (GetOpenFileName(&ofn)) {
StringCchCopyN(lpstrFile,cchFile,szFile,COUNTOF(szFile));
@ -10535,7 +10535,7 @@ bool SaveFileDlg(HWND hwnd,LPWSTR lpstrFile,int cchFile,LPCWSTR lpstrInitialDir)
StringCchCopy(tchInitialDir,COUNTOF(tchInitialDir),Globals.CurrentFile);
PathCchRemoveFileSpec(tchInitialDir, COUNTOF(tchInitialDir));
}
else if (StringCchLenW(Settings2.DefaultDirectory,COUNTOF(Settings2.DefaultDirectory))) {
else if (StrIsNotEmpty(Settings2.DefaultDirectory)) {
ExpandEnvironmentStrings(Settings2.DefaultDirectory,tchInitialDir,COUNTOF(tchInitialDir));
if (PathIsRelative(tchInitialDir)) {
WCHAR tchModule[MAX_PATH] = { L'\0' };
@ -10556,7 +10556,7 @@ bool SaveFileDlg(HWND hwnd,LPWSTR lpstrFile,int cchFile,LPCWSTR lpstrInitialDir)
ofn.Flags = OFN_HIDEREADONLY /*| OFN_NOCHANGEDIR*/ |
/*OFN_NODEREFERENCELINKS |*/ OFN_OVERWRITEPROMPT |
OFN_DONTADDTORECENT | OFN_PATHMUSTEXIST;
ofn.lpstrDefExt = (StringCchLenW(Settings2.DefaultExtension,COUNTOF(Settings2.DefaultExtension))) ? Settings2.DefaultExtension : NULL;
ofn.lpstrDefExt = StrIsNotEmpty(Settings2.DefaultExtension) ? Settings2.DefaultExtension : NULL;
if (GetSaveFileName(&ofn)) {
StringCchCopyN(lpstrFile,cchFile,szNewFile,COUNTOF(szNewFile));
@ -11037,7 +11037,7 @@ void SetNotifyIconTitle(HWND hwnd)
nid.uFlags = NIF_TIP;
WCHAR tchTitle[256] = { L'\0' };
if (StringCchLenW(s_wchTitleExcerpt,COUNTOF(s_wchTitleExcerpt))) {
if (StrIsNotEmpty(s_wchTitleExcerpt)) {
WCHAR tchFormat[32] = { L'\0' };
GetLngString(IDS_MUI_TITLEEXCERPT,tchFormat,COUNTOF(tchFormat));
StringCchPrintf(tchTitle,COUNTOF(tchTitle),tchFormat,s_wchTitleExcerpt);

View File

@ -2461,7 +2461,7 @@ void Style_SetExtraLineSpace(HWND hwnd, LPWSTR lpszStyle, int cch)
bool Style_GetOpenDlgFilterStr(LPWSTR lpszFilter,int cchFilter)
{
if (StringCchLenW(Settings2.FileDlgFilters, COUNTOF(Settings2.FileDlgFilters)) == 0) {
if (StrIsEmpty(Settings2.FileDlgFilters)) {
GetLngString(IDS_MUI_FILTER_ALL, lpszFilter, cchFilter);
}
else {
@ -3679,7 +3679,7 @@ void Style_SetStyles(HWND hwnd, int iStyle, LPCWSTR lpszStyle, bool bInitDefault
char chFontName[80] = { '\0' };
WCHAR wchFontName[80] = { L'\0' };
if (Style_StrGetFontName(lpszStyle, wchFontName, COUNTOF(wchFontName))) {
if (StringCchLenW(wchFontName, COUNTOF(wchFontName)) > 0) {
if (StrIsNotEmpty(wchFontName)) {
WideCharToMultiByteEx(Encoding_SciCP, 0, wchFontName, -1, chFontName, COUNTOF(chFontName), NULL, NULL);
SendMessage(hwnd, SCI_STYLESETFONT, iStyle, (LPARAM)chFontName);
}

View File

@ -8,7 +8,7 @@
#define SAPPNAME "Notepad3"
#define VERSION_MAJOR 5
#define VERSION_MINOR 20
#define VERSION_REV 830
#define VERSION_REV 831
#define VERSION_BUILD 1
#define SCINTILLA_VER 444
#define ONIGURUMA_REGEX_VER 6.9.5