Project: Notepad++
Revision: 303
Author: donho
Date: 02 Aug 2008 21:14:41
Changes:[RELEASE] Notepad++ v5.0.3.
Fix the display problem in found results dialog while processing find in all opened files/find in files in a file contains a very long line.
Fix not remembering the history file setting "Don't check at launch time" option bug.
Files:modified: /PowerEditor/bin/change.log (
try)
modified: /PowerEditor/src/ScitillaComponent/Buffer.h (
try)
modified: /PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp (
try)
modified: /PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp (
try)
modified: /PowerEditor/installer/nppSetup.nsi (
try)
modified: /PowerEditor/src/resource.h (
try)
modified: /scintilla/src/LexSearchResult.cxx (
try)
modified: /PowerEditor/src/ScitillaComponent/FindReplaceDlg.h (
try)
modified: /PowerEditor/src/ScitillaComponent/Buffer.cpp (
try)
modified: /scintilla/include/Scintilla.h (
try)
modified: /PowerEditor/src/WinControls/Preference/preferenceDlg.cpp (
try)
Diff:
| ... | ...@@ -1,3 +1,11 @@ |
| 1 | Notepad++ v5.0.3 fixed bugs and added features (from v5.0.2) :
|
| 2 |
|
| 3 | 1. Fix crash bug while processing find in all opened files/find in files in a file contains a very long line.
|
| 4 | 2. Fix the display problem in found results dialog while processing find in all opened files/find in files in a file contains a very long line.
|
| 5 | 3. Fix not remembering the history file setting "Don't check at launch time" option bug.
|
| 6 |
|
| 7 |
|
| 8 |
|
| 1 | 9 | Notepad++ v5.0.2 fixed bugs and added features (from v5.0.1) :
|
| 2 | 10 |
|
| 3 | 11 | 1. Fix crash bug for tags match highlighting.
|
| ... | ...@@ -101,8 +101,8 @@ |
| 101 | 101 |
|
| 102 | 102 | int getFileNameFromBuffer(BufferID id, char * fn2copy);
|
| 103 | 103 | private:
|
| 104 | | FileManager();
|
| 105 | | ~FileManager();
|
| 104 | FileManager() : _nextNewNumber(1), _nextBufferID(0), _pNotepadPlus(NULL), _nrBufs(0), _pscratchTilla(NULL){};
|
| 105 | ~FileManager(){};
|
| 106 | 106 | static FileManager *_pSelf;
|
| 107 | 107 |
|
| 108 | 108 | Notepad_plus * _pNotepadPlus;
|
| ... | ...@@ -240,11 +240,6 @@ |
| 240 | 240 | };
|
| 241 | 241 |
|
| 242 | 242 | void setUnicodeMode(UniMode mode) {
|
| 243 | | /*if ((_unicodeMode != mode) &&
|
| 244 | | !((_unicodeMode == uni8Bit) && (mode == uniCookie)) && \
|
| 245 | | !((_unicodeMode == uniCookie) && (mode == uni8Bit))) {
|
| 246 | | //this check excludes switch between Utf8-w/o bom and ANSI. However, that makes a change too
|
| 247 | | }*/
|
| 248 | 243 | _unicodeMode = mode;
|
| 249 | 244 | //_isDirty = true; //set to dirty if change unicode mode
|
| 250 | 245 | doNotify(BufferChangeUnicode | BufferChangeDirty);
|
| ... | ...@@ -1155,9 +1155,9 @@ |
| 1155 | 1155 | case ProcessFindAll:
|
| 1156 | 1156 | {
|
| 1157 | 1157 | int lineNumber = (*_ppEditView)->execute(SCI_LINEFROMPOSITION, targetStart);
|
| 1158 | | //int lend = (*_ppEditView)->execute(SCI_GETLINEENDPOSITION, lineNumber);
|
| 1159 | | //int lstart = (*_ppEditView)->execute(SCI_POSITIONFROMLINE, lineNumber);
|
| 1160 | | int nbChar = (*_ppEditView)->execute(SCI_LINELENGTH, lineNumber);
|
| 1158 | int lend = (*_ppEditView)->execute(SCI_GETLINEENDPOSITION, lineNumber);
|
| 1159 | int lstart = (*_ppEditView)->execute(SCI_POSITIONFROMLINE, lineNumber);
|
| 1160 | int nbChar = lend - lstart;
|
| 1161 | 1161 | bool isRealloc = false;
|
| 1162 | 1162 |
|
| 1163 | 1163 | if (_maxNbCharAllocated < nbChar) //line longer than buffer, resize buffer
|
| ... | ...@@ -1033,11 +1033,11 @@ |
| 1033 | 1033 | }
|
| 1034 | 1034 |
|
| 1035 | 1035 | void ScintillaEditView::restyleBuffer() {
|
| 1036 | | int end = execute(SCI_GETENDSTYLED); //style up to the last styled byte.
|
| 1037 | | if (end == 0)
|
| 1038 | | return;
|
| 1036 | //int end = execute(SCI_GETENDSTYLED); //style up to the last styled byte.
|
| 1037 | //if (end == 0)
|
| 1038 | // return;
|
| 1039 | 1039 | execute(SCI_CLEARDOCUMENTSTYLE);
|
| 1040 | | execute(SCI_COLOURISE, 0, end);
|
| 1040 | execute(SCI_COLOURISE, 0, -1);
|
| 1041 | 1041 | _currentBuffer->setNeedsLexing(false);
|
| 1042 | 1042 | }
|
| 1043 | 1043 |
|
| ... | ...@@ -1122,34 +1122,41 @@ |
| 1122 | 1122 | }
|
| 1123 | 1123 | void ScintillaEditView::bufferUpdated(Buffer * buffer, int mask) {
|
| 1124 | 1124 | //actually only care about language and lexing etc
|
| 1125 | | if (buffer == _currentBuffer) {
|
| 1126 | | if (mask & BufferChangeLanguage) {
|
| 1125 | if (buffer == _currentBuffer)
|
| 1126 | {
|
| 1127 | if (mask & BufferChangeLanguage)
|
| 1128 | {
|
| 1127 | 1129 | defineDocType(buffer->getLangType());
|
| 1128 | 1130 | foldAll(fold_uncollapse);
|
| 1129 | 1131 | }
|
| 1130 | 1132 |
|
| 1131 | | if (mask & BufferChangeLexing) {
|
| 1132 | | if (buffer->getNeedsLexing()) {
|
| 1133 | if (mask & BufferChangeLexing)
|
| 1134 | {
|
| 1135 | if (buffer->getNeedsLexing())
|
| 1136 | {
|
| 1133 | 1137 | restyleBuffer(); //sets to false, this will apply to any other view aswell
|
| 1134 | 1138 | } //else nothing, otherwise infinite loop
|
| 1135 | 1139 | }
|
| 1136 | 1140 |
|
| 1137 | | if (mask & BufferChangeFormat) {
|
| 1141 | if (mask & BufferChangeFormat)
|
| 1142 | {
|
| 1138 | 1143 | execute(SCI_SETEOLMODE, _currentBuffer->getFormat());
|
| 1139 | 1144 | }
|
| 1140 | | if (mask & BufferChangeReadonly) {
|
| 1145 | if (mask & BufferChangeReadonly)
|
| 1146 | {
|
| 1141 | 1147 | execute(SCI_SETREADONLY, _currentBuffer->isReadOnly());
|
| 1142 | 1148 | }
|
| 1143 | | if (mask & BufferChangeUnicode) {
|
| 1144 | | if (_currentBuffer->getUnicodeMode() == uni8Bit) { //either 0 or CJK codepage
|
| 1145 | | if (isCJK()) {
|
| 1149 | if (mask & BufferChangeUnicode)
|
| 1150 | {
|
| 1151 | if (_currentBuffer->getUnicodeMode() == uni8Bit)
|
| 1152 | { //either 0 or CJK codepage
|
| 1153 | if (isCJK())
|
| 1146 | 1154 | execute(SCI_SETCODEPAGE, _codepage); //you may also want to set charsets here, not yet implemented
|
| 1147 | | } else {
|
| 1155 | else
|
| 1148 | 1156 | execute(SCI_SETCODEPAGE, 0);
|
| 1149 | | }
|
| 1150 | | } else { //CP UTF8 for all unicode
|
| 1157 | }
|
| 1158 | else //CP UTF8 for all unicode
|
| 1151 | 1159 | execute(SCI_SETCODEPAGE, SC_CP_UTF8);
|
| 1152 | | }
|
| 1153 | 1160 | }
|
| 1154 | 1161 | }
|
| 1155 | 1162 | }
|
| ... | ...@@ -17,16 +17,16 @@ |
| 17 | 17 |
|
| 18 | 18 | ; Define the application name
|
| 19 | 19 | !define APPNAME "Notepad++"
|
| 20 | | !define APPNAMEANDVERSION "Notepad++ v5.0.2"
|
| 20 | !define APPNAMEANDVERSION "Notepad++ v5.0.3"
|
| 21 | 21 |
|
| 22 | 22 | !define VERSION_MAJOR 5
|
| 23 | | !define VERSION_MINOR 02
|
| 23 | !define VERSION_MINOR 03
|
| 24 | 24 |
|
| 25 | 25 | ; Main Install settings
|
| 26 | 26 | Name "${APPNAMEANDVERSION}"
|
| 27 | 27 | InstallDir "$PROGRAMFILES\Notepad++"
|
| 28 | 28 | InstallDirRegKey HKLM "Software\${APPNAME}" ""
|
| 29 | | OutFile "..\bin\npp.5.0.2.Installer.exe"
|
| 29 | OutFile "..\bin\npp.5.0.3.Installer.exe"
|
| 30 | 30 |
|
| 31 | 31 | ; GetWindowsVersion
|
| 32 | 32 | ;
|
| ... | ...@@ -18,9 +18,9 @@ |
| 18 | 18 | #ifndef RESOURCE_H
|
| 19 | 19 | #define RESOURCE_H
|
| 20 | 20 |
|
| 21 | | #define NOTEPAD_PLUS_VERSION "Notepad++ v5.0.2"
|
| 22 | | #define VERSION_VALUE "5.02\0" // should be X.Y : ie. if VERSION_DIGITALVALUE == 4, 7, 1, 0 , then X = 4, Y = 71
|
| 23 | | #define VERSION_DIGITALVALUE 5, 0, 2, 0
|
| 21 | #define NOTEPAD_PLUS_VERSION "Notepad++ v5.0.3"
|
| 22 | #define VERSION_VALUE "5.03\0" // should be X.Y : ie. if VERSION_DIGITALVALUE == 4, 7, 1, 0 , then X = 4, Y = 71
|
| 23 | #define VERSION_DIGITALVALUE 5, 0, 3, 0
|
| 24 | 24 |
|
| 25 | 25 | #ifndef IDC_STATIC
|
| 26 | 26 | #define IDC_STATIC -1
|
| ... | ...@@ -42,10 +42,6 @@ |
| 42 | 42 | 0
|
| 43 | 43 | };
|
| 44 | 44 |
|
| 45 | | static inline bool isAWordChar(const int ch) {
|
| 46 | | return ((ch > 0x20) && (ch <= 0xFF) && (ch != ' ') && (ch != '\n'));
|
| 47 | | }
|
| 48 | |
|
| 49 | 45 | inline bool isSpaceChar(char ch) {
|
| 50 | 46 | return ((ch == ' ') || (ch == ' '));
|
| 51 | 47 | };
|
| ... | ...@@ -160,7 +156,7 @@ |
| 160 | 156 | }
|
| 161 | 157 |
|
| 162 | 158 | static void ColouriseSearchResultDoc(unsigned int startPos, int length, int, WordList *keywordlists[], Accessor &styler) {
|
| 163 | | char lineBuffer[1024];
|
| 159 | char lineBuffer[SC_SEARCHRESULT_LINEBUFFERMAXLENGTH];
|
| 164 | 160 | styler.StartAt(startPos);
|
| 165 | 161 | styler.StartSegment(startPos);
|
| 166 | 162 | unsigned int linePos = 0;
|
| ... | ...@@ -201,7 +197,7 @@ |
| 201 | 197 |
|
| 202 | 198 | int style = styleNext;
|
| 203 | 199 | styleNext = styler.StyleAt(i + 1);
|
| 204 | | bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
|
| 200 | bool atEOL = (ch == '\n') || (ch == '\r' && chNext != '\n');
|
| 205 | 201 |
|
| 206 | 202 | if (style == SCE_SEARCHRESULT_HEARDER)
|
| 207 | 203 | {
|
| ... | ...@@ -119,6 +119,13 @@ |
| 119 | 119 | str += itoa(lineNb, lnb, 10);
|
| 120 | 120 | str += " : ";
|
| 121 | 121 | str += fi._foundLine;
|
| 122 |
|
| 123 | if (str.length() >= SC_SEARCHRESULT_LINEBUFFERMAXLENGTH)
|
| 124 | {
|
| 125 | const char * endOfLongLine = "...\r\n";
|
| 126 | str = str.substr(0, SC_SEARCHRESULT_LINEBUFFERMAXLENGTH - strlen(endOfLongLine) - 1);
|
| 127 | str += endOfLongLine;
|
| 128 | }
|
| 122 | 129 | setFinderReadOnly(false);
|
| 123 | 130 | _scintView.execute(SCI_APPENDTEXT, str.length(), (LPARAM)str.c_str());
|
| 124 | 131 | setFinderReadOnly(true);
|
| ... | ...@@ -324,10 +324,7 @@ |
| 324 | 324 | }
|
| 325 | 325 |
|
| 326 | 326 | //filemanager
|
| 327 | | FileManager::FileManager() :
|
| 328 | | _nextNewNumber(1), _nextBufferID(0), _pNotepadPlus(NULL), _nrBufs(0), _pscratchTilla(NULL)
|
| 329 | | {
|
| 330 | | }
|
| 327 |
|
| 331 | 328 |
|
| 332 | 329 | void FileManager::init(Notepad_plus * pNotepadPlus, ScintillaEditView * pscratchTilla)
|
| 333 | 330 | {
|
| ... | ...@@ -338,10 +335,7 @@ |
| 338 | 335 | _pscratchTilla->execute(SCI_ADDREFDOCUMENT, 0, _scratchDocDefault);
|
| 339 | 336 | }
|
| 340 | 337 |
|
| 341 | | FileManager::~FileManager() {
|
| 342 | | //Release automatic with Scintilla destructor
|
| 343 | | //_pscratchTilla->execute(SCI_RELEASEDOCUMENT, 0, _scratchDocDefault);
|
| 344 | | }
|
| 338 |
|
| 345 | 339 |
|
| 346 | 340 | void FileManager::checkFilesystemChanges() {
|
| 347 | 341 | for(size_t i = 0; i < _nrBufs; i++) {
|
| ... | ...@@ -377,8 +371,7 @@ |
| 377 | 371 |
|
| 378 | 372 | int oldRefs = buf->_references;
|
| 379 | 373 | int refs = buf->removeReference(identifier);
|
| 380 | | //if (oldRefs != refs)
|
| 381 | | // _pscratchTilla->execute(SCI_RELEASEDOCUMENT, 0, buf->_doc); //we can release the document for the reference of container (it has changed so it was a valid operation)
|
| 374 |
|
| 382 | 375 | if (!refs) { //buffer can be deallocated
|
| 383 | 376 | _pscratchTilla->execute(SCI_RELEASEDOCUMENT, 0, buf->_doc); //release for FileManager, Document is now gone
|
| 384 | 377 | _buffers.erase(_buffers.begin() + index);
|
| ... | ...@@ -703,6 +703,7 @@ |
| 703 | 703 | #define SC_MOD_CHANGEINDICATOR 0x4000
|
| 704 | 704 | #define SC_MOD_CHANGELINESTATE 0x8000
|
| 705 | 705 | #define SC_MODEVENTMASKALL 0xFFFF
|
| 706 | #define SC_SEARCHRESULT_LINEBUFFERMAXLENGTH 1024
|
| 706 | 707 | #define SCEN_CHANGE 768
|
| 707 | 708 | #define SCEN_SETFOCUS 512
|
| 708 | 709 | #define SCEN_KILLFOCUS 256
|
| ... | ...@@ -601,8 +601,7 @@ |
| 601 | 601 | switch (wParam)
|
| 602 | 602 | {
|
| 603 | 603 | case IDC_CHECK_DONTCHECKHISTORY:
|
| 604 | | nppGUI._checkHistoryFiles = isCheckedOrNot(IDC_CHECK_DONTCHECKHISTORY);
|
| 605 | | //::SendMessage(_hParent, WM_COMMAND, IDM_SETTING_HISTORY_DONT_CHECK, 0);
|
| 604 | nppGUI._checkHistoryFiles = !isCheckedOrNot(IDC_CHECK_DONTCHECKHISTORY);
|
| 606 | 605 | return TRUE;
|
| 607 | 606 |
|
| 608 | 607 | case IDC_CHECK_FILEAUTODETECTION:
|
| ... | ...@@ -617,7 +616,6 @@ |
| 617 | 616 | ::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_UPDATEGOTOEOF), isChecked);
|
| 618 | 617 |
|
| 619 | 618 | nppGUI._fileAutoDetection = isChecked?cdAutoUpdate:cdDisabled;
|
| 620 | | //::SendMessage(_hParent, WM_COMMAND, isChecked?IDM_SETTING_FILE_AUTODETECTION_ENABLE:IDM_SETTING_FILE_AUTODETECTION_DISABLE, 0);
|
| 621 | 619 | }
|
| 622 | 620 | return TRUE;
|
| 623 | 621 |
|
To list