From 3453ff8ee80ef27fb99fb1198be69900926a1ede Mon Sep 17 00:00:00 2001 From: donho Date: Sun, 23 Mar 2008 17:57:57 +0000 Subject: [PATCH] [ENHANCEMENT] Enhance scroll to eof feature for the current document. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@150 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/src/Notepad_plus.cpp | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 2fb3e39d7..5c95c16fb 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -4439,11 +4439,6 @@ void Notepad_plus::dropFiles(HDROP hdrop) void Notepad_plus::checkModifiedDocument() { const int NB_VIEW = 2; - /* - ScintillaEditView * pScintillaArray[NB_VIEW]; - DocTabView * pDocTabArray[NB_VIEW]; - int currentIndex[NB_VIEW] = {-1, -1}; - */ struct ViewInfo { int id; ScintillaEditView * sv; @@ -4468,11 +4463,6 @@ void Notepad_plus::checkModifiedDocument() viewInfoArray[1].currentIndex = viewInfoArray[1].sv->getCurrentDocIndex(); viewInfoArray[1].toBeActivated = false; - /*pScintillaArray[0] = _pEditView; - pScintillaArray[1] = getNonCurrentEditView(); - pDocTabArray[0] = _pDocTab; - pDocTabArray[1] = getNonCurrentDocTab();*/ - NppParameters *pNppParam = NppParameters::getInstance(); const NppGUI & nppGUI = pNppParam->getNppGUI(); bool autoUpdate = (nppGUI._fileAutoDetection == cdAutoUpdate) || (nppGUI._fileAutoDetection == cdAutoUpdateGo2end); @@ -4558,15 +4548,16 @@ void Notepad_plus::checkModifiedDocument() if (autoUpdate) { - int iCur = getCurrentView(); - if (viewInfoArray[0].toBeActivated) + { switchEditViewTo(viewInfoArray[0].id); - + } + if (viewInfoArray[1].toBeActivated) + { switchEditViewTo(viewInfoArray[1].id); - - switchEditViewTo(iCur); + switchEditViewTo(viewInfoArray[0].id); + } } } @@ -7580,7 +7571,8 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa _pluginsManager.notify(reinterpret_cast(lParam)); return notify(reinterpret_cast(lParam)); } - + + case NPPM_CHECKDOCSTATUS : case WM_ACTIVATEAPP : { if (wParam == TRUE) // if npp is about to be activated @@ -7595,7 +7587,7 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa } break; } - + case WM_ACTIVATE : _pEditView->getFocus(); return TRUE;