Fix incorrect message on double click on search result regression
This regression was inserted by commit c0be50494c
(PR #11107).
Fix #11215, Fix #11106
This commit is contained in:
parent
5c02505998
commit
51b1c9377c
|
@ -505,7 +505,15 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
|
|||
|
||||
case NPPM_RELOADFILE:
|
||||
{
|
||||
BufferID id = MainFileManager.getBufferFromName(reinterpret_cast<const TCHAR *>(lParam));
|
||||
TCHAR longNameFullpath[MAX_PATH];
|
||||
const TCHAR* pFilePath = reinterpret_cast<const TCHAR*>(lParam);
|
||||
wcscpy_s(longNameFullpath, MAX_PATH, pFilePath);
|
||||
if (_tcschr(longNameFullpath, '~'))
|
||||
{
|
||||
::GetLongPathName(longNameFullpath, longNameFullpath, MAX_PATH);
|
||||
}
|
||||
|
||||
BufferID id = MainFileManager.getBufferFromName(longNameFullpath);
|
||||
if (id != BUFFER_INVALID)
|
||||
doReload(id, wParam != 0);
|
||||
break;
|
||||
|
|
|
@ -1621,20 +1621,13 @@ bool FileManager::loadFileData(Document doc, int64_t fileSize, const TCHAR * fil
|
|||
|
||||
BufferID FileManager::getBufferFromName(const TCHAR* name)
|
||||
{
|
||||
TCHAR fullpath[MAX_PATH];
|
||||
::GetFullPathName(name, MAX_PATH, fullpath, NULL);
|
||||
if (_tcschr(fullpath, '~'))
|
||||
for (auto buf : _buffers)
|
||||
{
|
||||
::GetLongPathName(fullpath, fullpath, MAX_PATH);
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < _buffers.size(); i++)
|
||||
{
|
||||
if (OrdinalIgnoreCaseCompareStrings(fullpath, _buffers.at(i)->getFullPathName()) == 0)
|
||||
if (OrdinalIgnoreCaseCompareStrings(name, buf->getFullPathName()) == 0)
|
||||
{
|
||||
if (_buffers.at(i)->_referees[0]->isVisible())
|
||||
if (buf->_referees[0]->isVisible())
|
||||
{
|
||||
return _buffers.at(i)->getID();
|
||||
return buf->getID();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue