diff --git a/PowerEditor/src/NppBigSwitch.cpp b/PowerEditor/src/NppBigSwitch.cpp index 62298c03..0bdff960 100644 --- a/PowerEditor/src/NppBigSwitch.cpp +++ b/PowerEditor/src/NppBigSwitch.cpp @@ -1476,8 +1476,9 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa case WM_ENDSESSION: { - ::DestroyWindow(hwnd); - return TRUE; + if(wParam == TRUE) + ::DestroyWindow(hwnd); + return 0; } case WM_DESTROY: diff --git a/PowerEditor/src/NppCommands.cpp b/PowerEditor/src/NppCommands.cpp index 53cbaef1..10f9cf62 100644 --- a/PowerEditor/src/NppCommands.cpp +++ b/PowerEditor/src/NppCommands.cpp @@ -321,7 +321,10 @@ void Notepad_plus::command(int id) case IDM_EDIT_BEGINENDSELECT: { - _pEditView->beginOrEndSelect(); + if(_pEditView->beginEndSelectedIsStarted()) + ::CheckMenuItem(_mainMenuHandle, IDM_EDIT_BEGINENDSELECT, MF_BYCOMMAND | MF_UNCHECKED); + else + ::CheckMenuItem(_mainMenuHandle, IDM_EDIT_BEGINENDSELECT, MF_BYCOMMAND | MF_CHECKED); } break; diff --git a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp index 51e6db7e..e6be6fe2 100644 --- a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp @@ -682,6 +682,7 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP break; case IDOK : // Find Next : only for FIND_DLG and REPLACE_DLG { + setStatusbarMessage(TEXT(""), FSNoMessage); bool isUnicode = (*_ppEditView)->getCurrentBuffer()->getUnicodeMode() != uni8Bit; HWND hFindCombo = ::GetDlgItem(_hSelf, IDFINDWHAT); @@ -695,9 +696,9 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP FindStatus findStatus = FSFound; processFindNext(_options._str2Search.c_str(), _env, &findStatus); if (findStatus == FSEndReached) - setStatusbarMessage(TEXT("Find: Found the 1st occurrence from the top. The end of document has been reached."), FSEndReached); + setStatusbarMessage(TEXT("Find: Found the 1st occurrence from the top. The end of the document has been reached."), FSEndReached); else if (findStatus == FSTopReached) - setStatusbarMessage(TEXT("Find: Found the 1st occurrence from the bottom. The begin of document has been reached."), FSTopReached); + setStatusbarMessage(TEXT("Find: Found the 1st occurrence from the bottom. The beginning of the document has been reached."), FSTopReached); nppParamInst->_isFindReplacing = false; } @@ -707,6 +708,7 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP { if (_currentStatus == REPLACE_DLG) { + setStatusbarMessage(TEXT(""), FSNoMessage); bool isUnicode = (*_ppEditView)->getCurrentBuffer()->getUnicodeMode() != uni8Bit; HWND hFindCombo = ::GetDlgItem(_hSelf, IDFINDWHAT); HWND hReplaceCombo = ::GetDlgItem(_hSelf, IDREPLACEWITH); @@ -726,6 +728,7 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP { if (_currentStatus == FIND_DLG) { + setStatusbarMessage(TEXT(""), FSNoMessage); bool isUnicode = (*_ppEditView)->getCurrentBuffer()->getUnicodeMode() != uni8Bit; HWND hFindCombo = ::GetDlgItem(_hSelf, IDFINDWHAT); combo2ExtendedMode(IDFINDWHAT); @@ -742,6 +745,7 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP case IDC_FINDALL_CURRENTFILE : { + setStatusbarMessage(TEXT(""), FSNoMessage); bool isUnicode = (*_ppEditView)->getCurrentBuffer()->getUnicodeMode() != uni8Bit; HWND hFindCombo = ::GetDlgItem(_hSelf, IDFINDWHAT); combo2ExtendedMode(IDFINDWHAT); @@ -757,6 +761,7 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP case IDD_FINDINFILES_FIND_BUTTON : { + setStatusbarMessage(TEXT(""), FSNoMessage); const int filterSize = 256; TCHAR filters[filterSize+1]; filters[filterSize] = '\0'; @@ -787,6 +792,7 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP case IDD_FINDINFILES_REPLACEINFILES : { + setStatusbarMessage(TEXT(""), FSNoMessage); const int filterSize = 256; TCHAR filters[filterSize]; TCHAR directory[MAX_PATH]; @@ -828,6 +834,7 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP { if (_currentStatus == REPLACE_DLG) { + setStatusbarMessage(TEXT(""), FSNoMessage); bool isUnicode = (*_ppEditView)->getCurrentBuffer()->getUnicodeMode() != uni8Bit; HWND hFindCombo = ::GetDlgItem(_hSelf, IDFINDWHAT); _options._str2Search = getTextFromCombo(hFindCombo, isUnicode); @@ -847,6 +854,7 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP { if (_currentStatus == REPLACE_DLG) { + setStatusbarMessage(TEXT(""), FSNoMessage); if ((*_ppEditView)->getCurrentBuffer()->isReadOnly()) { generic_string errMsg = TEXT("Replace: Cannot replace text. The current document is read only."); @@ -891,6 +899,7 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP { if (_currentStatus == FIND_DLG) { + setStatusbarMessage(TEXT(""), FSNoMessage); bool isUnicode = (*_ppEditView)->getCurrentBuffer()->getUnicodeMode() != uni8Bit; HWND hFindCombo = ::GetDlgItem(_hSelf, IDFINDWHAT); updateCombo(IDFINDWHAT); @@ -921,6 +930,7 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP { if (_currentStatus == MARK_DLG) { + setStatusbarMessage(TEXT(""), FSNoMessage); bool isUnicode = (*_ppEditView)->getCurrentBuffer()->getUnicodeMode() != uni8Bit; HWND hFindCombo = ::GetDlgItem(_hSelf, IDFINDWHAT); _options._str2Search = getTextFromCombo(hFindCombo, isUnicode); diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.h b/PowerEditor/src/ScitillaComponent/ScintillaEditView.h index 5c7fab6d..2a831f20 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.h +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.h @@ -281,6 +281,9 @@ public: void restoreCurrentFold(); void beginOrEndSelect(); + bool beginEndSelectedIsStarted() const { + return _beginSelectPosition != -1; + }; int getCurrentDocLen() const { return int(execute(SCI_GETLENGTH));