Skip to content

Commit

Permalink
Small refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
donho committed Sep 19, 2024
1 parent 27ce5f8 commit 5950741
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions PowerEditor/src/NppNotification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -985,24 +985,16 @@ BOOL Notepad_plus::notify(SCNotification *notification)
wcscpy_s(lpttt->szText, tipTmp.c_str());
return TRUE;
}
else if (hWin == _mainDocTab.getHSelf())
else
{
BufferID idd = _mainDocTab.getBufferByIndex(id);
Buffer * buf = MainFileManager.getBufferByID(idd);
if (buf == nullptr)
BufferID idd = BUFFER_INVALID;
if (hWin == _mainDocTab.getHSelf())
idd = _mainDocTab.getBufferByIndex(id);
else if (hWin == _subDocTab.getHSelf())
idd = _subDocTab.getBufferByIndex(id);
else
return FALSE;

tipTmp = buf->getFullPathName();

if (tipTmp.length() >= tipMaxLen)
return FALSE;
wcscpy_s(docTip, tipTmp.c_str());
lpttt->lpszText = docTip;
return TRUE;
}
else if (hWin == _subDocTab.getHSelf())
{
BufferID idd = _subDocTab.getBufferByIndex(id);
Buffer * buf = MainFileManager.getBufferByID(idd);
if (buf == nullptr)
return FALSE;
Expand All @@ -1015,8 +1007,6 @@ BOOL Notepad_plus::notify(SCNotification *notification)
lpttt->lpszText = docTip;
return TRUE;
}
else
return FALSE;
}
catch (...)
{
Expand Down

0 comments on commit 5950741

Please sign in to comment.