Fix a regression that opened file is not selected

This commit is contained in:
Don HO 2016-08-01 21:32:37 +02:00
parent c76981421f
commit 6397ba51e6

View File

@ -4259,20 +4259,22 @@ void Notepad_plus::changeToolBarIcons()
bool Notepad_plus::switchToFile(BufferID id)
{
int i = 0;
int iView = currentView();
if (id == BUFFER_INVALID)
return false;
int i = _pDocTab->getIndexByBuffer(id);
if (i != -1)
if ((i = _pDocTab->getIndexByBuffer(id)) != -1)
{
iView = currentView();
}
i = _pNonDocTab->getIndexByBuffer(id);
if (i != -1)
else if ((i = _pNonDocTab->getIndexByBuffer(id)) != -1)
{
iView = otherView();
}
if (i != -1)
{
switchEditViewTo(iView);
activateBuffer(id, currentView());
return true;