Fix a regression that opened file is not selected

pull/1923/merge
Don HO 8 years ago
parent c76981421f
commit 6397ba51e6

@ -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;

Loading…
Cancel
Save