Fix a minor bug in "Show content in doc map on mous hover"
Fix a compiling error for x64 build
This commit is contained in:
parent
fe463dc03a
commit
6a3d9e994d
|
@ -151,7 +151,7 @@ BOOL Notepad_plus::notify(SCNotification *notification)
|
||||||
case TCN_MOUSEHOVERING:
|
case TCN_MOUSEHOVERING:
|
||||||
case TCN_MOUSEHOVERSWITCHING:
|
case TCN_MOUSEHOVERSWITCHING:
|
||||||
{
|
{
|
||||||
/*
|
///*
|
||||||
if (_pDocMap && (!_pDocMap->isClosed()) && _pDocMap->isVisible())
|
if (_pDocMap && (!_pDocMap->isClosed()) && _pDocMap->isVisible())
|
||||||
{
|
{
|
||||||
TBHDR *tbHdr = reinterpret_cast<TBHDR *>(notification);
|
TBHDR *tbHdr = reinterpret_cast<TBHDR *>(notification);
|
||||||
|
@ -159,20 +159,30 @@ BOOL Notepad_plus::notify(SCNotification *notification)
|
||||||
if (pTabDocView)
|
if (pTabDocView)
|
||||||
{
|
{
|
||||||
BufferID id = pTabDocView->getBufferByIndex(tbHdr->tabOrigin);
|
BufferID id = pTabDocView->getBufferByIndex(tbHdr->tabOrigin);
|
||||||
Buffer * pBuf = MainFileManager->getBufferByID(id);
|
Buffer *pBuf = MainFileManager->getBufferByID(id);
|
||||||
|
|
||||||
|
Buffer *currentBuf = getCurrentBuffer();
|
||||||
|
|
||||||
|
if (pBuf != currentBuf) // if hover on other tab
|
||||||
|
{
|
||||||
_pDocMap->showInMapTemporarily(pBuf, notifyView);
|
_pDocMap->showInMapTemporarily(pBuf, notifyView);
|
||||||
_pDocMap->setSyntaxHiliting();
|
_pDocMap->setSyntaxHiliting();
|
||||||
|
}
|
||||||
|
else // if hover on current active tab
|
||||||
|
{
|
||||||
|
_pDocMap->reloadMap();
|
||||||
|
_pDocMap->setSyntaxHiliting();
|
||||||
|
}
|
||||||
_pDocMap->setTemporarilyShowing(true);
|
_pDocMap->setTemporarilyShowing(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
//*/
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case TCN_MOUSELEAVING:
|
case TCN_MOUSELEAVING:
|
||||||
{
|
{
|
||||||
/*
|
///*
|
||||||
if (_pDocMap && (!_pDocMap->isClosed()) && _pDocMap->isVisible())
|
if (_pDocMap && (!_pDocMap->isClosed()) && _pDocMap->isVisible())
|
||||||
{
|
{
|
||||||
_pDocMap->reloadMap();
|
_pDocMap->reloadMap();
|
||||||
|
@ -180,7 +190,7 @@ BOOL Notepad_plus::notify(SCNotification *notification)
|
||||||
|
|
||||||
_pDocMap->setTemporarilyShowing(false);
|
_pDocMap->setTemporarilyShowing(false);
|
||||||
}
|
}
|
||||||
*/
|
//*/
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2003,10 +2003,19 @@ bool NppParameters::getSessionFromXmlTree(TiXmlDocument *pSessionDoc, Session *p
|
||||||
(childNode->ToElement())->Attribute(TEXT("scrollWidth"), &position._scrollWidth);
|
(childNode->ToElement())->Attribute(TEXT("scrollWidth"), &position._scrollWidth);
|
||||||
|
|
||||||
MapPosition mapPosition;
|
MapPosition mapPosition;
|
||||||
(childNode->ToElement())->Attribute(TEXT("mapFirstVisibleDocLine"), &mapPosition._firstVisibleDocLine);
|
int32_t mapPosVal;
|
||||||
(childNode->ToElement())->Attribute(TEXT("mapLastVisibleDocLine"), &mapPosition._lastVisibleDocLine);
|
const TCHAR *mapPosStr = (childNode->ToElement())->Attribute(TEXT("mapFirstVisibleDocLine"), &mapPosVal);
|
||||||
(childNode->ToElement())->Attribute(TEXT("mapNbLine"), &mapPosition._nbLine);
|
if (mapPosStr)
|
||||||
(childNode->ToElement())->Attribute(TEXT("mapHigherPos"), &mapPosition._higherPos);
|
mapPosition._firstVisibleDocLine = mapPosVal;
|
||||||
|
mapPosStr = (childNode->ToElement())->Attribute(TEXT("mapLastVisibleDocLine"), &mapPosVal);
|
||||||
|
if (mapPosStr)
|
||||||
|
mapPosition._lastVisibleDocLine = mapPosVal;
|
||||||
|
mapPosStr = (childNode->ToElement())->Attribute(TEXT("mapNbLine"), &mapPosVal);
|
||||||
|
if (mapPosStr)
|
||||||
|
mapPosition._nbLine = mapPosVal;
|
||||||
|
mapPosStr = (childNode->ToElement())->Attribute(TEXT("mapHigherPos"), &mapPosVal);
|
||||||
|
if (mapPosStr)
|
||||||
|
mapPosition._higherPos = mapPosVal;
|
||||||
|
|
||||||
const TCHAR *langName;
|
const TCHAR *langName;
|
||||||
langName = (childNode->ToElement())->Attribute(TEXT("lang"));
|
langName = (childNode->ToElement())->Attribute(TEXT("lang"));
|
||||||
|
|
|
@ -236,7 +236,7 @@ void DocumentMap::scrollMap(ScintillaEditView *editView)
|
||||||
// Get the editor's higher/lower Y, then compute the map's higher/lower Y
|
// Get the editor's higher/lower Y, then compute the map's higher/lower Y
|
||||||
LRESULT higherY = 0;
|
LRESULT higherY = 0;
|
||||||
LRESULT lowerY = 0;
|
LRESULT lowerY = 0;
|
||||||
auto higherPos = -1 ; // -1 => not pEditView->isWrap()
|
LRESULT higherPos = -1 ; // -1 => not pEditView->isWrap()
|
||||||
if (not pEditView->isWrap())
|
if (not pEditView->isWrap())
|
||||||
{
|
{
|
||||||
auto higherPos = _pScintillaEditView->execute(SCI_POSITIONFROMLINE, firstVisibleDocLine);
|
auto higherPos = _pScintillaEditView->execute(SCI_POSITIONFROMLINE, firstVisibleDocLine);
|
||||||
|
@ -252,14 +252,14 @@ void DocumentMap::scrollMap(ScintillaEditView *editView)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
higherPos = pEditView->execute(SCI_POSITIONFROMPOINT, 0, 0);
|
higherPos = pEditView->execute(SCI_POSITIONFROMPOINT, 0, 0);
|
||||||
higherY = _pScintillaEditView->execute(SCI_POINTYFROMPOSITION, 0, higherPos);
|
higherY = _pScintillaEditView->execute(SCI_POINTYFROMPOSITION, 0, static_cast<int32_t>(higherPos));
|
||||||
auto lineHeight = _pScintillaEditView->execute(SCI_TEXTHEIGHT, firstVisibleDocLine);
|
auto lineHeight = _pScintillaEditView->execute(SCI_TEXTHEIGHT, firstVisibleDocLine);
|
||||||
lowerY = nbLine * lineHeight + higherY;
|
lowerY = nbLine * lineHeight + higherY;
|
||||||
}
|
}
|
||||||
|
|
||||||
// set current map position in buffer
|
// set current map position in buffer
|
||||||
Buffer *buffer = pEditView->getCurrentBuffer();
|
Buffer *buffer = pEditView->getCurrentBuffer();
|
||||||
buffer->setMapPosition(firstVisibleDocLine, lastVisibleDocLine, nbLine, higherPos);
|
buffer->setMapPosition(static_cast<int32_t>(firstVisibleDocLine), static_cast<int32_t>(lastVisibleDocLine), static_cast<int32_t>(nbLine), static_cast<int32_t>(higherPos));
|
||||||
|
|
||||||
// Update view zone in map
|
// Update view zone in map
|
||||||
_vzDlg.drawZone(static_cast<long>(higherY), static_cast<long>(lowerY));
|
_vzDlg.drawZone(static_cast<long>(higherY), static_cast<long>(lowerY));
|
||||||
|
@ -445,9 +445,7 @@ INT_PTR CALLBACK DocumentMap::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
@ -478,8 +476,6 @@ INT_PTR CALLBACK DocumentMap::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
default :
|
default :
|
||||||
return DockingDlgInterface::run_dlgProc(message, wParam, lParam);
|
return DockingDlgInterface::run_dlgProc(message, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue