diff --git a/PowerEditor/bin/change.log b/PowerEditor/bin/change.log index 7634c272..7e81e30b 100644 --- a/PowerEditor/bin/change.log +++ b/PowerEditor/bin/change.log @@ -1,10 +1,10 @@ -Notepad++ v6.6.1 bug fixes: +Notepad++ v6.6.2 bug fixes: +1. Fix session snapshot enabled issue even "remember current session" option is disabled. +Notepad++ v6.6.1 bug fixes: 1. Fix Notepad++ hanging issue while saving a large file if session snapshot feature is on. - Notepad++ v6.6 new features and bug fixes: - 1. Add session snapshot and periodic backup feature. 2. Fix RTL/LTR command making mirrored text bug. 3. Make auto-detect character encoding optional. diff --git a/PowerEditor/bin/npp.pdb b/PowerEditor/bin/npp.pdb index 93d98a0a..4444889d 100644 Binary files a/PowerEditor/bin/npp.pdb and b/PowerEditor/bin/npp.pdb differ diff --git a/PowerEditor/installer/nppSetup.nsi b/PowerEditor/installer/nppSetup.nsi index 9f4926d1..83ccb090 100644 --- a/PowerEditor/installer/nppSetup.nsi +++ b/PowerEditor/installer/nppSetup.nsi @@ -28,10 +28,10 @@ ; Define the application name !define APPNAME "Notepad++" -!define APPVERSION "6.6.1" +!define APPVERSION "6.6.2" !define APPNAMEANDVERSION "${APPNAME} v${APPVERSION}" !define VERSION_MAJOR 6 -!define VERSION_MINOR 61 +!define VERSION_MINOR 62 !define APPWEBSITE "http://notepad-plus-plus.org/" diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 38b7ffac..ec4dda06 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -3207,7 +3207,7 @@ bool Notepad_plus::activateBuffer(BufferID id, int whichOne) { //scnN.nmhdr.code = NPPN_DOCSWITCHINGOFF; //superseeded by NPPN_BUFFERACTIVATED - bool isSnapshotMode = NppParameters::getInstance()->getNppGUI()._isSnapshotMode; + bool isSnapshotMode = NppParameters::getInstance()->getNppGUI().isSnapshotMode(); if (isSnapshotMode) { // Before switching off, synchronize backup file @@ -4472,7 +4472,7 @@ void Notepad_plus::notifyBufferChanged(Buffer * buffer, int mask) if (doCloseOrNot(buffer->getFullPathName()) == IDNO) { //close in both views, doing current view last since that has to remain opened - bool isSnapshotMode = nppGUI._isSnapshotMode; + bool isSnapshotMode = nppGUI.isSnapshotMode(); doClose(buffer->getID(), otherView(), isSnapshotMode); doClose(buffer->getID(), currentView(), isSnapshotMode); } @@ -5769,7 +5769,7 @@ DWORD WINAPI Notepad_plus::backupDocument(void * /*param*/) ::Sleep(timer); - isSnapshotMode = NppParameters::getInstance()->getNppGUI()._isSnapshotMode; + isSnapshotMode = NppParameters::getInstance()->getNppGUI().isSnapshotMode(); if (!isSnapshotMode) break; diff --git a/PowerEditor/src/Notepad_plus.h b/PowerEditor/src/Notepad_plus.h index 6c35e054..cc443320 100644 --- a/PowerEditor/src/Notepad_plus.h +++ b/PowerEditor/src/Notepad_plus.h @@ -289,12 +289,7 @@ public: bool addCurrentMacro(); void macroPlayback(Macro); - void loadLastSession(){ - Session lastSession = (NppParameters::getInstance())->getSession(); - bool isSnapshotMode = NppParameters::getInstance()->getNppGUI()._isSnapshotMode; - loadSession(lastSession, isSnapshotMode); - }; - + void loadLastSession(); bool loadSession(Session & session, bool isSnapshotMode = false); void notifyBufferChanged(Buffer * buffer, int mask); diff --git a/PowerEditor/src/Notepad_plus_Window.cpp b/PowerEditor/src/Notepad_plus_Window.cpp index e25cb084..7e28340f 100644 --- a/PowerEditor/src/Notepad_plus_Window.cpp +++ b/PowerEditor/src/Notepad_plus_Window.cpp @@ -223,7 +223,7 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLin ::MessageBoxA(NULL, dest, "", MB_OK); } - bool isSnapshotMode = nppGUI._isSnapshotMode; + bool isSnapshotMode = nppGUI.isSnapshotMode(); if (isSnapshotMode) { _notepad_plus_plus_core.checkModifiedDocument(); diff --git a/PowerEditor/src/NppBigSwitch.cpp b/PowerEditor/src/NppBigSwitch.cpp index ad4e074b..a264e042 100644 --- a/PowerEditor/src/NppBigSwitch.cpp +++ b/PowerEditor/src/NppBigSwitch.cpp @@ -1419,7 +1419,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa if (_pTrayIco) _pTrayIco->doTrayIcon(REMOVE); - bool isSnapshotMode = pNppParam->getNppGUI()._isSnapshotMode; + bool isSnapshotMode = pNppParam->getNppGUI().isSnapshotMode(); if (isSnapshotMode) MainFileManager->backupCurrentBuffer(); diff --git a/PowerEditor/src/NppCommands.cpp b/PowerEditor/src/NppCommands.cpp index 341c03a8..014bfa95 100644 --- a/PowerEditor/src/NppCommands.cpp +++ b/PowerEditor/src/NppCommands.cpp @@ -118,7 +118,7 @@ void Notepad_plus::command(int id) case IDM_FILE_CLOSEALL: { - bool isSnapshotMode = NppParameters::getInstance()->getNppGUI()._isSnapshotMode; + bool isSnapshotMode = NppParameters::getInstance()->getNppGUI().isSnapshotMode(); fileCloseAll(isSnapshotMode, false); checkDocState(); break; diff --git a/PowerEditor/src/NppIO.cpp b/PowerEditor/src/NppIO.cpp index 35f086c0..0813f8de 100644 --- a/PowerEditor/src/NppIO.cpp +++ b/PowerEditor/src/NppIO.cpp @@ -597,7 +597,7 @@ bool Notepad_plus::fileClose(BufferID id, int curView) viewToClose = curView; //first check amount of documents, we dont want the view to hide if we closed a secondary doc with primary being empty //int nrDocs = _pDocTab->nbItem(); - bool isSnapshotMode = NppParameters::getInstance()->getNppGUI()._isSnapshotMode; + bool isSnapshotMode = NppParameters::getInstance()->getNppGUI().isSnapshotMode(); doClose(bufferID, viewToClose, isSnapshotMode); return true; } @@ -733,7 +733,7 @@ bool Notepad_plus::fileCloseAllGiven(const std::vector &krvecBufferIndexes) } // Now we close. - bool isSnapshotMode = NppParameters::getInstance()->getNppGUI()._isSnapshotMode; + bool isSnapshotMode = NppParameters::getInstance()->getNppGUI().isSnapshotMode(); for(std::vector::const_iterator itIndex = krvecBufferIndexes.begin(); itIndex != itIndexesEnd; ++itIndex) { doClose(_pDocTab->getBufferByIndex(*itIndex), currentView(), isSnapshotMode); } @@ -826,7 +826,7 @@ bool Notepad_plus::fileCloseAllButCurrent() } } - bool isSnapshotMode = NppParameters::getInstance()->getNppGUI()._isSnapshotMode; + bool isSnapshotMode = NppParameters::getInstance()->getNppGUI().isSnapshotMode(); //Then start closing, inactive view first so the active is left open if (bothActive()) { //first close all docs in non-current view, which gets closed automatically @@ -1059,7 +1059,7 @@ bool Notepad_plus::fileDelete(BufferID id) MB_OK); return false; } - bool isSnapshotMode = NppParameters::getInstance()->getNppGUI()._isSnapshotMode; + bool isSnapshotMode = NppParameters::getInstance()->getNppGUI().isSnapshotMode(); doClose(bufferID, MAIN_VIEW, isSnapshotMode); doClose(bufferID, SUB_VIEW, isSnapshotMode); return true; @@ -1120,6 +1120,15 @@ bool Notepad_plus::isFileSession(const TCHAR * filename) { return false; } +void Notepad_plus::loadLastSession() +{ + NppParameters *nppParams = NppParameters::getInstance(); + const NppGUI & nppGui = nppParams->getNppGUI(); + Session lastSession = nppParams->getSession(); + bool isSnapshotMode = nppGui.isSnapshotMode(); + loadSession(lastSession, isSnapshotMode); +} + bool Notepad_plus::loadSession(Session & session, bool isSnapshotMode) { NppParameters *pNppParam = NppParameters::getInstance(); diff --git a/PowerEditor/src/NppNotification.cpp b/PowerEditor/src/NppNotification.cpp index f50402ce..a4381a02 100644 --- a/PowerEditor/src/NppNotification.cpp +++ b/PowerEditor/src/NppNotification.cpp @@ -112,7 +112,7 @@ BOOL Notepad_plus::notify(SCNotification *notification) if (notification->nmhdr.code == SCN_SAVEPOINTREACHED) { - bool isSnapshotMode = NppParameters::getInstance()->getNppGUI()._isSnapshotMode; + bool isSnapshotMode = NppParameters::getInstance()->getNppGUI().isSnapshotMode(); if (isSnapshotMode) { MainFileManager->backupCurrentBuffer(); @@ -276,7 +276,7 @@ BOOL Notepad_plus::notify(SCNotification *notification) } else if (notification->nmhdr.hwndFrom == _mainDocTab.getHSelf() && _activeView == SUB_VIEW) { - bool isSnapshotMode = NppParameters::getInstance()->getNppGUI()._isSnapshotMode; + bool isSnapshotMode = NppParameters::getInstance()->getNppGUI().isSnapshotMode(); if (isSnapshotMode) { // Before switching off, synchronize backup file @@ -287,7 +287,7 @@ BOOL Notepad_plus::notify(SCNotification *notification) } else if (notification->nmhdr.hwndFrom == _subDocTab.getHSelf() && _activeView == MAIN_VIEW) { - bool isSnapshotMode = NppParameters::getInstance()->getNppGUI()._isSnapshotMode; + bool isSnapshotMode = NppParameters::getInstance()->getNppGUI().isSnapshotMode(); if (isSnapshotMode) { // Before switching off, synchronize backup file diff --git a/PowerEditor/src/Parameters.cpp b/PowerEditor/src/Parameters.cpp index 657261f1..5cee84db 100644 --- a/PowerEditor/src/Parameters.cpp +++ b/PowerEditor/src/Parameters.cpp @@ -4726,7 +4726,7 @@ bool NppParameters::writeGUIParams() element->SetAttribute(TEXT("useCustumDir"), _nppGUI._useDir?TEXT("yes"):TEXT("no")); element->SetAttribute(TEXT("dir"), _nppGUI._backupDir.c_str()); - element->SetAttribute(TEXT("isSnapshotMode"), _nppGUI._isSnapshotMode?TEXT("yes"):TEXT("no")); + element->SetAttribute(TEXT("isSnapshotMode"), _nppGUI._isSnapshotMode && _nppGUI._rememberLastSession?TEXT("yes"):TEXT("no")); element->SetAttribute(TEXT("snapshotBackupTiming"), _nppGUI._snapshotBackupTiming); backExist = true; } @@ -5007,7 +5007,7 @@ bool NppParameters::writeGUIParams() GUIConfigElement->SetAttribute(TEXT("useCustumDir"), _nppGUI._useDir?TEXT("yes"):TEXT("no")); GUIConfigElement->SetAttribute(TEXT("dir"), _nppGUI._backupDir.c_str()); - GUIConfigElement->SetAttribute(TEXT("isSnapshotMode"), _nppGUI._isSnapshotMode?TEXT("yes"):TEXT("no")); + GUIConfigElement->SetAttribute(TEXT("isSnapshotMode"), _nppGUI.isSnapshotMode()?TEXT("yes"):TEXT("no")); GUIConfigElement->SetAttribute(TEXT("snapshotBackupTiming"), _nppGUI._snapshotBackupTiming); } diff --git a/PowerEditor/src/Parameters.h b/PowerEditor/src/Parameters.h index c4327d3c..e3386067 100644 --- a/PowerEditor/src/Parameters.h +++ b/PowerEditor/src/Parameters.h @@ -815,12 +815,7 @@ struct NppGUI generic_string _themeName; MultiInstSetting _multiInstSetting; bool _fileSwitcherWithoutExtColumn; - /* - bool isSnapshotMode() const {return _isSnapshotMode;}; - void setBackupMode(bool doBackup) {_isSnapshotMode = doBackup;}; - size_t getBackupTiming() const {return _snapshotBackupTiming;}; - void setBackupTiming(size_t timing) {_snapshotBackupTiming = timing;}; - */ + bool isSnapshotMode() const {return _isSnapshotMode && _rememberLastSession;}; bool _isSnapshotMode; size_t _snapshotBackupTiming; }; diff --git a/PowerEditor/src/WinControls/DockingWnd/DockingCont.cpp b/PowerEditor/src/WinControls/DockingWnd/DockingCont.cpp index 844ac028..cff5b899 100644 --- a/PowerEditor/src/WinControls/DockingWnd/DockingCont.cpp +++ b/PowerEditor/src/WinControls/DockingWnd/DockingCont.cpp @@ -301,7 +301,7 @@ LRESULT DockingCont::runProcCaption(HWND hwnd, UINT Message, WPARAM wParam, LPAR DWORD dwError = ::GetLastError(); TCHAR str[128]; ::wsprintf(str, TEXT("GetLastError() returned %lu"), dwError); - ::MessageBox(NULL, str, TEXT("SetWindowsHookEx(MOUSE) failed"), MB_OK | MB_ICONERROR); + ::MessageBox(NULL, str, TEXT("SetWindowsHookEx(MOUSE) failed on runProcCaption"), MB_OK | MB_ICONERROR); } ::RedrawWindow(hwnd, NULL, NULL, TRUE); } diff --git a/PowerEditor/src/WinControls/DockingWnd/DockingSplitter.cpp b/PowerEditor/src/WinControls/DockingWnd/DockingSplitter.cpp index db4e0cab..87e01392 100644 --- a/PowerEditor/src/WinControls/DockingWnd/DockingSplitter.cpp +++ b/PowerEditor/src/WinControls/DockingWnd/DockingSplitter.cpp @@ -160,7 +160,7 @@ LRESULT DockingSplitter::runProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM DWORD dwError = ::GetLastError(); TCHAR str[128]; ::wsprintf(str, TEXT("GetLastError() returned %lu"), dwError); - ::MessageBox(NULL, str, TEXT("SetWindowsHookEx(MOUSE) failed"), MB_OK | MB_ICONERROR); + ::MessageBox(NULL, str, TEXT("SetWindowsHookEx(MOUSE) failed on runProc"), MB_OK | MB_ICONERROR); } else { diff --git a/PowerEditor/src/WinControls/DockingWnd/Gripper.cpp b/PowerEditor/src/WinControls/DockingWnd/Gripper.cpp index 835d7eb5..fbe8b7a9 100644 --- a/PowerEditor/src/WinControls/DockingWnd/Gripper.cpp +++ b/PowerEditor/src/WinControls/DockingWnd/Gripper.cpp @@ -265,18 +265,18 @@ void Gripper::create() DWORD dwError = ::GetLastError(); TCHAR str[128]; ::wsprintf(str, TEXT("GetLastError() returned %lu"), dwError); - ::MessageBox(NULL, str, TEXT("SetWindowsHookEx(MOUSE) failed"), MB_OK | MB_ICONERROR); + ::MessageBox(NULL, str, TEXT("SetWindowsHookEx(MOUSE) failed on Gripper::create()"), MB_OK | MB_ICONERROR); } if (ver < WV_VISTA) { - hookKeyboard = ::SetWindowsHookEx(WH_KEYBOARD, (HOOKPROC)hookProcKeyboard, _hInst, 0); + hookKeyboard = ::SetWindowsHookEx(WH_KEYBOARD, (HOOKPROC)hookProcKeyboard, _hInst, ::GetCurrentThreadId()); if (!hookKeyboard) { DWORD dwError = ::GetLastError(); TCHAR str[128]; ::wsprintf(str, TEXT("GetLastError() returned %lu"), dwError); - ::MessageBox(NULL, str, TEXT("SetWindowsHookEx(KEYBOARD) failed"), MB_OK | MB_ICONERROR); + ::MessageBox(NULL, str, TEXT("SetWindowsHookEx(KEYBOARD) failed on Gripper::create()"), MB_OK | MB_ICONERROR); } } // Removed regarding W9x systems diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp index ed2f72ec..a354cc66 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp @@ -2175,7 +2175,7 @@ BOOL CALLBACK BackupDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM) case WM_INITDIALOG : { ::SendDlgItemMessage(_hSelf, IDC_CHECK_REMEMBERSESSION, BM_SETCHECK, nppGUI._rememberLastSession, 0); - bool snapshotCheck = nppGUI._rememberLastSession && nppGUI._isSnapshotMode; + bool snapshotCheck = nppGUI._rememberLastSession && nppGUI.isSnapshotMode(); ::SendDlgItemMessage(_hSelf, IDC_BACKUPDIR_RESTORESESSION_CHECK, BM_SETCHECK, snapshotCheck?BST_CHECKED:BST_UNCHECKED, 0); int periodicBackupInSec = nppGUI._snapshotBackupTiming/1000; ::SetDlgItemInt(_hSelf, IDC_BACKUPDIR_RESTORESESSION_EDIT, periodicBackupInSec, FALSE); diff --git a/PowerEditor/src/resource.h b/PowerEditor/src/resource.h index f9db4c87..536c0db7 100644 --- a/PowerEditor/src/resource.h +++ b/PowerEditor/src/resource.h @@ -29,12 +29,12 @@ #ifndef RESOURCE_H #define RESOURCE_H -#define NOTEPAD_PLUS_VERSION TEXT("Notepad++ v6.6.1") +#define NOTEPAD_PLUS_VERSION TEXT("Notepad++ v6.6.2") // should be X.Y : ie. if VERSION_DIGITALVALUE == 4, 7, 1, 0 , then X = 4, Y = 71 // ex : #define VERSION_VALUE TEXT("5.63\0") -#define VERSION_VALUE TEXT("6.61\0") -#define VERSION_DIGITALVALUE 6, 6, 1, 0 +#define VERSION_VALUE TEXT("6.62\0") +#define VERSION_DIGITALVALUE 6, 6, 2, 0 #ifdef UNICODE #define UNICODE_ANSI_MODE TEXT("(UNICODE)")