Skip to content

Commit

Permalink
Fix edit zone not getting focus while clicking the active tab
Browse files Browse the repository at this point in the history
Move input focus to editor when clicking on already-active tab.

Fix notepad-plus-plus#8446, close notepad-plus-plus#15508
  • Loading branch information
alankilborn authored and donho committed Aug 3, 2024
1 parent a16261c commit e17d77c
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions PowerEditor/src/NppNotification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,24 +371,30 @@ 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())
{
bool isSnapshotMode = NppParameters::getInstance().getNppGUI().isSnapshotMode();
if (isSnapshotMode)
if (_activeView == SUB_VIEW)
{
// Before switching off, synchronize backup file
MainFileManager.backupCurrentBuffer();
bool isSnapshotMode = NppParameters::getInstance().getNppGUI().isSnapshotMode();
if (isSnapshotMode)
{
// 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())
{
bool isSnapshotMode = NppParameters::getInstance().getNppGUI().isSnapshotMode();
if (isSnapshotMode)
if (_activeView == MAIN_VIEW)
{
// Before switching off, synchronize backup file
MainFileManager.backupCurrentBuffer();
bool isSnapshotMode = NppParameters::getInstance().getNppGUI().isSnapshotMode();
if (isSnapshotMode)
{
// Before switching off, synchronize backup file
MainFileManager.backupCurrentBuffer();
}
}
// Switch off
switchEditViewTo(SUB_VIEW);
Expand Down

0 comments on commit e17d77c

Please sign in to comment.