summaryrefslogtreecommitdiff
path: root/src/evalfunc.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-04-06 17:47:40 +0200
committerBram Moolenaar <Bram@vim.org>2019-04-06 17:47:40 +0200
commitfa1e90cd4d1bebd66da22df4625f70963f091f17 (patch)
tree4d129283fee69272fd52f7d88e27b7822b21a3f2 /src/evalfunc.c
parentd9eefe3155277cec71105f52d34a76f7a3237e7f (diff)
downloadvim-git-fa1e90cd4d1bebd66da22df4625f70963f091f17.tar.gz
patch 8.1.1125: libvterm does not handle the window position reportv8.1.1125
Problem: Libvterm does not handle the window position report. Solution: Let libvterm call the fallback CSI handler when not handling CSI sequence. Handle the window position report in Vim.
Diffstat (limited to 'src/evalfunc.c')
-rw-r--r--src/evalfunc.c40
1 files changed, 7 insertions, 33 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 83c4b9447..0f126d773 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -5985,20 +5985,14 @@ f_getwinpos(typval_T *argvars UNUSED, typval_T *rettv)
if (rettv_list_alloc(rettv) == FAIL)
return;
-#ifdef FEAT_GUI
- if (gui.in_use)
- (void)gui_mch_get_winpos(&x, &y);
-# if defined(HAVE_TGETENT) && defined(FEAT_TERMRESPONSE)
- else
-# endif
-#endif
-#if defined(HAVE_TGETENT) && defined(FEAT_TERMRESPONSE)
+#if defined(FEAT_GUI) || (defined(HAVE_TGETENT) && defined(FEAT_TERMRESPONSE))
{
varnumber_T timeout = 100;
if (argvars[0].v_type != VAR_UNKNOWN)
timeout = tv_get_number(&argvars[0]);
- term_get_winpos(&x, &y, timeout);
+
+ (void)ui_get_winpos(&x, &y, timeout);
}
#endif
list_append_number(rettv->vval.v_list, (varnumber_T)x);
@@ -6013,21 +6007,11 @@ f_getwinpos(typval_T *argvars UNUSED, typval_T *rettv)
f_getwinposx(typval_T *argvars UNUSED, typval_T *rettv)
{
rettv->vval.v_number = -1;
-#ifdef FEAT_GUI
- if (gui.in_use)
- {
- int x, y;
-
- if (gui_mch_get_winpos(&x, &y) == OK)
- rettv->vval.v_number = x;
- return;
- }
-#endif
-#if defined(HAVE_TGETENT) && defined(FEAT_TERMRESPONSE)
+#if defined(FEAT_GUI) || (defined(HAVE_TGETENT) && defined(FEAT_TERMRESPONSE))
{
int x, y;
- if (term_get_winpos(&x, &y, (varnumber_T)100) == OK)
+ if (ui_get_winpos(&x, &y, 100) == OK)
rettv->vval.v_number = x;
}
#endif
@@ -6040,21 +6024,11 @@ f_getwinposx(typval_T *argvars UNUSED, typval_T *rettv)
f_getwinposy(typval_T *argvars UNUSED, typval_T *rettv)
{
rettv->vval.v_number = -1;
-#ifdef FEAT_GUI
- if (gui.in_use)
- {
- int x, y;
-
- if (gui_mch_get_winpos(&x, &y) == OK)
- rettv->vval.v_number = y;
- return;
- }
-#endif
-#if defined(HAVE_TGETENT) && defined(FEAT_TERMRESPONSE)
+#if defined(FEAT_GUI) || (defined(HAVE_TGETENT) && defined(FEAT_TERMRESPONSE))
{
int x, y;
- if (term_get_winpos(&x, &y, (varnumber_T)100) == OK)
+ if (ui_get_winpos(&x, &y, 100) == OK)
rettv->vval.v_number = y;
}
#endif