Fix bug where search-results won't open 'new 1' file

Fix #8461, fix #9098, close #9115
This commit is contained in:
Scott Sumner 2020-11-06 14:33:59 -05:00 committed by Don HO
parent f91246e312
commit d80816f930

View File

@ -1463,7 +1463,12 @@ BufferID FileManager::getBufferFromName(const TCHAR* name)
for (size_t i = 0; i < _buffers.size(); i++)
{
if (OrdinalIgnoreCaseCompareStrings(name, _buffers.at(i)->getFullPathName()) == 0)
return _buffers.at(i)->getID();
{
if (_buffers.at(i)->_referees[0]->isVisible())
{
return _buffers.at(i)->getID();
}
}
}
return BUFFER_INVALID;
}