mirror of
https://github.com/tmux/tmux.git
synced 2025-04-04 15:25:29 +00:00
If there are no buffers, reset mode as soon as any key pressed. Fixes
crash reported by Gaoyang Zhang in GitHub issue 3373.
This commit is contained in:
parent
3be369522b
commit
17290b9121
@ -508,6 +508,11 @@ window_buffer_key(struct window_mode_entry *wme, struct client *c,
|
|||||||
struct window_buffer_itemdata *item;
|
struct window_buffer_itemdata *item;
|
||||||
int finished;
|
int finished;
|
||||||
|
|
||||||
|
if (paste_get_top(NULL) == NULL) {
|
||||||
|
finished = 1;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
finished = mode_tree_key(mtd, c, &key, m, NULL, NULL);
|
finished = mode_tree_key(mtd, c, &key, m, NULL, NULL);
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 'e':
|
case 'e':
|
||||||
@ -534,6 +539,8 @@ window_buffer_key(struct window_mode_entry *wme, struct client *c,
|
|||||||
finished = 1;
|
finished = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
out:
|
||||||
if (finished || paste_get_top(NULL) == NULL)
|
if (finished || paste_get_top(NULL) == NULL)
|
||||||
window_pane_reset_mode(wp);
|
window_pane_reset_mode(wp);
|
||||||
else {
|
else {
|
||||||
|
Loading…
Reference in New Issue
Block a user