Merge branch 'Dev_Release' into Dev_Lexilla

This commit is contained in:
Rainer Kottenhoff 2021-02-26 15:35:18 +01:00
commit fd1f860fe8
7 changed files with 101 additions and 53 deletions

View File

@ -32,7 +32,7 @@ UCD - (UCD)ARDET is an Encoding Detector Library
========================================================
Current BETA/RC Version 5.21.223.(build_#) (2021-02-23)
Current BETA/RC Version 5.21.226.(build_#) (2021-02-26)
========================================================
--------------------------------------------------------
@ -60,7 +60,7 @@ NEW:
[.915.2]- Configurable Dark Mode colors (non Explorer-Theme, Owner-Drawn).
[.915.2]- Menu item to switch between Default and Dark-Mode.
[.915.2]- DarkMode: Toolbar, static checkbox/listbox control.
[.915.2]- Win10 DarkMode Awareness (initial development)
[.915.2]- Win10 DarkMode Awareness (initial development).
--------------------------------------------------------
CHANGES:
@ -105,6 +105,7 @@ CHANGES:
--------------------------------------------------------
FIXES:
--------------------------------------------------------
[.226.1]- Wrap-Around tooltip use correct encoding.
[.222.2]- Multi-Line movement: proceed to document end correctly.
[.222.2]- Toggle comment on empty selection at insertion point: keep position of selection end.
[.222.2]- MiniPath: Enable Mouse XButton usage ("browse back and forth").
@ -181,10 +182,6 @@ REMOVED:
TRANSLATIONS (MUI):
--------------------------------------------------------
[1028.1]- Hindi (hi-IN).
[.915.2]- Chinese Traditional (zh-TW) in waiting...
[.915.2]- Indonesian (id-ID) in waiting...
[.915.2]- Turkish (tr-TR) in waiting...
[.915.2]- Vietnamese (vi-VN) in waiting...
========================================================
@ -313,12 +310,6 @@ REMOVED:
--------------------------------------------------------
TRANSLATIONS (MUI):
--------------------------------------------------------
[.802.1]- Portuguese Brazilian (pt-BR).
[.722.2]- Turkish (tr-TR) in processing...
[.722.2]- Chinese Traditional (zh-TW) in waiting...
[.722.2]- Hindi (hi-IN) in waiting...
[.722.2]- Indonesian (id-ID) in waiting...
[.722.2]- Vietnamese (vi-VN) in waiting...
========================================================

View File

@ -111,8 +111,8 @@
Selection
---------
Ctrl+, Jump to Selection Start.
Ctrl+. Jump to Selection End.
Ctrl+Q Block Comment (Toggle).
Ctrl+Shift+Q Stream Comment.
Ctrl+D Duplicate Selection or Line.
Alt+B Pad with Blanks.
Alt+Z Strip First Character.
@ -122,6 +122,8 @@
Alt+M Modify Lines...
Alt+J Align Lines...
Alt+O Sort Lines...
Ctrl+, Jump to Selection Start.
Ctrl+. Jump to Selection End.
Tab Indent Selected Block.
Shift+Tab Unindent Selected Block.
Ctrl+Tab Insert Tabulator.
@ -161,8 +163,6 @@
Ctrl+F5 Time/Date (Short Form).
Ctrl+Shift+F5 Time/Date (Long Form).
Shift+F5 Update Timestamps.
Ctrl+Q Block Comment (Toggle).
Ctrl+Shift+Q Stream Comment.
Miscellaneous
-------------

View File

@ -1 +1 @@
223
226

View File

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

View File

@ -642,6 +642,40 @@ inline WCHAR* StrEndW(const WCHAR* pStart, size_t siz)
#define StrEnd(s,n) StrEndA((s),(n))
#endif
// ----------------------------------------------------------------------------
#if 0
inline void StrReplChrA(CHAR* pStrg, const CHAR chSearch, const CHAR chReplace)
{
while (pStrg && *pStrg) {
if (*pStrg == chSearch) {
*pStrg = chReplace;
}
++pStrg;
}
}
inline void StrReplChrW(WCHAR* pStrg, const WCHAR chSearch, const WCHAR chReplace)
{
while (pStrg && *pStrg) {
if (*pStrg == chSearch) {
*pStrg = chReplace;
}
++pStrg;
}
}
#if defined(UNICODE) || defined(_UNICODE)
#define StrReplChr(str, cs, cr) StrReplChrW((str), (cs), (cr))
#else
#define StrReplChr(str, cs, cr) StrReplChrA((str), (cs), (cr))
#endif
#endif
// ----------------------------------------------------------------------------
//==== StrSafe lstrcmp(),lstrcmpi() =============================================
// NOTE: !!! differences in AutoCompleteList depending compare functions (CRT vs. Shlwapi)) !!!

View File

@ -7061,6 +7061,7 @@ bool HandleHotSpotURLClicked(const DocPos position, const HYPERLINK_OPS operatio
bool bHandled = false;
if (SciCall_IndicatorValueAt(INDIC_NP3_HYPERLINK, position)) {
DocPos const firstPos = SciCall_IndicatorStart(INDIC_NP3_HYPERLINK, position);
DocPos const lastPos = SciCall_IndicatorEnd(INDIC_NP3_HYPERLINK, position);
DocPos const length = min_p(lastPos - firstPos, INTERNET_MAX_URL_LENGTH);
@ -7069,14 +7070,15 @@ bool HandleHotSpotURLClicked(const DocPos position, const HYPERLINK_OPS operatio
return false;
}
const char* pszText = (const char*)SciCall_GetRangePointer(firstPos, length);
const char *pszText = (const char *)SciCall_GetRangePointer(firstPos, length);
WCHAR szTextW[INTERNET_MAX_URL_LENGTH + 1];
ptrdiff_t const cchTextW = MultiByteToWideChar(Encoding_SciCP, 0, pszText, (int)length, szTextW, COUNTOF(szTextW));
szTextW[cchTextW] = L'\0';
StrTrim(szTextW, L" \r\n\t");
const WCHAR* chkPreFix = L"file://";
const WCHAR *chkPreFix = L"file://";
size_t const lenPfx = StringCchLenW(chkPreFix, 0);
if (operation & SELECT_HYPERLINK) {
SciCall_SetSelection(firstPos, lastPos);
@ -7093,42 +7095,63 @@ bool HandleHotSpotURLClicked(const DocPos position, const HYPERLINK_OPS operatio
bHandled = true;
}
}
} else if ((operation & OPEN_WITH_NOTEPAD3) && (StrStrI(szTextW, chkPreFix) == szTextW)) {
size_t const lenPfx = StringCchLenW(chkPreFix, 0);
WCHAR* szFileName = &(szTextW[lenPfx]);
szTextW[lenPfx + MAX_PATH] = L'\0'; // limit length
StrTrim(szFileName, L"/");
PathCanonicalizeEx(szFileName, (DWORD)(COUNTOF(szTextW) - lenPfx));
if (PathIsDirectory(szFileName)) {
WCHAR tchFile[MAX_PATH] = { L'\0' };
if (OpenFileDlg(Globals.hwndMain, tchFile, COUNTOF(tchFile), szFileName)) {
FileLoad(false, false, false, Settings.SkipUnicodeDetection, Settings.SkipANSICodePageDetection, false, tchFile);
} else {
bool const isFileUrl = (StrStrI(szTextW, chkPreFix) == szTextW);
WCHAR szUnEscW[INTERNET_MAX_URL_LENGTH + 1];
DWORD dCchUnEsc = COUNTOF(szUnEscW);
UrlUnescapeEx(szTextW, szUnEscW, &dCchUnEsc);
if ((operation & OPEN_WITH_NOTEPAD3) && isFileUrl) {
WCHAR *const szFileName = &(szUnEscW[lenPfx]);
szUnEscW[min_i(MAX_PATH, INTERNET_MAX_URL_LENGTH)] = L'\0'; // limit length
StrTrim(szFileName, L"/");
PathCanonicalizeEx(szFileName, (DWORD)(COUNTOF(szUnEscW) - lenPfx));
if (PathIsDirectory(szFileName)) {
WCHAR tchFile[MAX_PATH] = { L'\0' };
if (OpenFileDlg(Globals.hwndMain, tchFile, COUNTOF(tchFile), szFileName)) {
FileLoad(false, false, false, Settings.SkipUnicodeDetection, Settings.SkipANSICodePageDetection, false, tchFile);
}
} else {
FileLoad(false, false, false, Settings.SkipUnicodeDetection, Settings.SkipANSICodePageDetection, false, szFileName);
}
} else {
FileLoad(false, false, false, Settings.SkipUnicodeDetection, Settings.SkipANSICodePageDetection, false, szFileName);
}
bHandled = true;
} else if (operation & OPEN_WITH_BROWSER) { // open in web browser
WCHAR wchDirectory[MAX_PATH] = { L'\0' };
if (StrIsNotEmpty(Globals.CurrentFile)) {
StringCchCopy(wchDirectory, COUNTOF(wchDirectory), Globals.CurrentFile);
PathCchRemoveFileSpec(wchDirectory, COUNTOF(wchDirectory));
}
bHandled = true;
SHELLEXECUTEINFO sei;
ZeroMemory(&sei, sizeof(SHELLEXECUTEINFO));
sei.cbSize = sizeof(SHELLEXECUTEINFO);
sei.fMask = SEE_MASK_NOZONECHECKS;
sei.hwnd = NULL;
sei.lpVerb = NULL;
sei.lpFile = szTextW;
sei.lpParameters = NULL;
sei.lpDirectory = wchDirectory;
sei.nShow = SW_SHOWNORMAL;
ShellExecuteEx(&sei);
} else if (operation & OPEN_WITH_BROWSER) { // open in web browser
bHandled = true;
if (isFileUrl) {
WCHAR *const szFileName = &(szUnEscW[lenPfx]);
dCchUnEsc = COUNTOF(szTextW);
UrlCreateFromPath(szFileName, szTextW, &dCchUnEsc, 0);
//~StringCchCopy(szUnEscW, COUNTOF(szUnEscW), L"http://");
//~StringCchCat(szUnEscW, COUNTOF(szUnEscW), &(szTextW[lenPfx]));
StringCchCopy(szUnEscW, COUNTOF(szUnEscW), szTextW);
}
WCHAR wchDirectory[MAX_PATH] = { L'\0' };
if (StrIsNotEmpty(Globals.CurrentFile)) {
StringCchCopy(wchDirectory, COUNTOF(wchDirectory), Globals.CurrentFile);
PathCchRemoveFileSpec(wchDirectory, COUNTOF(wchDirectory));
}
SHELLEXECUTEINFO sei;
ZeroMemory(&sei, sizeof(SHELLEXECUTEINFO));
sei.cbSize = sizeof(SHELLEXECUTEINFO);
sei.fMask = SEE_MASK_NOZONECHECKS;
sei.hwnd = NULL;
sei.lpVerb = NULL;
sei.lpFile = szUnEscW;
sei.lpParameters = NULL;
sei.lpDirectory = wchDirectory;
sei.nShow = SW_SHOWNORMAL;
ShellExecuteEx(&sei);
bHandled = true;
}
}
}

View File

@ -8,7 +8,7 @@
#define SAPPNAME "Notepad3"
#define VERSION_MAJOR 5
#define VERSION_MINOR 21
#define VERSION_REV 223
#define VERSION_REV 226
#define VERSION_BUILD 1
#define SCINTILLA_VER 446
#define ONIGURUMA_REGEX_VER 6.9.6