Mercurial > vim
diff src/evalfunc.c @ 16241:c1698187c482 v8.1.1125
patch 8.1.1125: libvterm does not handle the window position report
commit https://github.com/vim/vim/commit/fa1e90cd4d1bebd66da22df4625f70963f091f17
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Apr 6 17:47:40 2019 +0200
patch 8.1.1125: libvterm does not handle the window position report
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 06 Apr 2019 18:00:05 +0200 |
parents | 219c58b3879c |
children | 8e168aa08310 |
line wrap: on
line diff
--- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -5985,20 +5985,14 @@ f_getwinpos(typval_T *argvars UNUSED, ty 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, ty f_getwinposx(typval_T *argvars UNUSED, typval_T *rettv) { rettv->vval.v_number = -1; -#ifdef FEAT_GUI - if (gui.in_use) +#if defined(FEAT_GUI) || (defined(HAVE_TGETENT) && defined(FEAT_TERMRESPONSE)) { 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) - { - 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, t f_getwinposy(typval_T *argvars UNUSED, typval_T *rettv) { rettv->vval.v_number = -1; -#ifdef FEAT_GUI - if (gui.in_use) +#if defined(FEAT_GUI) || (defined(HAVE_TGETENT) && defined(FEAT_TERMRESPONSE)) { 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) - { - 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