Browse Source

[BUG_FIXED] Fix the file status auto-detection bug : a unwanted selection after a popup dialog.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@10 f5eea248-9336-0410-98b8-ebc06183d4e3
pull/343/head^2
donho 18 years ago
parent
commit
e062a94cc5
  1. 27
      PowerEditor/src/Notepad_plus.cpp
  2. 7
      PowerEditor/src/Notepad_plus.h
  3. 6
      PowerEditor/src/ScitillaComponent/ScintillaEditView.h

27
PowerEditor/src/Notepad_plus.cpp

@ -1923,12 +1923,12 @@ BOOL Notepad_plus::notify(SCNotification *notification)
}
void Notepad_plus::findMatchingBracePos(int & braceAtCaret, int & braceOpposite)
{
int caretPos = int(_pEditView->execute(SCI_GETCURRENTPOS, 0, 0));
int caretPos = int(_pEditView->execute(SCI_GETCURRENTPOS));
braceAtCaret = -1;
braceOpposite = -1;
char charBefore = '\0';
//char styleBefore = '\0';
int lengthDoc = int(_pEditView->execute(SCI_GETLENGTH, 0, 0));
int lengthDoc = int(_pEditView->execute(SCI_GETLENGTH));
if ((lengthDoc > 0) && (caretPos > 0))
{
@ -3898,6 +3898,8 @@ void Notepad_plus::checkModifiedDocument()
const NppGUI & nppGUI = pNppParam->getNppGUI();
bool autoUpdate = (nppGUI._fileAutoDetection == cdAutoUpdate);
for (int j = 0 ; j < NB_VIEW ; j++)
{
for (int i = (pScintillaArray[j]->getNbDoc()-1) ; i >= 0 ; i--)
@ -3913,8 +3915,10 @@ void Notepad_plus::checkModifiedDocument()
if (::IsIconic(_hSelf))
::ShowWindow(_hSelf, SW_SHOWNORMAL);
//int caretPos = int(_pEditView->execute(SCI_GETCURRENTPOS));
if (update || doReloadOrNot(docBuf.getFileName()) == IDYES)
{
pDocTabArray[j]->activate(i);
// if it's a non current view, make it as the current view
if (j == 1)
@ -3927,6 +3931,14 @@ void Notepad_plus::checkModifiedDocument()
if (pScintillaArray[j]->isCurrentBufReadOnly())
pScintillaArray[j]->execute(SCI_SETREADONLY, TRUE);
if (_activeAppInf._isActivated)
{
int curPos = _pEditView->execute(SCI_GETCURRENTPOS);
::PostMessage(_pEditView->getHSelf(), WM_LBUTTONUP, 0, 0);
::PostMessage(_pEditView->getHSelf(), SCI_SETSEL, curPos, curPos);
_activeAppInf._isActivated = false;
}
}
docBuf.updatTimeStamp();
}
@ -6589,24 +6601,21 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
return notify(reinterpret_cast<SCNotification *>(lParam));
}
//case WM_CHECKTORENEW :
//printStr("bourges ton cul !!!");
//checkModifiedDocument();
//return TRUE;
case WM_ACTIVATEAPP :
{
if (wParam == TRUE) // if npp is about to be activated
{
NppGUI & nppgui = (NppGUI &)(pNppParam->getNppGUI());
if (LOWORD(wParam) && (nppgui._fileAutoDetection != cdDisabled))
{
_activeAppInf._isActivated = true;
checkModifiedDocument();
return FALSE;
}
//return ::DefWindowProc(hwnd, Message, wParam, lParam);
}
break;
}
case WM_ACTIVATE :
_pEditView->getFocus();
return TRUE;

7
PowerEditor/src/Notepad_plus.h

@ -431,6 +431,13 @@ private:
bool _isDocModifing;
bool _isHotspotDblClicked;
struct ActivateAppInfo {
bool _isActivated;
int _x;
int _y;
ActivateAppInfo() : _isActivated(false), _x(0), _y(0){};
} _activeAppInf;
//Synchronized Scolling
struct SyncInfo {

6
PowerEditor/src/ScitillaComponent/ScintillaEditView.h

@ -405,8 +405,12 @@ public:
execute(SCI_LINESCROLL, column, line);
};
long getCurrentPointX()const{
return long (execute(SCI_POINTXFROMPOSITION, 0, execute(SCI_GETCURRENTPOS)));
};
long getCurrentPointY()const{
return long (execute(SCI_POINTYFROMPOSITION,0,execute(SCI_GETCURRENTPOS)));
return long (execute(SCI_POINTYFROMPOSITION, 0, execute(SCI_GETCURRENTPOS)));
};
long getTextHeight()const{

Loading…
Cancel
Save