[RELEASE_4_9] Release 4.9.

Fix the replace bug while replacing nothing.
Fix the F3 searching direction bug.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@194 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
donho 2008-05-01 17:15:15 +00:00
parent 6b4b3c3f08
commit 3e705b3e64
9 changed files with 99 additions and 74 deletions

View File

@ -1,12 +1,22 @@
Notepad++ v4.8.5 fixed bugs and added features (from v4.8.2) : Notepad++ v4.9 fixed bugs and added features (from v4.8.5) :
1. Fix crash bug while a "New 2" is in session.xml. 1. Add smart highlighting feature (double click a word to highlight all the same word in the document).
2. Fix the Drag N Drop text bug between 2 views. 2. Enhance visual effect of Mark all feature.
3. Fix the annoying acrobat reader dialog problem. 3. Enhance Incremental search dialog docking.
4. Fix the bug that the first new document encoding is not set as the setting in "New Document settings". 4. Enhance Incremental search : add Highlight all feature.
5. Fix crash bug while running the command "Close All But Me" in some context. 5. Add auto-hide menu feature (IE7 style menu - Alt or F10 to toggle)
6. Add scroll to end line feature after document reloading from disk. 6. Enhance tool bar GUI usability (display a chevron while some tool icons hidden).
7. Enhance checking modification from outside feature. 7. Add style transparency feature, right click on color to enable.
8. Fix the files not opening by DnD bug.
9. Enhance Find Replace dialog : Add "Extended" option - search (and replace) for tabs(\t), newline(\n\r), and a characters by it's value (\o, \x, \b, \d, \t, \n, \r and \\).
10. Bug fixed : Find dialog always scrolls text into view now.
11. Add places bar in save as dialog
12. Fix non-recognized relative path bug in command line mode (under Dos prompt).
13. Add 2 messages for doc monitor plugin.
14. Fix the transparency bug (in Styler Configurator).
15. Make search in hidden directory (for Find in files) optional.
16. Fix the replace bug while replacing nothing.
17. Fix the F3 searching direction bug.
Included plugins : Included plugins :
@ -19,4 +29,5 @@ Included plugins :
6. NppExport v0.2.7.3 6. NppExport v0.2.7.3
7. Compare plugin v1.5.1 7. Compare plugin v1.5.1
8. Light Explorer v1.4 8. Light Explorer v1.4
9. Doc Monitor v2.0 9. Doc Monitor v2.1

View File

@ -17,16 +17,16 @@
; Define the application name ; Define the application name
!define APPNAME "Notepad++" !define APPNAME "Notepad++"
!define APPNAMEANDVERSION "Notepad++ v4.8.5" !define APPNAMEANDVERSION "Notepad++ v4.9"
!define VERSION_MAJOR 4 !define VERSION_MAJOR 4
!define VERSION_MINOR 85 !define VERSION_MINOR 9
; Main Install settings ; Main Install settings
Name "${APPNAMEANDVERSION}" Name "${APPNAMEANDVERSION}"
InstallDir "$PROGRAMFILES\Notepad++" InstallDir "$PROGRAMFILES\Notepad++"
InstallDirRegKey HKLM "Software\${APPNAME}" "" InstallDirRegKey HKLM "Software\${APPNAME}" ""
OutFile "..\bin\npp.4.8.5.Installer.exe" OutFile "..\bin\npp.4.9.Installer.exe"
; GetWindowsVersion ; GetWindowsVersion
; ;

View File

@ -201,20 +201,23 @@ enum winVer{WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV
#define CHECKDOCOPT_UPDATESILENTLY 1 #define CHECKDOCOPT_UPDATESILENTLY 1
#define CHECKDOCOPT_UPDATEGO2END 2 #define CHECKDOCOPT_UPDATEGO2END 2
#define NPPM_ADDREBAR (NPPMSG + 55) #define NPPM_GETCHECKDOCOPT (NPPMSG + 55)
// INT NPPM_GETCHECKDOCOPT(0, 0)
#define NPPM_SETCHECKDOCOPT (NPPMSG + 56)
// INT NPPM_SETCHECKDOCOPT(OPT, 0)
/*
#define NPPM_ADDREBAR (NPPMSG + 57)
// BOOL NPPM_ADDREBAR(0, REBARBANDINFO *) // BOOL NPPM_ADDREBAR(0, REBARBANDINFO *)
// Returns assigned ID in wID value of struct pointer // Returns assigned ID in wID value of struct pointer
#define NPPM_UPDATEREBAR (NPPMSG + 56) #define NPPM_UPDATEREBAR (NPPMSG + 58)
// BOOL NPPM_ADDREBAR(INT ID, REBARBANDINFO *) // BOOL NPPM_ADDREBAR(INT ID, REBARBANDINFO *)
//Use ID assigned with NPPM_ADDREBAR //Use ID assigned with NPPM_ADDREBAR
#define NPPM_REMOVEREBAR (NPPMSG + 57) #define NPPM_REMOVEREBAR (NPPMSG + 59)
// BOOL NPPM_ADDREBAR(INT ID, 0) // BOOL NPPM_ADDREBAR(INT ID, 0)
//Use ID assigned with NPPM_ADDREBAR //Use ID assigned with NPPM_ADDREBAR
*/
#define NPPM_GETCHECKDOCOPT (NPPMSG + 58)
// INT NPPM_GETCHECKDOCOPT(0, 0)
#define NPPM_SETCHECKDOCOPT (NPPMSG + 59)
// INT NPPM_SETCHECKDOCOPT(OPT, 0)
#define RUNCOMMAND_USER (WM_USER + 3000) #define RUNCOMMAND_USER (WM_USER + 3000)
#define NPPM_GETFULLCURRENTPATH (RUNCOMMAND_USER + FULL_CURRENT_PATH) #define NPPM_GETFULLCURRENTPATH (RUNCOMMAND_USER + FULL_CURRENT_PATH)

View File

@ -2866,10 +2866,11 @@ void Notepad_plus::command(int id)
if (!_findReplaceDlg.isCreated()) if (!_findReplaceDlg.isCreated())
return; return;
_findReplaceDlg.setSearchDirection(id == IDM_SEARCH_FINDNEXT?DIR_DOWN:DIR_UP); FindOption op = _findReplaceDlg.getCurrentOptions();
op._whichDirection = (id == IDM_SEARCH_FINDNEXT?DIR_DOWN:DIR_UP);
string s = _findReplaceDlg.getText2search(); string s = _findReplaceDlg.getText2search();
_findReplaceDlg.processFindNext(s.c_str());
_findReplaceDlg.processFindNext(s.c_str(), &op);
break; break;
} }
break; break;
@ -7758,7 +7759,7 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
{ {
return _mainDocTab.getHideTabBarStatus(); return _mainDocTab.getHideTabBarStatus();
} }
/*
case NPPM_ADDREBAR : case NPPM_ADDREBAR :
{ {
if (!lParam) if (!lParam)
@ -7782,7 +7783,7 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
_rebarTop.removeBand((int)wParam); _rebarTop.removeBand((int)wParam);
return TRUE; return TRUE;
} }
*/
case NPPM_INTERNAL_ISFOCUSEDTAB : case NPPM_INTERNAL_ISFOCUSEDTAB :
{ {
ScintillaEditView *cv = getCurrentEditView(); ScintillaEditView *cv = getCurrentEditView();

View File

@ -104,7 +104,7 @@ public:
return false; return false;
}; };
#pragma region fileOperation // fileOperation
bool doOpen(const char *fileName, bool isReadOnly = false); bool doOpen(const char *fileName, bool isReadOnly = false);
bool doSimpleOpen(const char *fileName); bool doSimpleOpen(const char *fileName);
bool doReload(const char *fileName, bool alert = true); bool doReload(const char *fileName, bool alert = true);
@ -120,7 +120,7 @@ public:
bool fileSaveAs(); bool fileSaveAs();
bool doSave(const char *filename, UniMode mode); bool doSave(const char *filename, UniMode mode);
#pragma endregion fileOperation // end fileOperation
void filePrint(bool showDialog); void filePrint(bool showDialog);
bool saveScintillaParams(bool whichOne); bool saveScintillaParams(bool whichOne);

View File

@ -111,6 +111,44 @@ bool Searching::readBase(const char * string, int * value, int base, int size) {
return true; return true;
} }
void Searching::displaySectionCentered(int posStart, int posEnd, ScintillaEditView * pEditView, bool isDownwards)
{
// to make sure the found result is visible
//When searching up, the beginning of the (possible multiline) result is important, when scrolling down the end
int testPos = (isDownwards)?posEnd:posStart;
pEditView->execute(SCI_SETCURRENTPOS, testPos);
int currentlineNumberDoc = (int)pEditView->execute(SCI_LINEFROMPOSITION, testPos);
int currentlineNumberVis = (int)pEditView->execute(SCI_VISIBLEFROMDOCLINE, currentlineNumberDoc);
pEditView->execute(SCI_ENSUREVISIBLE, currentlineNumberDoc); // make sure target line is unfolded
int firstVisibleLineVis = (int)pEditView->execute(SCI_GETFIRSTVISIBLELINE);
int linesVisible = (int)pEditView->execute(SCI_LINESONSCREEN) - 1; //-1 for the scrollbar
int lastVisibleLineVis = (int)linesVisible + firstVisibleLineVis;
//if out of view vertically, scroll line into (center of) view
int linesToScroll = 0;
if (currentlineNumberVis < firstVisibleLineVis)
{
linesToScroll = currentlineNumberVis - firstVisibleLineVis;
//use center
linesToScroll -= linesVisible/2;
}
else if (currentlineNumberVis > lastVisibleLineVis)
{
linesToScroll = currentlineNumberVis - lastVisibleLineVis;
//use center
linesToScroll += linesVisible/2;
}
pEditView->scroll(0, linesToScroll);
//Make sure the caret is visible, scroll horizontally (this will also fix wrapping problems)
pEditView->execute(SCI_GOTOPOS, posStart);
pEditView->execute(SCI_GOTOPOS, posEnd);
//pEditView->execute(SCI_SETSEL, start, posEnd);
//pEditView->execute(SCI_SETCURRENTPOS, posEnd);
pEditView->execute(SCI_SETANCHOR, posStart);
}
void FindReplaceDlg::addText2Combo(const char * txt2add, HWND hCombo, bool isUTF8) void FindReplaceDlg::addText2Combo(const char * txt2add, HWND hCombo, bool isUTF8)
{ {
if (!hCombo) return; if (!hCombo) return;
@ -326,7 +364,7 @@ bool Finder::notify(SCNotification *notification)
int cmd = getMode()==FILES_IN_DIR?WM_DOOPEN:NPPM_SWITCHTOFILE; int cmd = getMode()==FILES_IN_DIR?WM_DOOPEN:NPPM_SWITCHTOFILE;
::SendMessage(::GetParent(_hParent), cmd, 0, (LPARAM)fInfo._fullPath.c_str()); ::SendMessage(::GetParent(_hParent), cmd, 0, (LPARAM)fInfo._fullPath.c_str());
(*_ppEditView)->execute(SCI_SETSEL, fInfo._start, fInfo._end); Searching::displaySectionCentered(fInfo._start, fInfo._end, *_ppEditView);
// we set the current mark here // we set the current mark here
int nb = (*_ppEditView)->getCurrentLineNumber(); int nb = (*_ppEditView)->getCurrentLineNumber();
@ -621,6 +659,7 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP
if (_currentStatus == FIND_DLG) if (_currentStatus == FIND_DLG)
{ {
(*_ppEditView)->clearIndicator(SCE_UNIVERSAL_FOUND_STYLE); (*_ppEditView)->clearIndicator(SCE_UNIVERSAL_FOUND_STYLE);
(*_ppEditView)->execute(SCI_MARKERDELETEALL, MARK_BOOKMARK);
} }
} }
return TRUE; return TRUE;
@ -858,39 +897,8 @@ bool FindReplaceDlg::processFindNext(const char *txt2find, FindOption *options)
int end = int((*_ppEditView)->execute(SCI_GETTARGETEND)); int end = int((*_ppEditView)->execute(SCI_GETTARGETEND));
// to make sure the found result is visible // to make sure the found result is visible
//When searching up, the beginning of the (possible multiline) result is important, when scrolling down the end Searching::displaySectionCentered(start, end, *_ppEditView, pOptions->_whichDirection == DIR_DOWN);
int testPos = (_options._whichDirection == DIR_DOWN)?end:start;
(*_ppEditView)->execute(SCI_SETCURRENTPOS, testPos);
int currentlineNumberDoc = (int)(*_ppEditView)->execute(SCI_LINEFROMPOSITION, testPos);
int currentlineNumberVis = (int)(*_ppEditView)->execute(SCI_VISIBLEFROMDOCLINE, currentlineNumberDoc);
(*_ppEditView)->execute(SCI_ENSUREVISIBLE, currentlineNumberDoc);
int firstVisibleLineVis = (int)(*_ppEditView)->execute(SCI_GETFIRSTVISIBLELINE);
int linesVisible = (int)(*_ppEditView)->execute(SCI_LINESONSCREEN) - 1; //-1 for the scrollbar
int lastVisibleLineVis = (int)linesVisible + firstVisibleLineVis;
//if out of view vertically, scroll line into (center of) view
int linesToScroll = 0;
if (currentlineNumberVis < firstVisibleLineVis)
{
linesToScroll = currentlineNumberVis - firstVisibleLineVis;
//use center
linesToScroll -= linesVisible/2;
}
else if (currentlineNumberVis > lastVisibleLineVis)
{
linesToScroll = currentlineNumberVis - lastVisibleLineVis;
//use center
linesToScroll += linesVisible/2;
}
(*_ppEditView)->scroll(0, linesToScroll);
//Make sure the caret is visible, scroll horizontally (this will also fix wrapping problems)
(*_ppEditView)->execute(SCI_GOTOPOS, start);
(*_ppEditView)->execute(SCI_GOTOPOS, end);
//(*_ppEditView)->execute(SCI_SETSEL, start, end);
//(*_ppEditView)->execute(SCI_SETCURRENTPOS, end);
(*_ppEditView)->execute(SCI_SETANCHOR, start);
delete [] pText; delete [] pText;
return true; return true;
@ -902,7 +910,7 @@ bool FindReplaceDlg::processFindNext(const char *txt2find, FindOption *options)
// || the text is replaced, and do NOT find the next occurrence // || the text is replaced, and do NOT find the next occurrence
bool FindReplaceDlg::processReplace(const char *txt2find, const char *txt2replace, FindOption *options) bool FindReplaceDlg::processReplace(const char *txt2find, const char *txt2replace, FindOption *options)
{ {
if (!txt2find || !txt2find[0] || !txt2replace || !txt2replace[0]) if (!txt2find || !txt2find[0] || !txt2replace)
return false; return false;
FindOption *pOptions = options?options:&_options; FindOption *pOptions = options?options:&_options;
@ -1010,7 +1018,12 @@ int FindReplaceDlg::processAll(ProcessOperation op, const char *txt2find, const
strcpy(pTextFind, txt2find); strcpy(pTextFind, txt2find);
} }
char *pTextReplace = NULL;//new char[stringSizeReplace + 1]; if (!pTextFind[0]) {
delete [] pTextFind;
return nbReplaced;
}
char *pTextReplace = NULL;
if (op == ProcessReplaceAll) { if (op == ProcessReplaceAll) {
if (!txt2replace) { if (!txt2replace) {
HWND hReplaceCombo = ::GetDlgItem(_hSelf, IDREPLACEWITH); HWND hReplaceCombo = ::GetDlgItem(_hSelf, IDREPLACEWITH);

View File

@ -79,6 +79,8 @@ public:
(option->_isMatchCase ? SCFIND_MATCHCASE : 0) | (option->_isMatchCase ? SCFIND_MATCHCASE : 0) |
(option->_searchType == FindRegex ? SCFIND_REGEXP|SCFIND_POSIX : 0); (option->_searchType == FindRegex ? SCFIND_REGEXP|SCFIND_POSIX : 0);
}; };
static void displaySectionCentered(int posStart, int posEnd, ScintillaEditView * pEditView, bool isDownwards = true);
private: private:
static bool readBase(const char * string, int * value, int base, int size); static bool readBase(const char * string, int * value, int base, int size);
@ -267,13 +269,6 @@ public :
_pFinder->setSearchWord(str2Search.c_str()); _pFinder->setSearchWord(str2Search.c_str());
}; };
/// Sets the direction in which to search.
/// \param dir Direction to search (DIR_UP or DIR_DOWN)
///
void setSearchDirection(bool dir) {
_options._whichDirection = dir;
};
const char * getDir2Search() const {return _directory.c_str();}; const char * getDir2Search() const {return _directory.c_str();};
void getPatterns(vector<string> & patternVect); void getPatterns(vector<string> & patternVect);
@ -303,6 +298,7 @@ public :
const string & getFilters() const {return _filters;}; const string & getFilters() const {return _filters;};
const string & getDirectory() const {return _directory;}; const string & getDirectory() const {return _directory;};
const FindOption & getCurrentOptions() const {return _options;};
protected : protected :
virtual BOOL CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam); virtual BOOL CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);

View File

@ -290,9 +290,6 @@ void ScintillaEditView::setStyle(Style styleToSet)
void ScintillaEditView::setXmlLexer(LangType type) void ScintillaEditView::setXmlLexer(LangType type)
{ {
execute(SCI_SETSTYLEBITS, 7, 0);
if (type == L_XML) if (type == L_XML)
{ {
execute(SCI_SETLEXER, SCLEX_HTML); execute(SCI_SETLEXER, SCLEX_HTML);
@ -644,6 +641,7 @@ void ScintillaEditView::defineDocType(LangType typeDoc)
} }
execute(SCI_STYLECLEARALL); execute(SCI_STYLECLEARALL);
execute(SCI_CLEARDOCUMENTSTYLE);
int iFind = stylers.getStylerIndexByID(SCE_UNIVERSAL_FOUND_STYLE); int iFind = stylers.getStylerIndexByID(SCE_UNIVERSAL_FOUND_STYLE);
if (iFind != -1) if (iFind != -1)
@ -686,8 +684,6 @@ void ScintillaEditView::defineDocType(LangType typeDoc)
execute(SCI_SETCODEPAGE, _codepage); execute(SCI_SETCODEPAGE, _codepage);
} }
execute(SCI_SETSTYLEBITS, 5);
showMargin(_SC_MARGE_FOLDER, isNeededFolderMarge(typeDoc)); showMargin(_SC_MARGE_FOLDER, isNeededFolderMarge(typeDoc));
switch (typeDoc) switch (typeDoc)
{ {
@ -884,6 +880,9 @@ void ScintillaEditView::defineDocType(LangType typeDoc)
execute(SCI_SETTABWIDTH, ((NppParameters::getInstance())->getNppGUI())._tabSize); execute(SCI_SETTABWIDTH, ((NppParameters::getInstance())->getNppGUI())._tabSize);
execute(SCI_SETUSETABS, !((NppParameters::getInstance())->getNppGUI())._tabReplacedBySpace); execute(SCI_SETUSETABS, !((NppParameters::getInstance())->getNppGUI())._tabReplacedBySpace);
int bitsNeeded = execute(SCI_GETSTYLEBITSNEEDED);
execute(SCI_SETSTYLEBITS, bitsNeeded);
execute(SCI_COLOURISE, 0, -1); execute(SCI_COLOURISE, 0, -1);
} }

View File

@ -709,11 +709,13 @@
<WidgetStyle name="Mark colour" styleID="0" fgColor="C00000" bgColor="FFFF00" /> <WidgetStyle name="Mark colour" styleID="0" fgColor="C00000" bgColor="FFFF00" />
<WidgetStyle name="Selected text colour" styleID="0" bgColor="C0C0C0" /> <WidgetStyle name="Selected text colour" styleID="0" bgColor="C0C0C0" />
<WidgetStyle name="Caret colour" styleID="2069" fgColor="8000FF" /> <WidgetStyle name="Caret colour" styleID="2069" fgColor="8000FF" />
<WidgetStyle name="Find Mark Style" styleID="31" fgColor="FFFF00" bgColor="FF0000" fontName="" fontStyle="1" fontSize="" />
<WidgetStyle name="Edge colour" styleID="0" fgColor="80FFFF" /> <WidgetStyle name="Edge colour" styleID="0" fgColor="80FFFF" />
<WidgetStyle name="Line number margin" styleID="33" fgColor="808080" bgColor="E4E4E4" fontName="" fontStyle="0" fontSize="" /> <WidgetStyle name="Line number margin" styleID="33" fgColor="808080" bgColor="E4E4E4" fontName="" fontStyle="0" fontSize="" />
<WidgetStyle name="Fold" styleID="0" fgColor="808080" bgColor="F3F3F3" /> <WidgetStyle name="Fold" styleID="0" fgColor="808080" bgColor="F3F3F3" />
<WidgetStyle name="Fold margin" styleID="0" fgColor="FFFFFF" bgColor="E9E9E9" /> <WidgetStyle name="Fold margin" styleID="0" fgColor="FFFFFF" bgColor="E9E9E9" />
<WidgetStyle name="White space symbol" styleID="0" fgColor="FFB56A" /> <WidgetStyle name="White space symbol" styleID="0" fgColor="FFB56A" />
<WidgetStyle name="Smart HighLighting" styleID="29" bgColor="00FF00" />
<WidgetStyle name="Find Mark Style" styleID="31" bgColor="FF0000" />
<WidgetStyle name="Incremental highlight all" styleID="28" bgColor="0080FF" />
</GlobalStyles> </GlobalStyles>
</NotepadPlus> </NotepadPlus>