summaryrefslogtreecommitdiffstats
path: root/src/getchar.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-03-04 23:21:35 +0100
committerBram Moolenaar <Bram@vim.org>2020-03-04 23:21:35 +0100
commit8f027fe470555252b258508c455e93700a969cb1 (patch)
tree073ea9753872a8345c43a07e77b7c52c4e618259 /src/getchar.c
parenta471eeae75cda982bb6ddffbb0cbb71d868b97bf (diff)
patch 8.2.0356: MS-Windows: feedkeys() with VIMDLL cannot handle CSIv8.2.0356
Problem: MS-Windows: feedkeys() with VIMDLL cannot handle CSI correctly. Solution: Modify mch_inchar() to encode CSI bytes. (Ozaki Kiichi, Ken Takata, closes #5726)
Diffstat (limited to 'src/getchar.c')
-rw-r--r--src/getchar.c34
1 files changed, 13 insertions, 21 deletions
diff --git a/src/getchar.c b/src/getchar.c
index b828c27dd4..7df4bcebc9 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -1623,7 +1623,7 @@ vgetc(void)
// Get two extra bytes for special keys
if (c == K_SPECIAL
#ifdef FEAT_GUI
- || (gui.in_use && c == CSI)
+ || (c == CSI)
#endif
)
{
@@ -1678,23 +1678,19 @@ vgetc(void)
}
#endif
#ifdef FEAT_GUI
- if (gui.in_use)
+ // 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)
{
- // 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);
- c = K_IGNORE;
- }
-
- // Translate K_CSI to CSI. The special key is only used
- // to avoid it being recognized as the start of a special
- // key.
- if (c == K_CSI)
- c = CSI;
+ ui_focus_change(c == K_FOCUSGAINED);
+ c = K_IGNORE;
}
+
+ // Translate K_CSI to CSI. The special key is only used to
+ // avoid it being recognized as the start of a special key.
+ if (c == K_CSI)
+ c = CSI;
#endif
}
// a keypad or special function key was not mapped, use it like
@@ -1772,11 +1768,7 @@ vgetc(void)
buf[i] = vgetorpeek(TRUE);
if (buf[i] == K_SPECIAL
#ifdef FEAT_GUI
- || (
-# ifdef VIMDLL
- gui.in_use &&
-# endif
- buf[i] == CSI)
+ || (buf[i] == CSI)
#endif
)
{