diff --git a/Build/Notepad3.ini b/Build/Notepad3.ini index 81bd05676..e4be2901c 100644 --- a/Build/Notepad3.ini +++ b/Build/Notepad3.ini @@ -2,7 +2,7 @@ ;Notepad3.ini=%USERPROFILE%\Notepad3.ini ;Notepad3.ini=%APPDATA%\Rizonesoft\Notepad3\Notepad3.ini [Settings] -SettingsVersion=4 +SettingsVersion=5 [Settings2] ;IMEInteraction=0 ;AutoReloadTimeout=2000 @@ -66,7 +66,9 @@ SettingsVersion=4 ;DarkModeBkgColor=0x1F1F1F ;DarkModeBtnFaceColor=0x333333 ;DarkModeTxtColor=0xEFEFEF -;HyperlinkFileProtocolVerb="" (ShellExecuteEx()::lpVerb (""=default, "edit", "explore", "find", "open", "print", "properties", "runas") +;HyperlinkShellExURLWithApp="" +;HyperlinkShellExURLCmdLnArgs="${URL}" (use ${URL} as place holder for clicked Hyperlink URL string) +;HyperlinkFileProtocolVerb="" (ShellExecuteEx()::lpVerb (""=default, "edit", "explore", "find", "open", "print", "properties", "runas") [Statusbar Settings] ;VisibleSections=0 1 12 14 2 4 5 6 7 8 9 10 11 ;SectionPrefixes=Ln ,Col ,Sel ,Sb ,SLn ,Occ ,,,,,,,Ch ,Repl ,Eval , diff --git a/src/Config/Config.cpp b/src/Config/Config.cpp index 97a9eebfd..3df754ac9 100644 --- a/src/Config/Config.cpp +++ b/src/Config/Config.cpp @@ -239,7 +239,7 @@ extern "C" bool CopyToTmpCache(LPCSTR lpIniFileResource) { extern "C" size_t TmpCacheGetString(LPCWSTR lpSectionName, LPCWSTR lpKeyName, LPCWSTR lpDefault, LPWSTR lpReturnedString, size_t cchReturnedString) { bool bHasMultiple = false; - StringCchCopyW(lpReturnedString, cchReturnedString, + StringCchCopy(lpReturnedString, cchReturnedString, s_TMPINI.GetValue(lpSectionName, lpKeyName, lpDefault, &bHasMultiple)); //assert(!bHasMultiple); return StringCchLenW(lpReturnedString, cchReturnedString); @@ -382,7 +382,7 @@ extern "C" size_t IniSectionGetString(LPCWSTR lpSectionName, LPCWSTR lpKeyName, LPWSTR lpReturnedString, size_t cchReturnedString) { bool bHasMultiple = false; - StringCchCopyW(lpReturnedString, cchReturnedString, + StringCchCopy(lpReturnedString, cchReturnedString, s_INI.GetValue(lpSectionName, lpKeyName, lpDefault, &bHasMultiple)); //assert(!bHasMultiple); return StringCchLenW(lpReturnedString, cchReturnedString); @@ -394,7 +394,7 @@ extern "C" size_t IniSectionGetStringNoQuotes(LPCWSTR lpSectionName, LPCWSTR lpK LPWSTR lpReturnedString, size_t cchReturnedString) { bool bHasMultiple = false; - StringCchCopyW(lpReturnedString, cchReturnedString, + StringCchCopy(lpReturnedString, cchReturnedString, s_INI.GetValue(lpSectionName, lpKeyName, lpDefault, &bHasMultiple)); //assert(!bHasMultiple); StrTrim(lpReturnedString, L"\"'"); @@ -545,7 +545,7 @@ extern "C" size_t IniFileGetString(LPCWSTR lpFilePath, LPCWSTR lpSectionName, LP LPWSTR lpReturnedString, size_t cchReturnedString) { if (StrIsEmpty(lpFilePath)) { - StringCchCopyW(lpReturnedString, cchReturnedString, lpDefault); + StringCchCopy(lpReturnedString, cchReturnedString, lpDefault); return StringCchLenW(lpReturnedString, cchReturnedString); } @@ -554,7 +554,7 @@ extern "C" size_t IniFileGetString(LPCWSTR lpFilePath, LPCWSTR lpSectionName, LP OVERLAPPED ovrLpd = { 0 }; HANDLE hFile = AcquireReadFileLock(lpFilePath, ovrLpd); if (!IS_VALID_HANDLE(hFile)) { - StringCchCopyW(lpReturnedString, cchReturnedString, lpDefault); + StringCchCopy(lpReturnedString, cchReturnedString, lpDefault); return StringCchLenW(lpReturnedString, cchReturnedString); } @@ -563,10 +563,10 @@ extern "C" size_t IniFileGetString(LPCWSTR lpFilePath, LPCWSTR lpSectionName, LP if (SI_Success(rc)) { bool bHasMultiple = false; - StringCchCopyW(lpReturnedString, cchReturnedString, Ini.GetValue(lpSectionName, lpKeyName, lpDefault, &bHasMultiple)); + StringCchCopy(lpReturnedString, cchReturnedString, Ini.GetValue(lpSectionName, lpKeyName, lpDefault, &bHasMultiple)); //assert(!bHasMultiple); } else { - StringCchCopyW(lpReturnedString, cchReturnedString, lpDefault); + StringCchCopy(lpReturnedString, cchReturnedString, lpDefault); } return StringCchLenW(lpReturnedString, cchReturnedString); } @@ -1119,52 +1119,35 @@ void LoadSettings() #if defined(HAVE_DYN_LOAD_LIBS_MUI_LNGS) - Defaults2.PreferredLanguageLocaleName[0] = L'\0'; - GetUserPreferredLanguage(Defaults2.PreferredLanguageLocaleName, COUNTOF(Defaults2.PreferredLanguageLocaleName)); + Default_PreferredLanguageLocaleName[0] = L'\0'; + GetUserPreferredLanguage(Default_PreferredLanguageLocaleName, LOCALE_NAME_MAX_LENGTH); - IniSectionGetStringNoQuotes(IniSecSettings2, L"PreferredLanguageLocaleName", Defaults2.PreferredLanguageLocaleName, + IniSectionGetStringNoQuotes(IniSecSettings2, L"PreferredLanguageLocaleName", Default_PreferredLanguageLocaleName, Settings2.PreferredLanguageLocaleName, COUNTOF(Settings2.PreferredLanguageLocaleName)); #endif // -------------------------------------------------------------------------- - StringCchCopyW(Defaults2.DefaultExtension, COUNTOF(Defaults2.DefaultExtension), L"txt"); - IniSectionGetStringNoQuotes(IniSecSettings2, L"DefaultExtension", Defaults2.DefaultExtension, + IniSectionGetStringNoQuotes(IniSecSettings2, L"DefaultExtension", L"txt", Settings2.DefaultExtension, COUNTOF(Settings2.DefaultExtension)); StrTrim(Settings2.DefaultExtension, L" \t."); - Defaults2.DefaultDirectory[0] = L'\0'; - IniSectionGetStringNoQuotes(IniSecSettings2, L"DefaultDirectory", Defaults2.DefaultDirectory, + IniSectionGetStringNoQuotes(IniSecSettings2, L"DefaultDirectory", L"", Settings2.DefaultDirectory, COUNTOF(Settings2.DefaultDirectory)); - Defaults2.FileDlgFilters[0] = L'\0'; - IniSectionGetStringNoQuotes(IniSecSettings2, L"FileDlgFilters", Defaults2.FileDlgFilters, + IniSectionGetStringNoQuotes(IniSecSettings2, L"FileDlgFilters", L"", Settings2.FileDlgFilters, COUNTOF(Settings2.FileDlgFilters) - 2); - Defaults2.FileCheckInverval = 2000UL; - Settings2.FileCheckInverval = clampul(IniSectionGetInt(IniSecSettings2, L"FileCheckInverval", - Defaults2.FileCheckInverval), - 250UL, 300000UL); + Settings2.FileCheckInverval = clampul(IniSectionGetInt(IniSecSettings2, L"FileCheckInverval", 2000UL), 250UL, 300000UL); - Defaults2.AutoReloadTimeout = 2000UL; - Settings2.AutoReloadTimeout = clampul(IniSectionGetInt(IniSecSettings2, L"AutoReloadTimeout", - Defaults2.AutoReloadTimeout), - 250UL, 300000UL); + Settings2.AutoReloadTimeout = clampul(IniSectionGetInt(IniSecSettings2, L"AutoReloadTimeout", 2000UL), 250UL, 300000UL); FileWatching.AutoReloadTimeout = Settings2.AutoReloadTimeout; + IniSectionGetString(IniSecSettings2, L"FileChangedIndicator", L"[@]", Settings2.FileChangedIndicator, COUNTOF(Settings2.FileChangedIndicator)); - StringCchCopy(Defaults2.FileChangedIndicator, COUNTOF(Defaults2.FileChangedIndicator), L"[@]"); - IniSectionGetString(IniSecSettings2, L"FileChangedIndicator", Defaults2.FileChangedIndicator, - Settings2.FileChangedIndicator, COUNTOF(Settings2.FileChangedIndicator)); + IniSectionGetString(IniSecSettings2, L"FileDeletedIndicator", L"[X]", Settings2.FileDeletedIndicator, COUNTOF(Settings2.FileDeletedIndicator)); - StringCchCopy(Defaults2.FileDeletedIndicator, COUNTOF(Defaults2.FileDeletedIndicator), L"[X]"); - IniSectionGetString(IniSecSettings2, L"FileDeletedIndicator", Defaults2.FileDeletedIndicator, - Settings2.FileDeletedIndicator, COUNTOF(Settings2.FileDeletedIndicator)); - - Defaults2.UndoTransactionTimeout = 0UL; - Settings2.UndoTransactionTimeout = clampul(IniSectionGetInt(IniSecSettings2, L"UndoTransactionTimeout", - Defaults2.UndoTransactionTimeout), - 0UL, 86400000UL); + Settings2.UndoTransactionTimeout = clampul(IniSectionGetInt(IniSecSettings2, L"UndoTransactionTimeout", 0UL), 0UL, 86400000UL); // Settings2 SciDirectWriteTech deprecated Defaults.RenderingTechnology = IniSectionGetInt(IniSecSettings2, L"SciDirectWriteTech", -111); @@ -1188,8 +1171,7 @@ void LoadSettings() } Defaults.Bidirectional = (clampi(Defaults.Bidirectional, SC_BIDIRECTIONAL_DISABLED, SC_BIDIRECTIONAL_R2L) > 0) ? SC_BIDIRECTIONAL_R2L : SC_BIDIRECTIONAL_DISABLED; - Defaults2.IMEInteraction = -1; - Settings2.IMEInteraction = clampi(IniSectionGetInt(IniSecSettings2, L"IMEInteraction", Defaults2.IMEInteraction), -1, SC_IME_INLINE); + Settings2.IMEInteraction = clampi(IniSectionGetInt(IniSecSettings2, L"IMEInteraction", -1), -1, SC_IME_INLINE); // Korean IME use inline mode by default if (Settings2.IMEInteraction == -1) { // auto detection once // ScintillaWin::KoreanIME() @@ -1197,147 +1179,94 @@ void LoadSettings() Settings2.IMEInteraction = ((codePage == 949 || codePage == 1361) ? SC_IME_INLINE : SC_IME_WINDOWED); } - Defaults2.LaunchInstanceWndPosOffset = 0; - Settings2.LaunchInstanceWndPosOffset = clampi(IniSectionGetInt(IniSecSettings2, L"LaunchInstanceWndPosOffset", Defaults2.LaunchInstanceWndPosOffset), -10000, 10000); + Settings2.LaunchInstanceWndPosOffset = clampi(IniSectionGetInt(IniSecSettings2, L"LaunchInstanceWndPosOffset", 0), -10000, 10000); - Defaults2.LaunchInstanceFullVisible = false; - Settings2.LaunchInstanceFullVisible = IniSectionGetBool(IniSecSettings2, L"LaunchInstanceFullVisible", Defaults2.LaunchInstanceFullVisible); + Settings2.LaunchInstanceFullVisible = IniSectionGetBool(IniSecSettings2, L"LaunchInstanceFullVisible", false); - Defaults2.SciFontQuality = SC_EFF_QUALITY_LCD_OPTIMIZED; - Settings2.SciFontQuality = clampi(IniSectionGetInt(IniSecSettings2, L"SciFontQuality", Defaults2.SciFontQuality), SC_EFF_QUALITY_DEFAULT, SC_EFF_QUALITY_LCD_OPTIMIZED); + Settings2.SciFontQuality = clampi(IniSectionGetInt(IniSecSettings2, L"SciFontQuality", SC_EFF_QUALITY_LCD_OPTIMIZED), SC_EFF_QUALITY_DEFAULT, SC_EFF_QUALITY_LCD_OPTIMIZED); - Defaults2.UpdateDelayMarkAllOccurrences = USER_TIMER_MINIMUM << 2; - Settings2.UpdateDelayMarkAllOccurrences = clampi(IniSectionGetInt(IniSecSettings2, L"UpdateDelayMarkAllOccurrences", Defaults2.UpdateDelayMarkAllOccurrences), (USER_TIMER_MINIMUM << 1), 10000); + Settings2.UpdateDelayMarkAllOccurrences = clampi(IniSectionGetInt(IniSecSettings2, L"UpdateDelayMarkAllOccurrences", USER_TIMER_MINIMUM << 2), (USER_TIMER_MINIMUM << 1), 10000); - Defaults2.DenyVirtualSpaceAccess = false; - Settings2.DenyVirtualSpaceAccess = IniSectionGetBool(IniSecSettings2, L"DenyVirtualSpaceAccess", Defaults2.DenyVirtualSpaceAccess); + Settings2.DenyVirtualSpaceAccess = IniSectionGetBool(IniSecSettings2, L"DenyVirtualSpaceAccess", false); - Defaults2.UseOldStyleBraceMatching = false; - Settings2.UseOldStyleBraceMatching = IniSectionGetBool(IniSecSettings2, L"UseOldStyleBraceMatching", Defaults2.UseOldStyleBraceMatching); + Settings2.UseOldStyleBraceMatching = IniSectionGetBool(IniSecSettings2, L"UseOldStyleBraceMatching", false); - Defaults2.CurrentLineHorizontalSlop = 40; - Settings2.CurrentLineHorizontalSlop = clampi(IniSectionGetInt(IniSecSettings2, L"CurrentLineHorizontalSlop", Defaults2.CurrentLineHorizontalSlop), 0, 240); + Settings2.CurrentLineHorizontalSlop = clampi(IniSectionGetInt(IniSecSettings2, L"CurrentLineHorizontalSlop", 40), 0, 240); - Defaults2.CurrentLineVerticalSlop = 5; - Settings2.CurrentLineVerticalSlop = clampi(IniSectionGetInt(IniSecSettings2, L"CurrentLineVerticalSlop", Defaults2.CurrentLineVerticalSlop), 0, 100); + Settings2.CurrentLineVerticalSlop = clampi(IniSectionGetInt(IniSecSettings2, L"CurrentLineVerticalSlop", 5), 0, 100); - Defaults2.NoCopyLineOnEmptySelection = false; - Settings2.NoCopyLineOnEmptySelection = IniSectionGetBool(IniSecSettings2, L"NoCopyLineOnEmptySelection", Defaults2.NoCopyLineOnEmptySelection); + Settings2.NoCopyLineOnEmptySelection = IniSectionGetBool(IniSecSettings2, L"NoCopyLineOnEmptySelection", false); - Defaults2.NoCutLineOnEmptySelection = false; - Settings2.NoCutLineOnEmptySelection = IniSectionGetBool(IniSecSettings2, L"NoCutLineOnEmptySelection", Defaults2.NoCutLineOnEmptySelection); + Settings2.NoCutLineOnEmptySelection = IniSectionGetBool(IniSecSettings2, L"NoCutLineOnEmptySelection", false); - int const iARCLdef = 92; - Defaults2.AnalyzeReliableConfidenceLevel = (float)iARCLdef / 100.0f; - int const iARCLset = clampi(IniSectionGetInt(IniSecSettings2, L"AnalyzeReliableConfidenceLevel", iARCLdef), 0, 100); + int const iARCLset = clampi(IniSectionGetInt(IniSecSettings2, L"AnalyzeReliableConfidenceLevel", 92), 0, 100); Settings2.AnalyzeReliableConfidenceLevel = (float)iARCLset / 100.0f; - int const iAnsiCPBonusDef = 33; - Defaults2.LocaleAnsiCodePageAnalysisBonus = (float)iAnsiCPBonusDef / 100.0f; - int const iAnsiCPBonusSet = clampi(IniSectionGetInt(IniSecSettings2, L"LocaleAnsiCodePageAnalysisBonus", iAnsiCPBonusDef), 0, 100); + int const iAnsiCPBonusSet = clampi(IniSectionGetInt(IniSecSettings2, L"LocaleAnsiCodePageAnalysisBonus", 33), 0, 100); Settings2.LocaleAnsiCodePageAnalysisBonus = (float)iAnsiCPBonusSet / 100.0f; - /* ~~~ - int const iRCEDCMdef = 85; - Defaults2.ReliableCEDConfidenceMapping = (float)iRCEDCMdef / 100.0f; - int const iRCEDCMset = clampi(IniSectionGetInt(Settings2_Section, L"ReliableCEDConfidenceMapping", iRCEDCMdef), 0, 100); - Settings2.ReliableCEDConfidenceMapping = (float)iRCEDCMset / 100.0f; - - int const iURCEDCMdef = 20; - Defaults2.UnReliableCEDConfidenceMapping = (float)iURCEDCMdef / 100.0f; - int const iURCEDCMset = clampi(IniSectionGetInt(Settings2_Section, L"UnReliableCEDConfidenceMapping", iURCEDCMdef), 0, iRCEDCMset); - Settings2.UnReliableCEDConfidenceMapping = (float)iURCEDCMset / 100.0f; - ~~~ */ - - Defaults2.AdministrationTool[0] = L'\0'; - IniSectionGetStringNoQuotes(IniSecSettings2, L"AdministrationTool.exe", Defaults2.AdministrationTool, + IniSectionGetStringNoQuotes(IniSecSettings2, L"AdministrationTool.exe", L"", Settings2.AdministrationTool, COUNTOF(Settings2.AdministrationTool)); - Defaults2.FileLoadWarningMB = 4; - Settings2.FileLoadWarningMB = clampi(IniSectionGetInt(IniSecSettings2, L"FileLoadWarningMB", Defaults2.FileLoadWarningMB), 0, 2048); + Settings2.FileLoadWarningMB = clampi(IniSectionGetInt(IniSecSettings2, L"FileLoadWarningMB", 4), 0, 2048); - Defaults2.OpacityLevel = 75; - Settings2.OpacityLevel = clampi(IniSectionGetInt(IniSecSettings2, L"OpacityLevel", Defaults2.OpacityLevel), 10, 100); + Settings2.OpacityLevel = clampi(IniSectionGetInt(IniSecSettings2, L"OpacityLevel", 75), 10, 100); - Defaults2.FindReplaceOpacityLevel = 50; - Settings2.FindReplaceOpacityLevel = clampi(IniSectionGetInt(IniSecSettings2, L"FindReplaceOpacityLevel", Defaults2.FindReplaceOpacityLevel), 10, 100); + Settings2.FindReplaceOpacityLevel = clampi(IniSectionGetInt(IniSecSettings2, L"FindReplaceOpacityLevel", 50), 10, 100); - Defaults2.FileBrowserPath[0] = L'\0'; - IniSectionGetStringNoQuotes(IniSecSettings2, L"filebrowser.exe", Defaults2.FileBrowserPath, Settings2.FileBrowserPath, COUNTOF(Settings2.FileBrowserPath)); + IniSectionGetStringNoQuotes(IniSecSettings2, L"filebrowser.exe", L"", Settings2.FileBrowserPath, COUNTOF(Settings2.FileBrowserPath)); - Defaults2.GrepWinPath[0] = L'\0'; - IniSectionGetStringNoQuotes(IniSecSettings2, L"grepWin.exe", Defaults2.GrepWinPath, Settings2.GrepWinPath, COUNTOF(Settings2.GrepWinPath)); + IniSectionGetStringNoQuotes(IniSecSettings2, L"grepWin.exe", L"", Settings2.GrepWinPath, COUNTOF(Settings2.GrepWinPath)); - StringCchCopyW(Defaults2.AppUserModelID, COUNTOF(Defaults2.AppUserModelID), _W("Rizonesoft." SAPPNAME)); if (StrIsEmpty(Settings2.AppUserModelID)) { // set via CmdLine ? - IniSectionGetString(IniSecSettings2, L"ShellAppUserModelID", Defaults2.AppUserModelID, Settings2.AppUserModelID, COUNTOF(Settings2.AppUserModelID)); + IniSectionGetString(IniSecSettings2, L"ShellAppUserModelID", _W("Rizonesoft." SAPPNAME), Settings2.AppUserModelID, COUNTOF(Settings2.AppUserModelID)); } - Defaults2.ExtendedWhiteSpaceChars[0] = L'\0'; - IniSectionGetString(IniSecSettings2, L"ExtendedWhiteSpaceChars", Defaults2.ExtendedWhiteSpaceChars, + IniSectionGetString(IniSecSettings2, L"ExtendedWhiteSpaceChars", L"", Settings2.ExtendedWhiteSpaceChars, COUNTOF(Settings2.ExtendedWhiteSpaceChars)); - Defaults2.AutoCompleteWordCharSet[0] = L'\0'; - IniSectionGetString(IniSecSettings2, L"AutoCompleteWordCharSet", Defaults2.AutoCompleteWordCharSet, - Settings2.AutoCompleteWordCharSet, COUNTOF(Settings2.AutoCompleteWordCharSet)); + IniSectionGetString(IniSecSettings2, L"AutoCompleteWordCharSet", L"", Settings2.AutoCompleteWordCharSet, COUNTOF(Settings2.AutoCompleteWordCharSet)); - Defaults2.AutoCompleteFillUpChars[0] = L'\0'; - IniSectionGetString(IniSecSettings2, L"AutoCompleteFillUpChars", Defaults2.AutoCompleteFillUpChars, - Settings2.AutoCompleteFillUpChars, COUNTOF(Settings2.AutoCompleteFillUpChars)); + IniSectionGetString(IniSecSettings2, L"AutoCompleteFillUpChars", L"", Settings2.AutoCompleteFillUpChars, COUNTOF(Settings2.AutoCompleteFillUpChars)); - Defaults2.LineCommentPostfixStrg[0] = L'\0'; - IniSectionGetString(IniSecSettings2, L"LineCommentPostfixStrg", Defaults2.LineCommentPostfixStrg, - Settings2.LineCommentPostfixStrg, COUNTOF(Settings2.LineCommentPostfixStrg)); + IniSectionGetString(IniSecSettings2, L"LineCommentPostfixStrg", L"", Settings2.LineCommentPostfixStrg, COUNTOF(Settings2.LineCommentPostfixStrg)); StrTrim(Settings2.LineCommentPostfixStrg, L"\"'"); - Defaults2.DateTimeFormat[0] = L'\0'; // empty to get - IniSectionGetStringNoQuotes(IniSecSettings2, L"DateTimeFormat", Defaults2.DateTimeFormat, Settings2.DateTimeFormat, COUNTOF(Settings2.DateTimeFormat)); + IniSectionGetStringNoQuotes(IniSecSettings2, L"DateTimeFormat", L"", Settings2.DateTimeFormat, COUNTOF(Settings2.DateTimeFormat)); - Defaults2.DateTimeLongFormat[0] = L'\0'; // empty to get - IniSectionGetStringNoQuotes(IniSecSettings2, L"DateTimeLongFormat", Defaults2.DateTimeLongFormat, Settings2.DateTimeLongFormat, COUNTOF(Settings2.DateTimeLongFormat)); + IniSectionGetStringNoQuotes(IniSecSettings2, L"DateTimeLongFormat", L"", Settings2.DateTimeLongFormat, COUNTOF(Settings2.DateTimeLongFormat)); - StringCchCopyW(Defaults2.TimeStampRegEx, COUNTOF(Defaults2.TimeStampRegEx), L"\\$Date:[^\\$]+\\$"); - IniSectionGetStringNoQuotes(IniSecSettings2, L"TimeStampRegEx", Defaults2.TimeStampRegEx, Settings2.TimeStampRegEx, COUNTOF(Settings2.TimeStampRegEx)); + IniSectionGetStringNoQuotes(IniSecSettings2, L"TimeStampRegEx", L"\\$Date:[^\\$]+\\$", Settings2.TimeStampRegEx, COUNTOF(Settings2.TimeStampRegEx)); - StringCchCopyW(Defaults2.TimeStampFormat, COUNTOF(Defaults2.TimeStampFormat), L"$Date: %s $"); - IniSectionGetStringNoQuotes(IniSecSettings2, L"TimeStampFormat", Defaults2.TimeStampFormat, Settings2.TimeStampFormat, COUNTOF(Settings2.TimeStampFormat)); + IniSectionGetStringNoQuotes(IniSecSettings2, L"TimeStampFormat", L"$Date: %s $", Settings2.TimeStampFormat, COUNTOF(Settings2.TimeStampFormat)); - StringCchCopyW(Defaults2.WebTemplate1, COUNTOF(Defaults2.WebTemplate1), L"https://google.com/search?q=%s"); - IniSectionGetStringNoQuotes(IniSecSettings2, L"WebTemplate1", Defaults2.WebTemplate1, Settings2.WebTemplate1, COUNTOF(Settings2.WebTemplate1)); + IniSectionGetStringNoQuotes(IniSecSettings2, L"WebTemplate1", L"https://google.com/search?q=%s", Settings2.WebTemplate1, COUNTOF(Settings2.WebTemplate1)); + //~GetMenuStringW(Globals.hCtxMenu, CMD_WEBACTION1, WebTmpl1MenuName, COUNTOF(WebTmpl1MenuName), MF_BYCOMMAND)) + IniSectionGetStringNoQuotes(IniSecSettings2, L"WebTmpl1MenuName", L"", Settings2.WebTmpl1MenuName, COUNTOF(Settings2.WebTmpl1MenuName)); - //~GetMenuStringW(Globals.hCtxMenu, CMD_WEBACTION1, Defaults2.WebTmpl1MenuName, COUNTOF(Defaults2.WebTmpl1MenuName), MF_BYCOMMAND)) - StringCchCopyW(Defaults2.WebTmpl1MenuName, COUNTOF(Defaults2.WebTmpl1MenuName), L""); // use resource string - IniSectionGetStringNoQuotes(IniSecSettings2, L"WebTmpl1MenuName", Defaults2.WebTmpl1MenuName, Settings2.WebTmpl1MenuName, COUNTOF(Settings2.WebTmpl1MenuName)); + IniSectionGetStringNoQuotes(IniSecSettings2, L"WebTemplate2", L"https://en.wikipedia.org/w/index.php?search=%s", Settings2.WebTemplate2, COUNTOF(Settings2.WebTemplate2)); + //~GetMenuStringW(Globals.hMainMenu, CMD_WEBACTION2, WebTmpl2MenuName, COUNTOF(WebTmpl2MenuName), MF_BYCOMMAND)) + IniSectionGetStringNoQuotes(IniSecSettings2, L"WebTmpl2MenuName", L"", Settings2.WebTmpl2MenuName, COUNTOF(Settings2.WebTmpl2MenuName)); - StringCchCopyW(Defaults2.WebTemplate2, COUNTOF(Defaults2.WebTemplate2), L"https://en.wikipedia.org/w/index.php?search=%s"); - IniSectionGetStringNoQuotes(IniSecSettings2, L"WebTemplate2", Defaults2.WebTemplate2, Settings2.WebTemplate2, COUNTOF(Settings2.WebTemplate2)); + Settings2.LexerSQLNumberSignAsComment = IniSectionGetBool(IniSecSettings2, L"LexerSQLNumberSignAsComment", true); - //~GetMenuStringW(Globals.hMainMenu, CMD_WEBACTION2, Defaults2.WebTmpl2MenuName, COUNTOF(Defaults2.WebTmpl2MenuName), MF_BYCOMMAND)) - StringCchCopyW(Defaults2.WebTmpl2MenuName, COUNTOF(Defaults2.WebTmpl2MenuName), L""); // use resource string - IniSectionGetStringNoQuotes(IniSecSettings2, L"WebTmpl2MenuName", Defaults2.WebTmpl2MenuName, Settings2.WebTmpl2MenuName, COUNTOF(Settings2.WebTmpl2MenuName)); + Settings2.ExitOnESCSkipLevel = clampi(IniSectionGetInt(IniSecSettings2, L"ExitOnESCSkipLevel", Default_ExitOnESCSkipLevel), 0, 2); - Defaults2.LexerSQLNumberSignAsComment = true; - Settings2.LexerSQLNumberSignAsComment = IniSectionGetBool(IniSecSettings2, L"LexerSQLNumberSignAsComment", Defaults2.LexerSQLNumberSignAsComment); + Settings2.ZoomTooltipTimeout = clampi(IniSectionGetInt(IniSecSettings2, L"ZoomTooltipTimeout", 3200), 0, 10000); - Defaults2.ExitOnESCSkipLevel = 2; - Settings2.ExitOnESCSkipLevel = clampi(IniSectionGetInt(IniSecSettings2, L"ExitOnESCSkipLevel", Defaults2.ExitOnESCSkipLevel), 0, 2); + Settings2.WrapAroundTooltipTimeout = clampi(IniSectionGetInt(IniSecSettings2, L"WrapAroundTooltipTimeout", 2000), 0, 10000); - Defaults2.ZoomTooltipTimeout = 3200; - Settings2.ZoomTooltipTimeout = clampi(IniSectionGetInt(IniSecSettings2, L"ZoomTooltipTimeout", Defaults2.ZoomTooltipTimeout), 0, 10000); + Settings2.LargeIconScalePrecent = clampi(IniSectionGetInt(IniSecSettings2, L"LargeIconScalePrecent", 150), 100, 1000); - Defaults2.WrapAroundTooltipTimeout = 2000; - Settings2.WrapAroundTooltipTimeout = clampi(IniSectionGetInt(IniSecSettings2, L"WrapAroundTooltipTimeout", Defaults2.WrapAroundTooltipTimeout), 0, 10000); - - Defaults2.LargeIconScalePrecent = 150; - Settings2.LargeIconScalePrecent = clampi(IniSectionGetInt(IniSecSettings2, L"LargeIconScalePrecent", Defaults2.LargeIconScalePrecent), 100, 1000); + IniSectionGetStringNoQuotes(IniSecSettings2, L"HyperlinkShellExURLWithApp", L"", Settings2.HyperlinkShellExURLWithApp, COUNTOF(Settings2.HyperlinkShellExURLWithApp)); + IniSectionGetStringNoQuotes(IniSecSettings2, L"HyperlinkShellExURLCmdLnArgs", URLPLACEHLDR, Settings2.HyperlinkShellExURLCmdLnArgs, COUNTOF(Settings2.HyperlinkShellExURLCmdLnArgs)); const static WCHAR *const allowedVerbs[7] = { L"edit", L"explore", L"find", L"open", L"print", L"properties", L"runas" }; - StringCchCopyW(Defaults2.HyperlinkFileProtocolVerb, COUNTOF(Defaults2.HyperlinkFileProtocolVerb), L""); - StringCchCopyW(Settings2.HyperlinkFileProtocolVerb, COUNTOF(Settings2.HyperlinkFileProtocolVerb), Defaults2.HyperlinkFileProtocolVerb); WCHAR cfgVerb[MICRO_BUFFER] = { L'\0' }; + Settings2.HyperlinkFileProtocolVerb[0] = L'\0'; IniSectionGetStringNoQuotes(IniSecSettings2, L"HyperlinkFileProtocolVerb", L"", cfgVerb, COUNTOF(cfgVerb)); for (int i = 0; i < 7; ++i) { if (StrStr(cfgVerb, allowedVerbs[i])) { - StringCchCopyW(Settings2.HyperlinkFileProtocolVerb, COUNTOF(Settings2.HyperlinkFileProtocolVerb), cfgVerb); + StringCchCopy(Settings2.HyperlinkFileProtocolVerb, COUNTOF(Settings2.HyperlinkFileProtocolVerb), cfgVerb); break; } } @@ -1348,13 +1277,12 @@ void LoadSettings() WCHAR color[32] = { L'\0' }; WCHAR wchBuffer[MIDSZ_BUFFER] = { L'\0' }; - Defaults2.DarkModeBkgColor = rgbDarkBkgColorRef; - StringCchPrintf(color, COUNTOF(color), L"%#08x", Defaults2.DarkModeBkgColor); + StringCchPrintf(color, COUNTOF(color), L"%#08x", rgbDarkBkgColorRef); IniSectionGetStringNoQuotes(IniSecSettings2, L"DarkModeBkgColor", color, wchBuffer, COUNTOF(wchBuffer)); if (swscanf_s(wchBuffer, L"%x", &iValue) == 1) { Settings2.DarkModeBkgColor = RGB((iValue & 0xFF0000) >> 16, (iValue & 0xFF00) >> 8, iValue & 0xFF); } else { - Settings2.DarkModeBkgColor = Defaults2.DarkModeBkgColor; + Settings2.DarkModeBkgColor = rgbDarkBkgColorRef; } if (Globals.hbrDarkModeBkgBrush) { @@ -1365,23 +1293,21 @@ void LoadSettings() } Globals.hbrDarkModeBkgBrush = CreateSolidBrush(Settings2.DarkModeBkgColor); - Defaults2.DarkModeBtnFaceColor = rgbDarkBtnFcColorRef; - StringCchPrintf(color, COUNTOF(color), L"%#08x", Defaults2.DarkModeBtnFaceColor); + StringCchPrintf(color, COUNTOF(color), L"%#08x", rgbDarkBtnFcColorRef); IniSectionGetStringNoQuotes(IniSecSettings2, L"DarkModeBtnFaceColor", color, wchBuffer, COUNTOF(wchBuffer)); if (swscanf_s(wchBuffer, L"%x", &iValue) == 1) { Settings2.DarkModeBtnFaceColor = RGB((iValue & 0xFF0000) >> 16, (iValue & 0xFF00) >> 8, iValue & 0xFF); } else { - Settings2.DarkModeBtnFaceColor = Defaults2.DarkModeBtnFaceColor; + Settings2.DarkModeBtnFaceColor = rgbDarkBtnFcColorRef; } Globals.hbrDarkModeBtnFcBrush = CreateSolidBrush(Settings2.DarkModeBtnFaceColor); - Defaults2.DarkModeTxtColor = rgbDarkTxtColorRef; - StringCchPrintf(color, COUNTOF(color), L"%#08x", Defaults2.DarkModeTxtColor); + StringCchPrintf(color, COUNTOF(color), L"%#08x", rgbDarkTxtColorRef); IniSectionGetStringNoQuotes(IniSecSettings2, L"DarkModeTxtColor", color, wchBuffer, COUNTOF(wchBuffer)); if (swscanf_s(wchBuffer, L"%x", &iValue) == 1) { Settings2.DarkModeTxtColor = RGB((iValue & 0xFF0000) >> 16, (iValue & 0xFF00) >> 8, iValue & 0xFF); } else { - Settings2.DarkModeTxtColor = Defaults2.DarkModeTxtColor; + Settings2.DarkModeTxtColor = rgbDarkTxtColorRef; } #endif @@ -1587,7 +1513,7 @@ void LoadSettings() ///~Settings2.IMEInteraction = clampi(IniSectionGetInt(IniSecSettings, L"IMEInteraction", Settings2.IMEInteraction), SC_IME_WINDOWED, SC_IME_INLINE); // see TBBUTTON s_tbbMainWnd[] for initial/reset set of buttons - StringCchCopyW(Defaults.ToolbarButtons, COUNTOF(Defaults.ToolbarButtons), (Globals.iCfgVersionRead < CFG_VER_0002) ? TBBUTTON_DEFAULT_IDS_V1 : TBBUTTON_DEFAULT_IDS_V2); + StringCchCopy(Defaults.ToolbarButtons, COUNTOF(Defaults.ToolbarButtons), (Globals.iCfgVersionRead < CFG_VER_0002) ? TBBUTTON_DEFAULT_IDS_V1 : TBBUTTON_DEFAULT_IDS_V2); IniSectionGetStringNoQuotes(IniSecSettings, L"ToolbarButtons", Defaults.ToolbarButtons, Settings.ToolbarButtons, COUNTOF(Settings.ToolbarButtons)); #ifdef D_NP3_WIN10_DARK_MODE @@ -1677,8 +1603,7 @@ void LoadSettings() // startup window (ignore window position if /p was specified) // -------------------------------------------------------------- - Defaults2.DefaultWindowPosition[0] = L'\0'; - IniSectionGetString(IniSecSettings2, L"DefaultWindowPosition", Defaults2.DefaultWindowPosition, + IniSectionGetString(IniSecSettings2, L"DefaultWindowPosition", L"", Settings2.DefaultWindowPosition, COUNTOF(Settings2.DefaultWindowPosition)); bool const bExplicitDefaultWinPos = StrIsNotEmpty(Settings2.DefaultWindowPosition); diff --git a/src/Helpers.c b/src/Helpers.c index 81064e1ea..5b128bd84 100644 --- a/src/Helpers.c +++ b/src/Helpers.c @@ -21,6 +21,7 @@ #include #include #include +#include //#include @@ -1277,12 +1278,107 @@ bool TrimStringW(LPWSTR lpString) #endif + +//============================================================================= +// +// ExtractFirstArgument() +// Adapted from https://creativeandcritical.net/str-replace-c#repl_wcs +// +LPWSTR StrReplaceAll(LPCWSTR str, LPCWSTR from, LPCWSTR to) +{ + if (!str || !to || StrIsEmpty(from)) { + return NULL; + } + /* Adjust each of the below values to suit your needs. */ + + /* Increment positions cache size initially by this number. */ + size_t cache_sz_inc = 16; + /* Thereafter, each time capacity needs to be increased, + * multiply the increment by this factor. */ + const size_t cache_sz_inc_factor = 3; + /* But never increment capacity by more than this number. */ + const size_t cache_sz_inc_max = 1048576; + + LPWSTR ret = NULL; + + LPWSTR pret; + LPCWSTR pstr2; + LPCWSTR pstr = str; + size_t i, count = 0; + ptrdiff_t *pos_cache_tmp, *pos_cache = NULL; + size_t cache_sz = 0; + size_t cpylen, orglen, retlen, tolen = 0, fromlen = wcslen(from); + + pos_cache = AllocMem(cache_sz_inc, HEAP_ZERO_MEMORY); // init for ReAllocMem() + + /* Find all matches and cache their positions. */ + while ((pstr2 = wcsstr(pstr, from)) != NULL) { + count++; + + /* Increase the cache size when necessary. */ + if (cache_sz < count) { + cache_sz += cache_sz_inc; + pos_cache_tmp = ReAllocMem(pos_cache, sizeof(*pos_cache) * cache_sz, HEAP_ZERO_MEMORY); + if (pos_cache_tmp == NULL) { + goto end_repl_wcs; + } else + pos_cache = pos_cache_tmp; + cache_sz_inc *= cache_sz_inc_factor; + if (cache_sz_inc > cache_sz_inc_max) { + cache_sz_inc = cache_sz_inc_max; + } + } + + pos_cache[count - 1] = pstr2 - str; + pstr = pstr2 + fromlen; + } + + orglen = pstr - str + wcslen(pstr); + + /* Allocate memory for the post-replacement string. */ + if (count > 0) { + tolen = wcslen(to); + retlen = orglen + (tolen - fromlen) * count; + } else + retlen = orglen; + const size_t retsize = (retlen + 1) * sizeof(WCHAR); + ret = AllocMem(retsize, HEAP_ZERO_MEMORY); + if (ret == NULL) { + goto end_repl_wcs; + } + + if (count == 0) { + /* If no matches, then just duplicate the string. */ + wcscpy_s(ret, retsize, str); + } else { + /* Otherwise, duplicate the string whilst performing + * the replacements using the position cache. */ + pret = ret; + wmemcpy(pret, str, pos_cache[0]); + pret += pos_cache[0]; + for (i = 0; i < count; i++) { + wmemcpy(pret, to, tolen); + pret += tolen; + pstr = str + pos_cache[i] + fromlen; + cpylen = (i == count - 1 ? orglen : pos_cache[i + 1]) - pos_cache[i] - fromlen; + wmemcpy(pret, pstr, cpylen); + pret += cpylen; + } + ret[retlen] = L'\0'; + } + +end_repl_wcs: + /* Free the cache and return the post-replacement string, + * which will be NULL in the event of an error. */ + FreeMem(pos_cache); + return ret; +} + + //============================================================================= // // ExtractFirstArgument() // - - bool ExtractFirstArgument(LPCWSTR lpArgs, LPWSTR lpArg1, LPWSTR lpArg2, int len) { StringCchCopy(lpArg1, len, lpArgs); diff --git a/src/Helpers.h b/src/Helpers.h index 6deeba6bc..26e8cf7d9 100644 --- a/src/Helpers.h +++ b/src/Helpers.h @@ -67,6 +67,11 @@ inline LPVOID AllocMem(size_t numBytes, DWORD dwFlags) return HeapAlloc(Globals.hndlProcessHeap, (dwFlags | DEFAULT_ALLOC_FLAGS), numBytes); } +inline LPVOID ReAllocMem(LPVOID lpMem, size_t numBytes, DWORD dwFlags) +{ + return HeapReAlloc(Globals.hndlProcessHeap, (dwFlags | DEFAULT_ALLOC_FLAGS), lpMem, numBytes); +} + inline bool FreeMem(LPVOID lpMemory) { return (lpMemory ? HeapFree(Globals.hndlProcessHeap, 0, lpMemory) : true); @@ -452,6 +457,9 @@ inline bool TrimSpcW(LPWSTR lpString) #define TrimSpc TrimSpcA #endif +// return memory ownership: use FreeMem() to delete returned string +LPWSTR StrReplaceAll(LPCWSTR str, LPCWSTR from, LPCWSTR to); + bool ExtractFirstArgument(LPCWSTR lpArgs, LPWSTR lpArg1, LPWSTR lpArg2, int len); void PrepareFilterStr(LPWSTR lpFilter); diff --git a/src/MuiLanguage.c b/src/MuiLanguage.c index fbdd82d12..8bdf10815 100644 --- a/src/MuiLanguage.c +++ b/src/MuiLanguage.c @@ -187,7 +187,7 @@ void SetMuiLanguage(const unsigned muiLngIndex) { StringCchCopyW(Settings2.PreferredLanguageLocaleName, COUNTOF(Settings2.PreferredLanguageLocaleName), pLocaleName); if (Globals.bCanSaveIniFile) { - if (StringCchCompareXIW(Settings2.PreferredLanguageLocaleName, Defaults2.PreferredLanguageLocaleName) != 0) { + if (StringCchCompareXIW(Settings2.PreferredLanguageLocaleName, Default_PreferredLanguageLocaleName) != 0) { IniFileSetString(Paths.IniFile, Constants.Settings2_Section, SettingName, Settings2.PreferredLanguageLocaleName); } else { IniFileDelete(Paths.IniFile, Constants.Settings2_Section, SettingName, false); diff --git a/src/Notepad3.c b/src/Notepad3.c index 18318baf4..02a397348 100644 --- a/src/Notepad3.c +++ b/src/Notepad3.c @@ -83,7 +83,6 @@ GLOBALS_T Globals; SETTINGS_T Settings; SETTINGS_T Defaults; SETTINGS2_T Settings2; -SETTINGS2_T Defaults2; FOCUSEDVIEW_T FocusedView; FILEWATCHING_T FileWatching; @@ -97,6 +96,7 @@ COLORREF g_colorCustom[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } prefix_t g_mxSBPrefix[STATUS_SECTOR_COUNT]; prefix_t g_mxSBPostfix[STATUS_SECTOR_COUNT]; +int g_flagMatchText = 0; bool g_iStatusbarVisible[STATUS_SECTOR_COUNT] = SBS_INIT_ZERO; int g_iStatusbarWidthSpec[STATUS_SECTOR_COUNT] = SBS_INIT_ZERO; int g_vSBSOrder[STATUS_SECTOR_COUNT] = SBS_INIT_MINUS; @@ -105,7 +105,8 @@ WCHAR g_tchToolbarBitmap[MAX_PATH] = { L'\0' }; WCHAR g_tchToolbarBitmapHot[MAX_PATH] = { L'\0' }; WCHAR g_tchToolbarBitmapDisabled[MAX_PATH] = { L'\0' }; -int g_flagMatchText = 0; +WCHAR Default_PreferredLanguageLocaleName[LOCALE_NAME_MAX_LENGTH + 1]; + // ------------------------------------ @@ -677,7 +678,6 @@ static void _InitGlobals() ZeroMemory(&Globals, sizeof(GLOBALS_T)); ZeroMemory(&Defaults, sizeof(SETTINGS_T)); ZeroMemory(&Settings, sizeof(SETTINGS_T)); - ZeroMemory(&Defaults2, sizeof(SETTINGS2_T)); ZeroMemory(&Settings2, sizeof(SETTINGS2_T)); ZeroMemory(&Flags, sizeof(FLAGS_T)); @@ -5981,7 +5981,7 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam) if ((!SciCall_IsSelectionEmpty() || Sci_IsMultiOrRectangleSelection()) && (skipLevel == Settings2.ExitOnESCSkipLevel)) { Sci_GotoPosChooseCaret(iCurPos); EditScrollSelectionToView(); - skipLevel -= Defaults2.ExitOnESCSkipLevel; + skipLevel -= Default_ExitOnESCSkipLevel; } if ((skipLevel < 0) || (skipLevel == Settings2.ExitOnESCSkipLevel)) { @@ -7174,38 +7174,61 @@ bool HandleHotSpotURLClicked(const DocPos position, const HYPERLINK_OPS operatio } bHandled = true; - } else if (operation & OPEN_WITH_BROWSER) { - - // open in web browser or associated application + } else if (operation & OPEN_WITH_BROWSER) { // open in web browser or associated application + WCHAR wchDirectory[MAX_PATH] = { L'\0' }; + if (UrlIsFileUrl(szTextW)) { // ShellExecuteEx() will handle file-system path correctly for "file://" protocol StringCchCopy(szUnEscW, COUNTOF(szUnEscW), chkPreFix); dCch -= (DWORD)lenPfx; PathCreateFromUrl(szTextW, &szUnEscW[lenPfx], &dCch, 0); + StringCchCopy(wchDirectory, COUNTOF(wchDirectory), szUnEscW); + PathCchRemoveFileSpec(wchDirectory, COUNTOF(wchDirectory)); } else { UrlUnescapeEx(szTextW, szUnEscW, &dCch); } - - WCHAR wchDirectory[MAX_PATH] = { L'\0' }; - if (StrIsNotEmpty(Paths.CurrentFile)) { + if (StrIsEmpty(wchDirectory) && StrIsNotEmpty(Paths.CurrentFile)) { StringCchCopy(wchDirectory, COUNTOF(wchDirectory), Paths.CurrentFile); PathCchRemoveFileSpec(wchDirectory, COUNTOF(wchDirectory)); } - const WCHAR *const lpVerb = StrIsEmpty(Settings2.HyperlinkFileProtocolVerb) ? NULL : Settings2.HyperlinkFileProtocolVerb; - SHELLEXECUTEINFO sei = { sizeof(SHELLEXECUTEINFO) }; - sei.fMask = SEE_MASK_NOZONECHECKS; - sei.hwnd = NULL; - sei.lpVerb = lpVerb; - sei.lpFile = szUnEscW; - sei.lpParameters = NULL; - sei.lpDirectory = wchDirectory; - sei.nShow = SW_SHOWNORMAL; - ShellExecuteEx(&sei); - bHandled = true; + if (StrIsNotEmpty(Settings2.HyperlinkShellExURLWithApp)) { + + WCHAR lpParams[MAX_PATH + INTERNET_MAX_URL_LENGTH] = { L'\0' }; + LPWSTR const _params = StrReplaceAll(Settings2.HyperlinkShellExURLCmdLnArgs, URLPLACEHLDR, szUnEscW); + if (StrIsNotEmpty(_params)) { + StringCchCopy(lpParams, COUNTOF(lpParams), _params); + } else { + StringCchCopy(lpParams, COUNTOF(lpParams), szUnEscW); + } + FreeMem(_params); + + sei.fMask = SEE_MASK_DEFAULT; + sei.hwnd = NULL; + sei.lpVerb = NULL; + sei.lpFile = Settings2.HyperlinkShellExURLWithApp; + sei.lpParameters = lpParams; + sei.lpDirectory = wchDirectory; + sei.nShow = SW_SHOWNORMAL; + + } else { + + const WCHAR *const lpVerb = StrIsEmpty(Settings2.HyperlinkFileProtocolVerb) ? NULL : Settings2.HyperlinkFileProtocolVerb; + + sei.fMask = SEE_MASK_NOZONECHECKS; + sei.hwnd = NULL; + sei.lpVerb = lpVerb; + sei.lpFile = szUnEscW; + sei.lpParameters = NULL; + sei.lpDirectory = wchDirectory; + sei.nShow = SW_SHOWNORMAL; + } + + bHandled = ShellExecuteEx(&sei); + } } } diff --git a/src/Styles.c b/src/Styles.c index 580126ddd..a998b4d75 100644 --- a/src/Styles.c +++ b/src/Styles.c @@ -2770,6 +2770,7 @@ static inline bool GetDefaultCodeFont(LPWSTR pwchFontName, int cchFont) { LPCWSTR const FontNamePrioList[] = { L"Cascadia Code", + L"Cascadia Mono", L"Fira Code", L"Roboto Mono", L"Source Code Pro", diff --git a/src/TypeDefs.h b/src/TypeDefs.h index 9df977915..94d507f07 100644 --- a/src/TypeDefs.h +++ b/src/TypeDefs.h @@ -69,6 +69,7 @@ typedef DocPos DocLn; // Sci::Line #define DOCPOSFMTA "%ti" #define DOCPOSFMTW L"%ti" #define DOCMODDIFYD L"* " +#define URLPLACEHLDR L"${URL}" // -------------------------------------------------------------------------- @@ -631,7 +632,6 @@ typedef struct _settings2_t WCHAR FileChangedIndicator[4]; WCHAR FileDeletedIndicator[4]; - WCHAR PreferredLanguageLocaleName[LOCALE_NAME_MAX_LENGTH + 1]; WCHAR DefaultExtension[MINI_BUFFER]; WCHAR DefaultDirectory[MAX_PATH]; WCHAR FileDlgFilters[XHUGE_BUFFER]; @@ -655,12 +655,20 @@ typedef struct _settings2_t WCHAR WebTmpl2MenuName[MICRO_BUFFER]; WCHAR AdministrationTool[MAX_PATH]; WCHAR DefaultWindowPosition[MINI_BUFFER]; + + WCHAR PreferredLanguageLocaleName[LOCALE_NAME_MAX_LENGTH + 1]; + + WCHAR HyperlinkShellExURLWithApp[MAX_PATH]; + WCHAR HyperlinkShellExURLCmdLnArgs[MAX_PATH*2]; WCHAR HyperlinkFileProtocolVerb[MICRO_BUFFER]; } SETTINGS2_T, *PSETTINGS2_T; +#define Default_ExitOnESCSkipLevel 2 + extern SETTINGS2_T Settings2; -extern SETTINGS2_T Defaults2; +extern WCHAR Default_PreferredLanguageLocaleName[]; + //=============================================================================