From d80816f930c41d6dbb40a2ef689a071c38d025c2 Mon Sep 17 00:00:00 2001 From: Scott Sumner <30118311+sasumner@users.noreply.github.com> Date: Fri, 6 Nov 2020 14:33:59 -0500 Subject: [PATCH] Fix bug where search-results won't open 'new 1' file Fix #8461, fix #9098, close #9115 --- PowerEditor/src/ScitillaComponent/Buffer.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/PowerEditor/src/ScitillaComponent/Buffer.cpp b/PowerEditor/src/ScitillaComponent/Buffer.cpp index 32185c96..31f532e2 100644 --- a/PowerEditor/src/ScitillaComponent/Buffer.cpp +++ b/PowerEditor/src/ScitillaComponent/Buffer.cpp @@ -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; }