Merge branch 'RC2_DEV' into NewFeatures

This commit is contained in:
Rainer Kottenhoff 2020-03-10 13:02:21 +01:00
commit 5b622b404d
10 changed files with 30 additions and 26 deletions

View File

@ -386,7 +386,6 @@ begin
RegWriteStringValue(HKCR, '*\shell\Open with Notepad3', 'Icon', ExpandConstant('{app}\Notepad3.exe,0'));
RegWriteStringValue(HKCR, '*\shell\Open with Notepad3\command', '', ExpandConstant('"{app}\Notepad3.exe" "%1"'));
end;

View File

@ -1,6 +1,6 @@
;* Notepad3 - Installer script
;*
;* (c) Rizonesoft 2008-2020
;* (c) Rizonesoft 2008-2020
; Requirements:
; Inno Setup: http://www.jrsoftware.org/isdl.php
@ -171,6 +171,7 @@ Source: Docs\uthash\utlist.txt; DestDir: {ap
Source: Docs\uthash\utringbuffer.txt; DestDir: {app}\Docs\uthash; Flags: ignoreversion
Source: Docs\uthash\utstring.txt; DestDir: {app}\Docs\uthash; Flags: ignoreversion
[Dirs]
Name: "{userappdata}\Rizonesoft\Notepad3\Favorites"
Name: "{userappdata}\Rizonesoft\Notepad3\themes"
@ -341,8 +342,7 @@ begin
RegWriteStringValue(HKCR, '*\shell\Open with Notepad3', 'Icon', ExpandConstant('{app}\Notepad3.exe,0'));
RegWriteStringValue(HKCR, '*\shell\Open with Notepad3\command', '', ExpandConstant('"{app}\Notepad3.exe" "%1"'));
end;
end;
procedure CleanUpSettings();

View File

@ -1 +1 @@
3
1

View File

@ -1 +1 @@
309
310

View File

@ -3,7 +3,7 @@
<assemblyIdentity
name="Notepad3"
processorArchitecture="*"
version="5.20.309.3"
version="5.20.310.1"
type="win32"
/>
<description>Notepad3 RC3</description>

View File

@ -1688,10 +1688,7 @@ static INT_PTR CALLBACK FileMRUDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM
CheckDlgButton(hwnd, IDC_PRESERVECARET, SetBtn(Settings.PreserveCaretPos));
CheckDlgButton(hwnd, IDC_REMEMBERSEARCHPATTERN, SetBtn(Settings.SaveFindReplace));
//~if (!Settings.SaveRecentFiles) {
//~ DialogEnableWindow(hwnd,IDC_PRESERVECARET, false);
//~ DialogEnableWindow(hwnd,IDC_REMEMBERSEARCHPATTERN, false);
//~}
DialogEnableControl(hwnd,IDC_PRESERVECARET, Settings.SaveRecentFiles);
CenterDlgInParent(hwnd, NULL);
}
@ -1914,6 +1911,13 @@ static INT_PTR CALLBACK FileMRUDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM
case IDC_FILEMRU:
break;
case IDC_SAVEMRU:
{
bool const bSaveMRU = IsButtonChecked(hwnd, IDC_SAVEMRU);
DialogEnableControl(hwnd, IDC_PRESERVECARET, bSaveMRU);
}
break;
case IDOK:
case IDC_REMOVE:
{

View File

@ -184,6 +184,9 @@ typedef struct _enc_det_t
} ENC_DET_T;
// 0.0 - 1.0: confidence bonus for local ANSI detection
// 0 = no bonus, 1 = 100% confidence that, if local ANSI is detected, that it is local ANSI code-page
#define LOCAL_ANSI_BONUS_FAC (0.66f) // ~2/3
ENC_DET_T Encoding_DetectEncoding(LPWSTR pszFile, const char* lpData, const size_t cbData,
const cpi_enc_t iAnalyzeFallback,

View File

@ -507,6 +507,10 @@ extern "C" void ChangeEncodingCodePage(const cpi_enc_t cpi, UINT newCP)
//=============================================================================
constexpr float clampf(float x, float lower, float upper) { return (x < lower) ? lower : ((x > upper) ? upper : x); }
//=============================================================================
cpi_enc_t GetUnicodeEncoding(const char* pBuffer, const size_t len, bool* lpbBOM, bool* lpbReverse)
{
cpi_enc_t iEncoding = CPI_NONE;
@ -782,7 +786,8 @@ cpi_enc_t Encoding_AnalyzeText
//~cpiEncoding_CED = AnalyzeText_CED(text, len, encodingHint, &ced_cnf, encodingStrg_CED, MAX_ENC_STRG_LEN);
//~if (ced_cnf < 1.0f)
//~{
cpiEncoding_UCD = AnalyzeText_UCHARDET(text, len, encodingHint, &ucd_cnf, encodingStrg_UCD, MAX_ENC_STRG_LEN);
cpiEncoding_UCD = AnalyzeText_UCHARDET(text, len, encodingHint, &ucd_cnf, encodingStrg_UCD, MAX_ENC_STRG_LEN);
ucd_cnf = clampf(ucd_cnf, 0.0f, 1.0f);
//~}
//~else {
//~ cpiEncoding_UCD = CPI_NONE;
@ -791,11 +796,10 @@ cpi_enc_t Encoding_AnalyzeText
#endif
float confidence = 0.0f;
float const ucd_confidence = ucd_cnf;
//~float const ced_confidence = ced_cnf;
UINT const codePage_UCD = Encoding_GetCodePage(cpiEncoding_UCD);
//~UINT const codePage_CED = Encoding_GetCodePage(cpiEncoding_CED);
// extra bonus, if detected encoding is local codepage
float const bonus = (codePage_UCD == Encoding_GetCodePage(CPI_ANSI_DEFAULT)) ? (1.0f - ucd_cnf) * LOCAL_ANSI_BONUS_FAC : 0.0f;
float const ucd_confidence = clampf(ucd_cnf + bonus, 0.0f, 1.0f);
if (Flags.bDevDebugMode)
@ -847,7 +851,7 @@ cpi_enc_t Encoding_AnalyzeText
// --------------------------------------------------------------------------
cpi_enc_t iAnalyzedEncoding = cpiEncoding_UCD;
confidence = ucd_confidence;
float confidence = ucd_confidence;
/* ~~~
if ((cpiEncoding_UCD == cpiEncoding_CED) && !Encoding_IsNONE(cpiEncoding_UCD))

View File

@ -3364,6 +3364,7 @@ LRESULT MsgInitMenu(HWND hwnd, WPARAM wParam, LPARAM lParam)
CheckCmd(hmenu, IDM_VIEW_NOSAVERECENT, Settings.SaveRecentFiles);
CheckCmd(hmenu, IDM_VIEW_NOPRESERVECARET, Settings.PreserveCaretPos);
EnableCmd(hmenu, IDM_VIEW_NOPRESERVECARET, Settings.SaveRecentFiles);
CheckCmd(hmenu, IDM_VIEW_NOSAVEFINDREPL, Settings.SaveFindReplace);
CheckCmd(hmenu, IDM_VIEW_SAVEBEFORERUNNINGTOOLS, Settings.SaveBeforeRunningTools);
@ -3387,13 +3388,6 @@ LRESULT MsgInitMenu(HWND hwnd, WPARAM wParam, LPARAM lParam)
i = IDM_VIEW_NOESCFUNC;
CheckMenuRadioItem(hmenu, IDM_VIEW_NOESCFUNC, IDM_VIEW_ESCEXIT, i, MF_BYCOMMAND);
EnableCmd(hmenu, IDM_VIEW_REUSEWINDOW, i);
EnableCmd(hmenu, IDM_VIEW_STICKYWINPOS, i);
EnableCmd(hmenu, IDM_VIEW_SINGLEFILEINSTANCE, i);
EnableCmd(hmenu, IDM_VIEW_NOSAVERECENT, i);
EnableCmd(hmenu, IDM_VIEW_NOPRESERVECARET, i);
EnableCmd(hmenu, IDM_VIEW_NOSAVEFINDREPL, i);
EnableCmd(hmenu, CMD_WEBACTION1, !se && !mrs && bPosInSel);
EnableCmd(hmenu, CMD_WEBACTION2, !se && !mrs && bPosInSel);
bool const bIsHLink = (SciCall_IndicatorValueAt(INDIC_NP3_HYPERLINK, iCurPos) > 0);

View File

@ -8,8 +8,8 @@
#define SAPPNAME "Notepad3"
#define VERSION_MAJOR 5
#define VERSION_MINOR 20
#define VERSION_REV 309
#define VERSION_BUILD 3
#define VERSION_REV 310
#define VERSION_BUILD 1
#define SCINTILLA_VER 432
#define ONIGURUMA_REGEX_VER 6.9.4
#define UCHARDET_VER 2018.09.27