[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.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@303 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
donho 2008-08-03 01:14:41 +00:00
parent e6247761d0
commit 04f43d8563
11 changed files with 57 additions and 52 deletions

View File

@ -1,3 +1,11 @@
Notepad++ v5.0.3 fixed bugs and added features (from v5.0.2) :
1. Fix crash bug while processing find in all opened files/find in files in a file contains a very long line.
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.
3. Fix not remembering the history file setting "Don't check at launch time" option bug.
Notepad++ v5.0.2 fixed bugs and added features (from v5.0.1) :
1. Fix crash bug for tags match highlighting.

View File

@ -17,16 +17,16 @@
; Define the application name
!define APPNAME "Notepad++"
!define APPNAMEANDVERSION "Notepad++ v5.0.2"
!define APPNAMEANDVERSION "Notepad++ v5.0.3"
!define VERSION_MAJOR 5
!define VERSION_MINOR 02
!define VERSION_MINOR 03
; Main Install settings
Name "${APPNAMEANDVERSION}"
InstallDir "$PROGRAMFILES\Notepad++"
InstallDirRegKey HKLM "Software\${APPNAME}" ""
OutFile "..\bin\npp.5.0.2.Installer.exe"
OutFile "..\bin\npp.5.0.3.Installer.exe"
; GetWindowsVersion
;

View File

@ -324,10 +324,7 @@ void Buffer::setDeferredReload() { //triggers a reload on the next Document acce
}
//filemanager
FileManager::FileManager() :
_nextNewNumber(1), _nextBufferID(0), _pNotepadPlus(NULL), _nrBufs(0), _pscratchTilla(NULL)
{
}
void FileManager::init(Notepad_plus * pNotepadPlus, ScintillaEditView * pscratchTilla)
{
@ -338,10 +335,7 @@ void FileManager::init(Notepad_plus * pNotepadPlus, ScintillaEditView * pscratch
_pscratchTilla->execute(SCI_ADDREFDOCUMENT, 0, _scratchDocDefault);
}
FileManager::~FileManager() {
//Release automatic with Scintilla destructor
//_pscratchTilla->execute(SCI_RELEASEDOCUMENT, 0, _scratchDocDefault);
}
void FileManager::checkFilesystemChanges() {
for(size_t i = 0; i < _nrBufs; i++) {
@ -377,8 +371,7 @@ void FileManager::closeBuffer(BufferID id, ScintillaEditView * identifier) {
int oldRefs = buf->_references;
int refs = buf->removeReference(identifier);
//if (oldRefs != refs)
// _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)
if (!refs) { //buffer can be deallocated
_pscratchTilla->execute(SCI_RELEASEDOCUMENT, 0, buf->_doc); //release for FileManager, Document is now gone
_buffers.erase(_buffers.begin() + index);

View File

@ -101,8 +101,8 @@ public:
int getFileNameFromBuffer(BufferID id, char * fn2copy);
private:
FileManager();
~FileManager();
FileManager() : _nextNewNumber(1), _nextBufferID(0), _pNotepadPlus(NULL), _nrBufs(0), _pscratchTilla(NULL){};
~FileManager(){};
static FileManager *_pSelf;
Notepad_plus * _pNotepadPlus;
@ -240,11 +240,6 @@ public :
};
void setUnicodeMode(UniMode mode) {
/*if ((_unicodeMode != mode) &&
!((_unicodeMode == uni8Bit) && (mode == uniCookie)) && \
!((_unicodeMode == uniCookie) && (mode == uni8Bit))) {
//this check excludes switch between Utf8-w/o bom and ANSI. However, that makes a change too
}*/
_unicodeMode = mode;
//_isDirty = true; //set to dirty if change unicode mode
doNotify(BufferChangeUnicode | BufferChangeDirty);

View File

@ -1155,9 +1155,9 @@ int FindReplaceDlg::processRange(ProcessOperation op, const char *txt2find, cons
case ProcessFindAll:
{
int lineNumber = (*_ppEditView)->execute(SCI_LINEFROMPOSITION, targetStart);
//int lend = (*_ppEditView)->execute(SCI_GETLINEENDPOSITION, lineNumber);
//int lstart = (*_ppEditView)->execute(SCI_POSITIONFROMLINE, lineNumber);
int nbChar = (*_ppEditView)->execute(SCI_LINELENGTH, lineNumber);
int lend = (*_ppEditView)->execute(SCI_GETLINEENDPOSITION, lineNumber);
int lstart = (*_ppEditView)->execute(SCI_POSITIONFROMLINE, lineNumber);
int nbChar = lend - lstart;
bool isRealloc = false;
if (_maxNbCharAllocated < nbChar) //line longer than buffer, resize buffer

View File

@ -119,6 +119,13 @@ public:
str += itoa(lineNb, lnb, 10);
str += " : ";
str += fi._foundLine;
if (str.length() >= SC_SEARCHRESULT_LINEBUFFERMAXLENGTH)
{
const char * endOfLongLine = "...\r\n";
str = str.substr(0, SC_SEARCHRESULT_LINEBUFFERMAXLENGTH - strlen(endOfLongLine) - 1);
str += endOfLongLine;
}
setFinderReadOnly(false);
_scintView.execute(SCI_APPENDTEXT, str.length(), (LPARAM)str.c_str());
setFinderReadOnly(true);

View File

@ -1033,11 +1033,11 @@ void ScintillaEditView::restoreCurrentPos()
}
void ScintillaEditView::restyleBuffer() {
int end = execute(SCI_GETENDSTYLED); //style up to the last styled byte.
if (end == 0)
return;
//int end = execute(SCI_GETENDSTYLED); //style up to the last styled byte.
//if (end == 0)
// return;
execute(SCI_CLEARDOCUMENTSTYLE);
execute(SCI_COLOURISE, 0, end);
execute(SCI_COLOURISE, 0, -1);
_currentBuffer->setNeedsLexing(false);
}
@ -1122,36 +1122,43 @@ void ScintillaEditView::activateBuffer(BufferID buffer)
}
void ScintillaEditView::bufferUpdated(Buffer * buffer, int mask) {
//actually only care about language and lexing etc
if (buffer == _currentBuffer) {
if (mask & BufferChangeLanguage) {
if (buffer == _currentBuffer)
{
if (mask & BufferChangeLanguage)
{
defineDocType(buffer->getLangType());
foldAll(fold_uncollapse);
}
if (mask & BufferChangeLexing) {
if (buffer->getNeedsLexing()) {
if (mask & BufferChangeLexing)
{
if (buffer->getNeedsLexing())
{
restyleBuffer(); //sets to false, this will apply to any other view aswell
} //else nothing, otherwise infinite loop
}
if (mask & BufferChangeFormat) {
if (mask & BufferChangeFormat)
{
execute(SCI_SETEOLMODE, _currentBuffer->getFormat());
}
if (mask & BufferChangeReadonly) {
if (mask & BufferChangeReadonly)
{
execute(SCI_SETREADONLY, _currentBuffer->isReadOnly());
}
if (mask & BufferChangeUnicode) {
if (_currentBuffer->getUnicodeMode() == uni8Bit) { //either 0 or CJK codepage
if (isCJK()) {
if (mask & BufferChangeUnicode)
{
if (_currentBuffer->getUnicodeMode() == uni8Bit)
{ //either 0 or CJK codepage
if (isCJK())
execute(SCI_SETCODEPAGE, _codepage); //you may also want to set charsets here, not yet implemented
} else {
else
execute(SCI_SETCODEPAGE, 0);
}
} else { //CP UTF8 for all unicode
else //CP UTF8 for all unicode
execute(SCI_SETCODEPAGE, SC_CP_UTF8);
}
}
}
}
void ScintillaEditView::collapse(int level2Collapse, bool mode)

View File

@ -601,8 +601,7 @@ BOOL CALLBACK SettingsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPara
switch (wParam)
{
case IDC_CHECK_DONTCHECKHISTORY:
nppGUI._checkHistoryFiles = isCheckedOrNot(IDC_CHECK_DONTCHECKHISTORY);
//::SendMessage(_hParent, WM_COMMAND, IDM_SETTING_HISTORY_DONT_CHECK, 0);
nppGUI._checkHistoryFiles = !isCheckedOrNot(IDC_CHECK_DONTCHECKHISTORY);
return TRUE;
case IDC_CHECK_FILEAUTODETECTION:
@ -617,7 +616,6 @@ BOOL CALLBACK SettingsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPara
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_UPDATEGOTOEOF), isChecked);
nppGUI._fileAutoDetection = isChecked?cdAutoUpdate:cdDisabled;
//::SendMessage(_hParent, WM_COMMAND, isChecked?IDM_SETTING_FILE_AUTODETECTION_ENABLE:IDM_SETTING_FILE_AUTODETECTION_DISABLE, 0);
}
return TRUE;

View File

@ -18,9 +18,9 @@
#ifndef RESOURCE_H
#define RESOURCE_H
#define NOTEPAD_PLUS_VERSION "Notepad++ v5.0.2"
#define VERSION_VALUE "5.02\0" // should be X.Y : ie. if VERSION_DIGITALVALUE == 4, 7, 1, 0 , then X = 4, Y = 71
#define VERSION_DIGITALVALUE 5, 0, 2, 0
#define NOTEPAD_PLUS_VERSION "Notepad++ v5.0.3"
#define VERSION_VALUE "5.03\0" // should be X.Y : ie. if VERSION_DIGITALVALUE == 4, 7, 1, 0 , then X = 4, Y = 71
#define VERSION_DIGITALVALUE 5, 0, 3, 0
#ifndef IDC_STATIC
#define IDC_STATIC -1

View File

@ -703,6 +703,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SC_MOD_CHANGEINDICATOR 0x4000
#define SC_MOD_CHANGELINESTATE 0x8000
#define SC_MODEVENTMASKALL 0xFFFF
#define SC_SEARCHRESULT_LINEBUFFERMAXLENGTH 1024
#define SCEN_CHANGE 768
#define SCEN_SETFOCUS 512
#define SCEN_KILLFOCUS 256

View File

@ -42,10 +42,6 @@ static const char * const emptyWordListDesc[] = {
0
};
static inline bool isAWordChar(const int ch) {
return ((ch > 0x20) && (ch <= 0xFF) && (ch != ' ') && (ch != '\n'));
}
inline bool isSpaceChar(char ch) {
return ((ch == ' ') || (ch == ' '));
};
@ -160,7 +156,7 @@ end :
}
static void ColouriseSearchResultDoc(unsigned int startPos, int length, int, WordList *keywordlists[], Accessor &styler) {
char lineBuffer[1024];
char lineBuffer[SC_SEARCHRESULT_LINEBUFFERMAXLENGTH];
styler.StartAt(startPos);
styler.StartSegment(startPos);
unsigned int linePos = 0;
@ -201,7 +197,7 @@ static void FoldSearchResultDoc(unsigned int startPos, int length, int, WordList
int style = styleNext;
styleNext = styler.StyleAt(i + 1);
bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
bool atEOL = (ch == '\n') || (ch == '\r' && chNext != '\n');
if (style == SCE_SEARCHRESULT_HEARDER)
{