From 537e3ad70ea058a416b1193eded54b593936603f Mon Sep 17 00:00:00 2001 From: donho Date: Sat, 3 May 2008 22:08:53 +0000 Subject: [PATCH] [BUG_FIXED] Fix Find in files result display problem (unicode). Fix smart hilite bug that it doesn't work with the word contain the accent(s). git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@196 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/src/Notepad_plus.h | 4 ++-- PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp | 7 +++---- PowerEditor/src/ScitillaComponent/FindReplaceDlg.h | 3 --- PowerEditor/src/stylers.model.xml | 3 --- 4 files changed, 5 insertions(+), 12 deletions(-) diff --git a/PowerEditor/src/Notepad_plus.h b/PowerEditor/src/Notepad_plus.h index cba0be10..9142ff4a 100644 --- a/PowerEditor/src/Notepad_plus.h +++ b/PowerEditor/src/Notepad_plus.h @@ -698,9 +698,9 @@ private: }; bool isWordChar(char ch) const { - if (ch < 0x20) + if ((unsigned char)ch < 0x20) return false; - + switch(ch) { case ' ': diff --git a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp index a38217b1..ba2c89e9 100644 --- a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp @@ -1164,7 +1164,7 @@ int FindReplaceDlg::processAll(ProcessOperation op, const char *txt2find, const _line[nbChar+2] = '\0'; const char *pLine; - if (isUnicode) + if (!isUnicode) { ascii_to_utf8(_line, (nbChar + 3), _uniCharLine); pLine = _uniCharLine; @@ -1173,6 +1173,7 @@ int FindReplaceDlg::processAll(ProcessOperation op, const char *txt2find, const { pLine = _line; } + //printStr(isUnicode?"unicode":"no unicode"); _pFinder->add(FoundInfo(start, end, pLine, fileName, _pFinder->_lineCounter), lineNumber + 1); startPosition = posFind + foundTextLen; @@ -1235,7 +1236,7 @@ int FindReplaceDlg::processAll(ProcessOperation op, const char *txt2find, const delete [] pTextFind; delete [] pTextReplace; return nbReplaced; - break; } + } } @@ -1293,10 +1294,8 @@ void FindReplaceDlg::findAllIn(InWhat op) // overwrite some default settings _pFinder->_scintView.showMargin(ScintillaEditView::_SC_MARGE_SYBOLE, false); - _pFinder->_scintView.setMakerStyle(FOLDER_STYLE_SIMPLE); - //_pFinder->_scintView.execute(SCI_SETZOOM, _pFinder->_scintView.execute(SCI_GETZOOM) - 2); _pFinder->_scintView.display(); _pFinder->display(); } diff --git a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.h b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.h index fa60aa61..fb1f5419 100644 --- a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.h +++ b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.h @@ -274,7 +274,6 @@ public : void getPatterns(vector & patternVect); void launchFindInFilesDlg() { - //::SendMessage(_hSelf, WM_COMMAND, IDC_FINDINFILES, 0); doDialog(FINDINFILES_DLG); }; @@ -406,8 +405,6 @@ private : ReBar * _pRebar; REBARBANDINFO _rbBand; - //HWND _hEditBox, _hSearchPrev, _hSearchNext, _hCheckCase, _hCheckHiLiteAll; - bool _doSearchFromBegin; virtual BOOL CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam); void markSelectedTextInc(bool enable, FindOption *opt = NULL); diff --git a/PowerEditor/src/stylers.model.xml b/PowerEditor/src/stylers.model.xml index 013f9f78..90fae55c 100644 --- a/PowerEditor/src/stylers.model.xml +++ b/PowerEditor/src/stylers.model.xml @@ -2,9 +2,6 @@ -