diff --git a/Versions/build.txt b/Versions/build.txt index 076bcb6ab..0fb26ffdf 100644 --- a/Versions/build.txt +++ b/Versions/build.txt @@ -1 +1 @@ -1690 +1691 diff --git a/res/Notepad3.exe.manifest.conf b/res/Notepad3.exe.manifest.conf index f2e7c6141..34ee31de6 100644 --- a/res/Notepad3.exe.manifest.conf +++ b/res/Notepad3.exe.manifest.conf @@ -3,7 +3,7 @@ Notepad3 RC diff --git a/src/Dialogs.c b/src/Dialogs.c index c0fe2c861..302f3fc36 100644 --- a/src/Dialogs.c +++ b/src/Dialogs.c @@ -2980,7 +2980,7 @@ static INT_PTR CALLBACK WarnLineEndingDlgProc(HWND hwnd, UINT umsg, WPARAM wPara //============================================================================= // -// SelectDefLineEndingDlg() +// WarnLineEndingDlg() // bool WarnLineEndingDlg(HWND hwnd, EditFileIOStatus* fioStatus) { @@ -3086,7 +3086,7 @@ static INT_PTR CALLBACK WarnIndentationDlgProc(HWND hwnd, UINT umsg, WPARAM wPar //============================================================================= // -// SelectDefLineEndingDlg() +// WarnIndentationDlg() // bool WarnIndentationDlg(HWND hwnd, EditFileIOStatus* fioStatus) { diff --git a/src/Edit.c b/src/Edit.c index 48d4f7907..d5e15d95e 100644 --- a/src/Edit.c +++ b/src/Edit.c @@ -4462,6 +4462,7 @@ void EditEnsureSelectionVisible(HWND hwnd) // void EditEnsureConsistentLineEndings(HWND hwnd) { + Globals.bInconsistentLineBreaks = false; SciCall_ConvertEOLs(SciCall_GetEOLMode()); EditFixPositions(hwnd); } diff --git a/src/Notepad3.c b/src/Notepad3.c index c85df817b..dfe505a91 100644 --- a/src/Notepad3.c +++ b/src/Notepad3.c @@ -485,6 +485,7 @@ static void _InitGlobals() Globals.bFindReplCopySelOrClip = true; Globals.bReplaceInitialized = false; Globals.FindReplaceMatchFoundState = FND_NOP; + Globals.bInconsistentLineBreaks = false; Flags.bDevDebugMode = DefaultFlags.bDevDebugMode = false; Flags.bStickyWindowPosition = DefaultFlags.bStickyWindowPosition = false; @@ -3592,7 +3593,7 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam) EditEnsureConsistentLineEndings(Globals.hwndEdit); _OBSERVE_NOTIFY_CHANGE_; EndWaitCursor(); - UpdateStatusbar(false); + UpdateStatusbar(true); } break; @@ -9015,6 +9016,13 @@ static void _UpdateStatusbarDelayed(bool bForceRedraw) } // ------------------------------------------------------ + const WCHAR* const _LF_f = L"%sLF%s"; + const WCHAR* const _LFi_f = L"%sLF*%s"; + const WCHAR* const _CR_f = L"%sCR%s"; + const WCHAR* const _CRi_f = L"%sCR*%s"; + const WCHAR* const _CRLF_f = L"%sCR+LF%s"; + const WCHAR* const _CRLFi_f = L"%sCR+LF*%s"; + if (s_iStatusbarVisible[STATUS_EOLMODE]) { static int s_iEOLMode = -1; @@ -9022,17 +9030,20 @@ static void _UpdateStatusbarDelayed(bool bForceRedraw) if (bForceRedraw || (s_iEOLMode != _eol_mode)) { - if (_eol_mode == SC_EOL_LF) { - StringCchPrintf(tchStatusBar[STATUS_EOLMODE], txtWidth, L"%sLF%s", - s_mxSBPrefix[STATUS_EOLMODE], s_mxSBPostfix[STATUS_EOLMODE]); + static WCHAR tchEOL[16] = { L'\0' }; + if (_eol_mode == SC_EOL_LF) + { + StringCchPrintf(tchStatusBar[STATUS_EOLMODE], txtWidth, (Globals.bInconsistentLineBreaks ? _LFi_f : _LF_f), + s_mxSBPrefix[STATUS_EOLMODE], s_mxSBPostfix[STATUS_EOLMODE]); } - else if (_eol_mode == SC_EOL_CR) { - StringCchPrintf(tchStatusBar[STATUS_EOLMODE], txtWidth, L"%sCR%s", - s_mxSBPrefix[STATUS_EOLMODE], s_mxSBPostfix[STATUS_EOLMODE]); + else if (_eol_mode == SC_EOL_CR) + { + StringCchPrintf(tchStatusBar[STATUS_EOLMODE], txtWidth, (Globals.bInconsistentLineBreaks ? _CRi_f : _CR_f), + s_mxSBPrefix[STATUS_EOLMODE], s_mxSBPostfix[STATUS_EOLMODE]); } else { - StringCchPrintf(tchStatusBar[STATUS_EOLMODE], txtWidth, L"%sCR+LF%s", - s_mxSBPrefix[STATUS_EOLMODE], s_mxSBPostfix[STATUS_EOLMODE]); + StringCchPrintf(tchStatusBar[STATUS_EOLMODE], txtWidth, (Globals.bInconsistentLineBreaks ? _CRLFi_f : _CRLF_f), + s_mxSBPrefix[STATUS_EOLMODE], s_mxSBPostfix[STATUS_EOLMODE]); } s_iEOLMode = _eol_mode; bIsUpdateNeeded = true; @@ -9789,11 +9800,16 @@ bool FileLoad(bool bDontSave, bool bNew, bool bReload, } // Show inconsistent line endings warning - if (fioStatus.bInconsistentEOLs && Settings.WarnInconsistEOLs && !s_flagPrintFileAndLeave) + Globals.bInconsistentLineBreaks = fioStatus.bInconsistentEOLs; + _UpdateStatusbarDelayed(true); + + if (Globals.bInconsistentLineBreaks && Settings.WarnInconsistEOLs && !s_flagPrintFileAndLeave) { if (WarnLineEndingDlg(Globals.hwndMain, &fioStatus)) { SciCall_ConvertEOLs(fioStatus.iEOLMode); + Globals.bInconsistentLineBreaks = false; } + _UpdateStatusbarDelayed(true); } // Show inconsistent indentation @@ -9805,7 +9821,6 @@ bool FileLoad(bool bDontSave, bool bNew, bool bReload, EditIndentationStatistic(Globals.hwndEdit, &fioStatus); ConsistentIndentationCheck(&fioStatus); } - if (Settings.AutoDetectIndentSettings && !s_flagPrintFileAndLeave) { if (!Settings.WarnInconsistentIndents || (fioStatus.iGlobalIndent != I_MIX_LN)) @@ -9820,6 +9835,9 @@ bool FileLoad(bool bDontSave, bool bNew, bool bReload, else if (!(fioStatus.bFileTooBig || fioStatus.bUnknownExt)) { InfoBoxLng(MB_ICONWARNING, NULL, IDS_MUI_ERR_LOADFILE, szFileName); } + + UpdateAllBars(true); + return(fSuccess); } diff --git a/src/TypeDefs.h b/src/TypeDefs.h index aeb669b11..0a7757671 100644 --- a/src/TypeDefs.h +++ b/src/TypeDefs.h @@ -307,6 +307,7 @@ typedef struct _globals_t bool bIniFileFromScratch; bool bFindReplCopySelOrClip; bool bReplaceInitialized; + bool bInconsistentLineBreaks; FR_STATES FindReplaceMatchFoundState; diff --git a/src/VersionEx.h b/src/VersionEx.h index bc344eed7..06d470ada 100644 --- a/src/VersionEx.h +++ b/src/VersionEx.h @@ -7,8 +7,8 @@ #define SAPPNAME "Notepad3" #define VERSION_MAJOR 5 #define VERSION_MINOR 19 -#define VERSION_REV 503 -#define VERSION_BUILD 1690 +#define VERSION_REV 504 +#define VERSION_BUILD 1691 #define SCINTILLA_VER 415 #define ONIGMO_REGEX_VER 6.2.0 #define VERSION_PATCH RC