[BUG_FIXED] Fix find/replace bug while doc mapper is opened.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@889 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
Don Ho 2012-04-04 19:50:19 +00:00
parent 8c27c2a20d
commit 88ea280978
3 changed files with 22 additions and 15 deletions

View File

@ -2923,7 +2923,7 @@ void Notepad_plus::docGotoAnotherEditView(FileTransferMode mode)
_pEditView->saveCurrentPos(); //allow copying of position _pEditView->saveCurrentPos(); //allow copying of position
buf->setPosition(buf->getPosition(_pEditView), _pNonEditView); buf->setPosition(buf->getPosition(_pEditView), _pNonEditView);
_pNonEditView->restoreCurrentPos(); //set position _pNonEditView->restoreCurrentPos(); //set position
activateBuffer(current, otherView()); activateBuffer(current, viewToGo);
} }
//Open the view if it was hidden //Open the view if it was hidden
@ -4294,6 +4294,7 @@ void Notepad_plus::notifyBufferActivated(BufferID bufid, int view)
if (_pDocMap) if (_pDocMap)
{ {
_pDocMap->reloadMap(); _pDocMap->reloadMap();
_pDocMap->setSyntaxLiliting();
} }
_linkTriggered = true; _linkTriggered = true;

View File

@ -36,10 +36,6 @@ void DocumentMap::reloadMap()
Buffer *editBuf = (*_ppEditView)->getCurrentBuffer(); Buffer *editBuf = (*_ppEditView)->getCurrentBuffer();
_pScintillaEditView->setCurrentBuffer(editBuf); _pScintillaEditView->setCurrentBuffer(editBuf);
// lexer
_pScintillaEditView->defineDocType(editBuf->getLangType());
_pScintillaEditView->showMargin(ScintillaEditView::_SC_MARGE_FOLDER, false);
// folding // folding
_pScintillaEditView->syncFoldStateWith((*_ppEditView)->getCurrentFoldStates()); _pScintillaEditView->syncFoldStateWith((*_ppEditView)->getCurrentFoldStates());
@ -54,6 +50,12 @@ void DocumentMap::reloadMap()
} }
} }
void DocumentMap::setSyntaxLiliting()
{
Buffer *buf = _pScintillaEditView->getCurrentBuffer();
_pScintillaEditView->defineDocType(buf->getLangType());
_pScintillaEditView->showMargin(ScintillaEditView::_SC_MARGE_FOLDER, false);
}
bool DocumentMap::needToRecomputeWith() bool DocumentMap::needToRecomputeWith()
{ {
@ -244,23 +246,26 @@ BOOL CALLBACK DocumentMap::run_dlgProc(UINT message, WPARAM wParam, LPARAM lPara
{ {
HWND hwndScintilla = (HWND)::SendMessage(_hParent, NPPM_CREATESCINTILLAHANDLE, 0, (LPARAM)_hSelf); HWND hwndScintilla = (HWND)::SendMessage(_hParent, NPPM_CREATESCINTILLAHANDLE, 0, (LPARAM)_hSelf);
_pScintillaEditView = (ScintillaEditView *)::SendMessage(_hParent, NPPM_INTERNAL_GETSCINTEDTVIEW, 0, (LPARAM)hwndScintilla); _pScintillaEditView = (ScintillaEditView *)::SendMessage(_hParent, NPPM_INTERNAL_GETSCINTEDTVIEW, 0, (LPARAM)hwndScintilla);
::SendMessage(_pScintillaEditView->getHSelf(), SCI_SETZOOM, (WPARAM)-10, 0); _pScintillaEditView->execute(SCI_SETZOOM, (WPARAM)-10, 0);
::SendMessage(_pScintillaEditView->getHSelf(), SCI_SETVSCROLLBAR, FALSE, 0); _pScintillaEditView->execute(SCI_SETVSCROLLBAR, FALSE, 0);
::SendMessage(_pScintillaEditView->getHSelf(), SCI_SETHSCROLLBAR, FALSE, 0); _pScintillaEditView->execute(SCI_SETHSCROLLBAR, FALSE, 0);
reloadMap();
_pScintillaEditView->showIndentGuideLine(false); _pScintillaEditView->showIndentGuideLine(false);
_pScintillaEditView->display();
reloadMap();
_vzDlg.init(::GetModuleHandle(NULL), _hSelf);
_vzDlg.doDialog();
(NppParameters::getInstance())->SetTransparent(_vzDlg.getHSelf(), 50); // 0 <= transparancy < 256
setSyntaxLiliting();
_pScintillaEditView->showMargin(0, false); _pScintillaEditView->showMargin(0, false);
_pScintillaEditView->showMargin(1, false); _pScintillaEditView->showMargin(1, false);
_pScintillaEditView->showMargin(2, false); _pScintillaEditView->showMargin(2, false);
_pScintillaEditView->showMargin(3, false); _pScintillaEditView->showMargin(3, false);
_pScintillaEditView->display();
_vzDlg.init(::GetModuleHandle(NULL), _hSelf);
_vzDlg.doDialog();
(NppParameters::getInstance())->SetTransparent(_vzDlg.getHSelf(), 50); // 0 <= transparancy < 256
return TRUE; return TRUE;
} }
case WM_DESTROY: case WM_DESTROY:

View File

@ -106,6 +106,7 @@ public:
void scrollMap(bool direction, moveMode whichMode); void scrollMap(bool direction, moveMode whichMode);
void doMove(); void doMove();
void fold(int line, bool foldOrNot); void fold(int line, bool foldOrNot);
void setSyntaxLiliting();
protected: protected:
virtual BOOL CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam); virtual BOOL CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);