diff options
Diffstat (limited to 'src/getchar.c')
-rw-r--r-- | src/getchar.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/getchar.c b/src/getchar.c index f77ddc2a86..4d6da38dda 100644 --- a/src/getchar.c +++ b/src/getchar.c @@ -1597,12 +1597,13 @@ vgetc() } #endif #ifdef FEAT_GUI - /* The caller doesn't need to know that the focus event is delayed - * until getting a character. */ + /* Handle focus event here, so that the caller doesn't need to + * know about it. Return K_IGNORE so that we loop once (needed if + * 'lazyredraw' is set). */ if (c == K_FOCUSGAINED || c == K_FOCUSLOST) { ui_focus_change(c == K_FOCUSGAINED); - continue; + c = K_IGNORE; } /* Translate K_CSI to CSI. The special key is only used to avoid @@ -1748,6 +1749,22 @@ safe_vgetc() } /* + * Like safe_vgetc(), but loop to handle K_IGNORE. + * Also ignore scrollbar events. + */ + int +plain_vgetc() +{ + int c; + + do + { + c = safe_vgetc(); + } while (c == K_IGNORE || c == K_VER_SCROLLBAR || c == K_HOR_SCROLLBAR); + return c; +} + +/* * Check if a character is available, such that vgetc() will not block. * If the next character is a special character or multi-byte, the returned * character is not valid!. |