diff options
author | Bram Moolenaar <Bram@vim.org> | 2007-09-13 16:26:47 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2007-09-13 16:26:47 +0000 |
commit | 61abfd1171924eddc619a9bb13dfea788a16ac2e (patch) | |
tree | 3b63f79912a1ceccea9c52b9bcaee9e133e30425 /src/getchar.c | |
parent | a84b10685c8f2c4cc1f7846fddae6b29bc4aee0f (diff) | |
download | vim-git-61abfd1171924eddc619a9bb13dfea788a16ac2e.tar.gz |
updated for version 7.1-104v7.1.104
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 f77ddc2a8..4d6da38dd 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!. |