mirror of
https://github.com/tmux/tmux.git
synced 2026-02-13 17:49:15 +00:00
Handle theme keys earlier so they are processed even if a popup is open.
From Josh Cooper in GitHub issue 4827.
This commit is contained in:
@@ -2417,16 +2417,6 @@ server_client_key_callback(struct cmdq_item *item, void *data)
|
||||
event->key = key;
|
||||
}
|
||||
|
||||
/* Handle theme reporting keys. */
|
||||
if (key == KEYC_REPORT_LIGHT_THEME) {
|
||||
server_client_report_theme(c, THEME_LIGHT);
|
||||
goto out;
|
||||
}
|
||||
if (key == KEYC_REPORT_DARK_THEME) {
|
||||
server_client_report_theme(c, THEME_DARK);
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* Find affected pane. */
|
||||
if (!KEYC_IS_MOUSE(key) || cmd_find_from_mouse(&fs, m, 0) != 0)
|
||||
cmd_find_from_client(&fs, c, 0);
|
||||
@@ -2645,6 +2635,19 @@ server_client_handle_key(struct client *c, struct key_event *event)
|
||||
if (s == NULL || (c->flags & CLIENT_UNATTACHEDFLAGS))
|
||||
return (0);
|
||||
|
||||
/*
|
||||
* Handle theme reporting keys before overlays so they work even when a
|
||||
* popup is open.
|
||||
*/
|
||||
if (event->key == KEYC_REPORT_LIGHT_THEME) {
|
||||
server_client_report_theme(c, THEME_LIGHT);
|
||||
return (0);
|
||||
}
|
||||
if (event->key == KEYC_REPORT_DARK_THEME) {
|
||||
server_client_report_theme(c, THEME_DARK);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Key presses in overlay mode and the command prompt are a special
|
||||
* case. The queue might be blocked so they need to be processed
|
||||
|
||||
Reference in New Issue
Block a user