diff --git a/PowerEditor/src/NppNotification.cpp b/PowerEditor/src/NppNotification.cpp index be4b697a8699..af855b978493 100644 --- a/PowerEditor/src/NppNotification.cpp +++ b/PowerEditor/src/NppNotification.cpp @@ -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; @@ -1015,8 +1007,6 @@ BOOL Notepad_plus::notify(SCNotification *notification) lpttt->lpszText = docTip; return TRUE; } - else - return FALSE; } catch (...) {