Mercurial > vim
diff src/getchar.c @ 1389:bdcfe793d49f v7.1.104
updated for version 7.1-104
author | vimboss |
---|---|
date | Thu, 13 Sep 2007 16:26:47 +0000 |
parents | 99a9e42e5688 |
children | ca501ab2fdb3 |
line wrap: on
line diff
--- 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!.