From c6a0498215d2257f70f2ecdb45a9d44f84e725d6 Mon Sep 17 00:00:00 2001 From: donho Date: Sun, 15 Mar 2009 01:12:10 +0000 Subject: [PATCH] [BUG_FIXED] Fix the Find in files performance issue due to change line marker. Make the default colours for the global styles. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@437 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/installer/nppSetup.nsi | 31 +++++--- PowerEditor/src/Notepad_plus.cpp | 3 +- .../ScitillaComponent/ScintillaEditView.cpp | 72 +++++++++++++------ .../src/ScitillaComponent/ScintillaEditView.h | 5 +- PowerEditor/src/ScitillaComponent/colors.h | 2 + PowerEditor/src/stylers.model.xml | 2 + PowerEditor/src/xpm_icons.h | 3 +- scintilla/include/SciLexer.h | 2 +- 8 files changed, 86 insertions(+), 34 deletions(-) diff --git a/PowerEditor/installer/nppSetup.nsi b/PowerEditor/installer/nppSetup.nsi index ac5fb087c..5ddb0e1a9 100644 --- a/PowerEditor/installer/nppSetup.nsi +++ b/PowerEditor/installer/nppSetup.nsi @@ -17,18 +17,18 @@ ; Define the application name !define APPNAME "Notepad++" -!define APPVERSION "5.2" -!define APPNAMEANDVERSION "Notepad++ v5.2" +!define APPVERSION "5.3" +!define APPNAMEANDVERSION "Notepad++ v5.3" !define APPWEBSITE "http://notepad-plus.sourceforge.net/" !define VERSION_MAJOR 5 -!define VERSION_MINOR 2 +!define VERSION_MINOR 3 ; Main Install settings Name "${APPNAMEANDVERSION}" InstallDir "$PROGRAMFILES\Notepad++" InstallDirRegKey HKLM "Software\${APPNAME}" "" -OutFile "..\bin\npp.5.2.Installer.exe" +OutFile "..\bin\npp.5.3.Installer.exe" ; GetWindowsVersion ; @@ -430,6 +430,11 @@ GLOBAL_INST: IfFileExists "$INSTDIR\plugins\NppAutoIndent.dll" 0 +3 MessageBox MB_OK "Due to the stabilty issue,$\nNppAutoIndent.dll is about to be deleted.$\nYou can download it via menu $\"?->Get more plugins$\" if you really need it." Delete "$INSTDIR\plugins\NppAutoIndent.dll" + + IfFileExists "$INSTDIR\plugins\ComparePlugin.dll" 0 +3 + MessageBox MB_OK "Due to the problem of compability with this version,$\nComparePlugin.dll is about to be deleted.$\nYou can download it via menu $\"?->Get more plugins$\" if you really need it." + Delete "$INSTDIR\plugins\ComparePlugin.dll" + ; detect the right of UserInfo::GetAccountType Pop $1 @@ -556,7 +561,11 @@ SubSection "Auto-completion Files" autoCompletionComponent SetOutPath "$INSTDIR\plugins\APIs" File "..\bin\plugins\APIs\nsis.xml" SectionEnd - + + Section AWK + SetOutPath "$INSTDIR\plugins\APIs" + File "..\bin\plugins\APIs\awk.xml" + SectionEnd SubSectionEnd SubSection "Plugins" Plugins @@ -622,14 +631,14 @@ SubSection "Plugins" Plugins SetOutPath "$INSTDIR\plugins" File "..\bin\plugins\NppExport.dll" SectionEnd - +/* Section "ComparePlugin" ComparePlugin Delete "$INSTDIR\plugins\ComparePlugin.dll" SetOutPath "$INSTDIR\plugins" File "..\bin\plugins\ComparePlugin.dll" SectionEnd -/* + Section "NppAutoIndent" NppAutoIndent Delete "$INSTDIR\plugins\NppAutoIndent.dll" SetOutPath "$INSTDIR\plugins" @@ -797,7 +806,13 @@ SubSection un.autoCompletionComponent Section un.NSIS Delete "$INSTDIR\plugins\APIs\nsis.xml" RMDir "$INSTDIR\plugins\APIs\" - SectionEnd + SectionEnd + + Section un.AWK + Delete "$INSTDIR\plugins\APIs\awk.xml" + RMDir "$INSTDIR\plugins\APIs\" + SectionEnd + SubSectionEnd SubSection un.Plugins diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 0af4bdc6b..0d60a3b43 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -2033,7 +2033,6 @@ BOOL Notepad_plus::notify(SCNotification *notification) TBHDR * tabNotification = (TBHDR*) notification; switch (notification->nmhdr.code) { - case SCN_MODIFIED: { static bool prevWasEdit = false; @@ -2058,7 +2057,7 @@ BOOL Notepad_plus::notify(SCNotification *notification) prevWasEdit = false; } - if (!_isFileOpening /*&& _pEditView->hasMarginShowed(ScintillaEditView::_SC_MARGE_MODIFMARKER)*/) + if (!_isFileOpening && (isFromPrimary || isFromSecondary)) { bool isProcessed = false; diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp index 9ded4dbea..deb22e0be 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp @@ -161,9 +161,8 @@ void ScintillaEditView::init(HINSTANCE hInst, HWND hPere) execute(SCI_SETMARGINTYPEN, _SC_MARGE_MODIFMARKER, SC_MARGIN_BACK); showMargin(_SC_MARGE_MODIFMARKER, true); - execute(SCI_MARKERSETFORE, MARK_LINEMODIFIEDUNSAVED, (LPARAM)red); - execute(SCI_MARKERDEFINEPIXMAP, MARK_LINEMODIFIEDUNSAVED, (LPARAM)modifUnsaved_xpm); - execute(SCI_MARKERDEFINEPIXMAP, MARK_LINEMODIFIEDSAVED, (LPARAM)modifSaved_xpm); + execute(SCI_MARKERDEFINE, MARK_LINEMODIFIEDSAVED, SCI_MARKERDEFINE); + execute(SCI_MARKERDEFINE, MARK_LINEMODIFIEDUNSAVED, SCI_MARKERDEFINE); execute(SCI_MARKERSETALPHA, MARK_BOOKMARK, 70); execute(SCI_MARKERDEFINEPIXMAP, MARK_BOOKMARK, (LPARAM)bookmark_xpm); @@ -361,11 +360,6 @@ LRESULT ScintillaEditView::scintillaNew_Proc(HWND hwnd, UINT Message, WPARAM wPa return _callWindowProc(_scintillaDefaultProc, hwnd, Message, wParam, lParam); } -void ScintillaEditView::setSpecialIndicator(Style & styleToSet) -{ - execute(SCI_INDICSETFORE, styleToSet._styleID, styleToSet._bgColor); -} - void ScintillaEditView::setSpecialStyle(Style & styleToSet) { @@ -927,48 +921,66 @@ void ScintillaEditView::defineDocType(LangType typeDoc) execute(SCI_STYLECLEARALL); int oldBits = execute(SCI_GETSTYLEBITSNEEDED); + Style *pStyle; + Style defaultIndicatorStyle; + + defaultIndicatorStyle._styleID = SCE_UNIVERSAL_FOUND_STYLE; + defaultIndicatorStyle._bgColor = red; + pStyle = &defaultIndicatorStyle; int iFind = stylers.getStylerIndexByID(SCE_UNIVERSAL_FOUND_STYLE); if (iFind != -1) { - Style & styleFind = stylers.getStyler(iFind); - setSpecialIndicator(styleFind); + pStyle = &(stylers.getStyler(iFind)); } + setSpecialIndicator(*pStyle); + defaultIndicatorStyle._styleID = SCE_UNIVERSAL_FOUND_STYLE_2; + defaultIndicatorStyle._bgColor = liteGreen; + pStyle = &defaultIndicatorStyle; iFind = stylers.getStylerIndexByID(SCE_UNIVERSAL_FOUND_STYLE_2); if (iFind != -1) { - Style & styleFind = stylers.getStyler(iFind); - setSpecialIndicator(styleFind); + pStyle = &(stylers.getStyler(iFind)); } + setSpecialIndicator(*pStyle); + defaultIndicatorStyle._styleID = SCE_UNIVERSAL_FOUND_STYLE_INC; + defaultIndicatorStyle._bgColor = blue; + pStyle = &defaultIndicatorStyle; iFind = stylers.getStylerIndexByID(SCE_UNIVERSAL_FOUND_STYLE_INC); if (iFind != -1) { - Style & styleFind = stylers.getStyler(iFind); - setSpecialIndicator(styleFind); + pStyle = &(stylers.getStyler(iFind)); } + setSpecialIndicator(*pStyle); + defaultIndicatorStyle._styleID = SCE_UNIVERSAL_TAGMATCH; + defaultIndicatorStyle._bgColor = RGB(0x00, 0x80, 0xFF); + pStyle = &defaultIndicatorStyle; iFind = stylers.getStylerIndexByID(SCE_UNIVERSAL_TAGMATCH); if (iFind != -1) { - Style & styleFind = stylers.getStyler(iFind); - setSpecialIndicator(styleFind); + pStyle = &(stylers.getStyler(iFind)); } + setSpecialIndicator(*pStyle); + defaultIndicatorStyle._styleID = SCE_UNIVERSAL_TAGATTR; + defaultIndicatorStyle._bgColor = yellow; + pStyle = &defaultIndicatorStyle; iFind = stylers.getStylerIndexByID(SCE_UNIVERSAL_TAGATTR); if (iFind != -1) { - Style & styleFind = stylers.getStyler(iFind); - setSpecialIndicator(styleFind); + pStyle = &(stylers.getStyler(iFind)); } - + setSpecialIndicator(*pStyle); +/* iFind = stylers.getStylerIndexByID(SCE_UNIVERSAL_SELECT_STYLE); if (iFind != -1) { Style & styleFind = stylers.getStyler(iFind); setSpecialStyle(styleFind); } - +*/ int caretWidth = 1; @@ -1777,8 +1789,8 @@ void ScintillaEditView::performGlobalStyles() { Style & style = stylers.getStyler(i); selectColorBack = style._bgColor; - execute(SCI_SETSELBACK, 1, selectColorBack); } + execute(SCI_SETSELBACK, 1, selectColorBack); COLORREF caretColor = black; i = stylers.getStylerIndexByID(SCI_SETCARETFORE); @@ -1823,6 +1835,24 @@ void ScintillaEditView::performGlobalStyles() for (int j = 0 ; j < NB_FOLDER_STATE ; j++) defineMarker(_markersArray[FOLDER_TYPE][j], _markersArray[_folderStyle][j], foldfgColor, foldbgColor); + COLORREF unsavedChangebgColor = liteRed; + i = stylers.getStylerIndexByName(TEXT("Unsaved change marker")); + if (i != -1) + { + Style & style = stylers.getStyler(i); + unsavedChangebgColor = style._bgColor; + } + execute(SCI_MARKERSETBACK, MARK_LINEMODIFIEDUNSAVED, unsavedChangebgColor); + + COLORREF savedChangebgColor = liteBlueGreen; + i = stylers.getStylerIndexByName(TEXT("Saved change marker")); + if (i != -1) + { + Style & style = stylers.getStyler(i); + savedChangebgColor = style._bgColor; + } + execute(SCI_MARKERSETBACK, MARK_LINEMODIFIEDSAVED, savedChangebgColor); + COLORREF wsSymbolFgColor = black; i = stylers.getStylerIndexByName(TEXT("White space symbol")); if (i != -1) diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.h b/PowerEditor/src/ScitillaComponent/ScintillaEditView.h index 8a88d95c6..19cd108ec 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.h +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.h @@ -592,7 +592,10 @@ protected: inline void makeStyle(LangType langType, const TCHAR **keywordArray = NULL); void setStyle(Style styleToSet); //NOT by reference (style edited) void setSpecialStyle(Style & styleToSet); //by reference - void setSpecialIndicator(Style & styleToSet); + void setSpecialIndicator(Style & styleToSet) { + execute(SCI_INDICSETFORE, styleToSet._styleID, styleToSet._bgColor); + }; + //Complex lexers (same lexer, different language) void setXmlLexer(LangType type); void setCppLexer(LangType type); diff --git a/PowerEditor/src/ScitillaComponent/colors.h b/PowerEditor/src/ScitillaComponent/colors.h index bb33d8638..158c6dff8 100644 --- a/PowerEditor/src/ScitillaComponent/colors.h +++ b/PowerEditor/src/ScitillaComponent/colors.h @@ -26,6 +26,8 @@ const COLORREF offWhite = RGB(0xFF, 0xFB, 0xF0); const COLORREF darkGreen = RGB(0, 0x80, 0); const COLORREF liteGreen = RGB(0, 0xFF, 0); const COLORREF blueGreen = RGB(0, 0x80, 0x80); +const COLORREF liteRed = RGB(0xFF, 0xAA, 0xAA); +const COLORREF liteBlueGreen = RGB(0xAA, 0xFF, 0xC8); const COLORREF liteBlue = RGB(0xA6, 0xCA, 0xF0); const COLORREF veryLiteBlue = RGB(0xC4, 0xF9, 0xFD); diff --git a/PowerEditor/src/stylers.model.xml b/PowerEditor/src/stylers.model.xml index 1f71fe4be..7723d671a 100644 --- a/PowerEditor/src/stylers.model.xml +++ b/PowerEditor/src/stylers.model.xml @@ -721,5 +721,7 @@ + + diff --git a/PowerEditor/src/xpm_icons.h b/PowerEditor/src/xpm_icons.h index 766ea3932..f9a8352b3 100644 --- a/PowerEditor/src/xpm_icons.h +++ b/PowerEditor/src/xpm_icons.h @@ -238,7 +238,7 @@ static char * bookmark_xpm[] = { " r*@s(tut(s@*r ", " v*w{x&x{w*v ", " l*yyy*l "}; - +/* static char * modifUnsaved_xpm[] = { "6 18 2 1", "z c #FF8000", @@ -284,3 +284,4 @@ static char * modifSaved_xpm[] = { "ozozoz", "zozozo", "ozozoz"}; +*/ \ No newline at end of file diff --git a/scintilla/include/SciLexer.h b/scintilla/include/SciLexer.h index c657c3e43..a11de8332 100644 --- a/scintilla/include/SciLexer.h +++ b/scintilla/include/SciLexer.h @@ -107,7 +107,7 @@ #define SCLEX_AUTOMATIC 1000 //For All lexer -#define SCE_UNIVERSAL_SELECT_STYLE 30 +//#define SCE_UNIVERSAL_SELECT_STYLE 30 #define SCE_UNIVERSAL_FOUND_STYLE 31 #define SCE_UNIVERSAL_FOUND_STYLE_2 29 #define SCE_UNIVERSAL_FOUND_STYLE_INC 28