Fix edit zone not getting focus while clicking the active tab

Move input focus to editor when clicking on already-active tab.

Fix #8446, close #15508
pull/15516/head
Alan Kilborn 2024-08-01 20:36:42 -04:00 committed by Don Ho
parent a16261caaa
commit e17d77ceab
1 changed files with 16 additions and 10 deletions

View File

@ -371,7 +371,9 @@ BOOL Notepad_plus::notify(SCNotification *notification)
_statusBar.setText((_pEditView->execute(SCI_GETOVERTYPE)) ? L"OVR" : L"INS", STATUSBAR_TYPING_MODE);
}
}
else if (notification->nmhdr.hwndFrom == _mainDocTab.getHSelf() && _activeView == SUB_VIEW)
else if (notification->nmhdr.hwndFrom == _mainDocTab.getHSelf())
{
if (_activeView == SUB_VIEW)
{
bool isSnapshotMode = NppParameters::getInstance().getNppGUI().isSnapshotMode();
if (isSnapshotMode)
@ -379,10 +381,13 @@ BOOL Notepad_plus::notify(SCNotification *notification)
// Before switching off, synchronize backup file
MainFileManager.backupCurrentBuffer();
}
}
// Switch off
switchEditViewTo(MAIN_VIEW);
}
else if (notification->nmhdr.hwndFrom == _subDocTab.getHSelf() && _activeView == MAIN_VIEW)
else if (notification->nmhdr.hwndFrom == _subDocTab.getHSelf())
{
if (_activeView == MAIN_VIEW)
{
bool isSnapshotMode = NppParameters::getInstance().getNppGUI().isSnapshotMode();
if (isSnapshotMode)
@ -390,6 +395,7 @@ BOOL Notepad_plus::notify(SCNotification *notification)
// Before switching off, synchronize backup file
MainFileManager.backupCurrentBuffer();
}
}
// Switch off
switchEditViewTo(SUB_VIEW);
}