From 8e2d9c744aaf4f40cd0b33f1ca64febced4c5b04 Mon Sep 17 00:00:00 2001 From: donho Date: Thu, 1 Nov 2007 20:04:31 +0000 Subject: [PATCH] [BUGFIXED_NEWFEATURE] Change the behaviour : When file is deleted from outside and switch back to Notepad++, user will be asked if he want to keep this file. If he answer yes, he will not be asked in the next time. Change Window title from Notepad++ - file path to file path - notepad++.exe git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@67 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/src/MISC/RegExt/regExtDlg.cpp | 2 +- PowerEditor/src/Notepad_plus.cpp | 27 ++++++++++--------- PowerEditor/src/ScitillaComponent/Buffer.h | 6 +++-- .../src/ScitillaComponent/UserDefineDialog.rc | 2 +- 4 files changed, 21 insertions(+), 16 deletions(-) diff --git a/PowerEditor/src/MISC/RegExt/regExtDlg.cpp b/PowerEditor/src/MISC/RegExt/regExtDlg.cpp index a3ef89402..8d8e6a801 100644 --- a/PowerEditor/src/MISC/RegExt/regExtDlg.cpp +++ b/PowerEditor/src/MISC/RegExt/regExtDlg.cpp @@ -34,7 +34,7 @@ char defExtArray[nbSupportedLang][nbExtMax][extNameMax] = { {"java, c#, pascal", ".java", ".cs", ".pas", ".inc"}, {"web(html) script", ".html", ".htm", ".php", ".phtml", ".js", ".jsp", ".asp", ".css", ".xml"}, {"public script", ".sh", ".bsh", ".nsi", ".nsh", ".lua", ".pl", ".pm", ".py"}, - {"property script", ".rc", ".as", ".mx", ".vb", ".vbs", ".bat", ".cmd", ".nt"}, + {"property script", ".rc", ".as", ".mx", ".vb", ".vbs"}, {"fortran, TeX, SQL", ".f", ".for", ".f90", ".f95", ".f2k", ".tex", ".sql"}, {"misc", ".nfo", ".mak"}, {"customize"} diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index a8f89fe33..9b25eee22 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -3805,9 +3805,10 @@ void Notepad_plus::setTitleWith(const char *filePath) if (!filePath || !strcmp(filePath, "")) return; - char str2concat[MAX_PATH]; - strcat(strcpy(str2concat, _className), " - "); - strcat(str2concat, filePath); + const size_t str2concatLen = MAX_PATH + 32; + char str2concat[str2concatLen]; + strcat(strcpy(str2concat, filePath), " - "); + strcat(str2concat, _className); ::SetWindowText(_hSelf, str2concat); } @@ -3978,18 +3979,18 @@ void Notepad_plus::checkModifiedDocument() if (pScintillaArray[j]->isCurrentBufReadOnly()) pScintillaArray[j]->execute(SCI_SETREADONLY, TRUE); - - if (_activeAppInf._isActivated) - { - int curPos = _pEditView->execute(SCI_GETCURRENTPOS); - ::PostMessage(_pEditView->getHSelf(), WM_LBUTTONUP, 0, 0); - ::PostMessage(_pEditView->getHSelf(), SCI_SETSEL, curPos, curPos); - _activeAppInf._isActivated = false; - } + } + + if (_activeAppInf._isActivated) + { + int curPos = _pEditView->execute(SCI_GETCURRENTPOS); + ::PostMessage(_pEditView->getHSelf(), WM_LBUTTONUP, 0, 0); + ::PostMessage(_pEditView->getHSelf(), SCI_SETSEL, curPos, curPos); + _activeAppInf._isActivated = false; } docBuf.updatTimeStamp(); } - else if (fStatus == FILE_DELETED) + else if (fStatus == FILE_DELETED && !docBuf._dontBotherMeAnymore) { if (::IsIconic(_hSelf)) ::ShowWindow(_hSelf, SW_SHOWNORMAL); @@ -4005,6 +4006,8 @@ void Notepad_plus::checkModifiedDocument() else pDocTabArray[j]->closeCurrentDoc(); } + else + docBuf._dontBotherMeAnymore = true; if (_activeAppInf._isActivated) { diff --git a/PowerEditor/src/ScitillaComponent/Buffer.h b/PowerEditor/src/ScitillaComponent/Buffer.h index 2dea7884c..c9df2a55a 100644 --- a/PowerEditor/src/ScitillaComponent/Buffer.h +++ b/PowerEditor/src/ScitillaComponent/Buffer.h @@ -105,8 +105,9 @@ public : }; Buffer(const Buffer & buf) : _isDirty(buf._isDirty), _doc(buf._doc), _lang(buf._lang), - _timeStamp(buf._timeStamp), _isReadOnly(buf._isReadOnly), _isSetReadOnly(buf._isSetReadOnly), _pos(buf._pos), - _format(buf._format),_unicodeMode(buf._unicodeMode), _foldState(buf._foldState), _recentTag(buf._recentTag)/*, _isBinary(false)*/ + _timeStamp(buf._timeStamp), _isReadOnly(buf._isReadOnly), _isSetReadOnly(buf._isSetReadOnly), _pos(buf._pos), + _format(buf._format),_unicodeMode(buf._unicodeMode), _foldState(buf._foldState), _recentTag(buf._recentTag), + _dontBotherMeAnymore(false) { strcpy(_fullPathName, buf._fullPathName); strcpy(_userLangExt, buf._userLangExt); @@ -337,6 +338,7 @@ private : long _recentTag; static long _recentTagCtr; //bool _isBinary; + bool _dontBotherMeAnymore; Lang * getCurrentLang() const { int i = 0 ; diff --git a/PowerEditor/src/ScitillaComponent/UserDefineDialog.rc b/PowerEditor/src/ScitillaComponent/UserDefineDialog.rc index 806a7a953..78e9601d8 100644 --- a/PowerEditor/src/ScitillaComponent/UserDefineDialog.rc +++ b/PowerEditor/src/ScitillaComponent/UserDefineDialog.rc @@ -105,7 +105,7 @@ BEGIN LTEXT "Font Name :",IDC_KEYWORD3_FONTNAME_STATIC,136,251,44,8,0,WS_EX_RIGHT LTEXT "Font size :",IDC_KEYWORD3_FONTSIZE_STATIC,212,268,34,8,0,WS_EX_RIGHT EDITTEXT IDC_KEYWORD3_EDIT,14,303,282,28,ES_MULTILINE | WS_VSCROLL - GROUPBOX "3th Group",IDC_KEYWORD3_DESCGROUP_STATIC,4,227,300,110,BS_CENTER | BS_FLAT + GROUPBOX "3rd Group",IDC_KEYWORD3_DESCGROUP_STATIC,4,227,300,110,BS_CENTER | BS_FLAT LTEXT "Foreground color",IDC_KEYWORD4_FG_STATIC,26,362,57,8,0,WS_EX_RIGHT LTEXT "Background color",IDC_KEYWORD4_BG_STATIC,26,383,57,8,0,WS_EX_RIGHT COMBOBOX IDC_KEYWORD4_FONT_COMBO,184,363,104,78,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP