forked from aniani/vim
patch 8.1.1127: getwinpos() doesn't work in terminal on MS-Windows console
Problem: getwinpos() doesn't work in terminal on MS-Windows console. Solution: Adjust #ifdefs. Disable test for MS-Windows console.
This commit is contained in:
@@ -2843,7 +2843,7 @@ static int winpos_x = -1;
|
|||||||
static int winpos_y = -1;
|
static int winpos_y = -1;
|
||||||
static int did_request_winpos = 0;
|
static int did_request_winpos = 0;
|
||||||
|
|
||||||
# if (defined(FEAT_EVAL) && defined(HAVE_TGETENT)) || defined(PROTO)
|
# if defined(FEAT_EVAL) || defined(FEAT_TERMINAL) || defined(PROTO)
|
||||||
/*
|
/*
|
||||||
* Try getting the Vim window position from the terminal.
|
* Try getting the Vim window position from the terminal.
|
||||||
* Returns OK or FAIL.
|
* Returns OK or FAIL.
|
||||||
@@ -4858,7 +4858,7 @@ check_termcode(
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Check for a window position response from the terminal:
|
* Check for a window position response from the terminal:
|
||||||
* {lead}3;{x}:{y}t
|
* {lead}3;{x};{y}t
|
||||||
*/
|
*/
|
||||||
else if (did_request_winpos
|
else if (did_request_winpos
|
||||||
&& ((len >= 4 && tp[0] == ESC && tp[1] == '[')
|
&& ((len >= 4 && tp[0] == ESC && tp[1] == '[')
|
||||||
|
@@ -3866,8 +3866,11 @@ parse_csi(
|
|||||||
if (command != 't' || argcount != 1 || args[0] != 13)
|
if (command != 't' || argcount != 1 || args[0] != 13)
|
||||||
return 0; // not handled
|
return 0; // not handled
|
||||||
|
|
||||||
// When getting the window position fails it results in zero/zero.
|
// When getting the window position is not possible or it fails it results
|
||||||
|
// in zero/zero.
|
||||||
|
#if defined(FEAT_GUI) || (defined(HAVE_TGETENT) && defined(FEAT_TERMRESPONSE))
|
||||||
(void)ui_get_winpos(&x, &y, (varnumber_T)100);
|
(void)ui_get_winpos(&x, &y, (varnumber_T)100);
|
||||||
|
#endif
|
||||||
|
|
||||||
FOR_ALL_WINDOWS(wp)
|
FOR_ALL_WINDOWS(wp)
|
||||||
if (wp->w_buffer == term->tl_buffer)
|
if (wp->w_buffer == term->tl_buffer)
|
||||||
|
@@ -1889,6 +1889,11 @@ func Test_terminal_statusline()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_terminal_getwinpos()
|
func Test_terminal_getwinpos()
|
||||||
|
" does not work in the MS-Windows console
|
||||||
|
if has('win32') && !has('gui')
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
" split, go to the bottom-right window
|
" split, go to the bottom-right window
|
||||||
split
|
split
|
||||||
wincmd j
|
wincmd j
|
||||||
|
5
src/ui.c
5
src/ui.c
@@ -627,10 +627,9 @@ ui_new_shellsize(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (defined(FEAT_EVAL) \
|
#if ((defined(FEAT_EVAL) || defined(FEAT_TERMINAL)) \
|
||||||
&& (defined(FEAT_GUI) \
|
&& (defined(FEAT_GUI) \
|
||||||
|| (defined(HAVE_TGETENT) && defined(FEAT_TERMRESPONSE)))) \
|
|| (defined(HAVE_TGETENT) && defined(FEAT_TERMRESPONSE)))) \
|
||||||
|| defined(FEAT_TERMINAL) \
|
|
||||||
|| defined(PROTO)
|
|| defined(PROTO)
|
||||||
/*
|
/*
|
||||||
* Get the window position in pixels, if possible.
|
* Get the window position in pixels, if possible.
|
||||||
@@ -645,6 +644,8 @@ ui_get_winpos(int *x, int *y, varnumber_T timeout)
|
|||||||
# endif
|
# endif
|
||||||
# if defined(HAVE_TGETENT) && defined(FEAT_TERMRESPONSE)
|
# if defined(HAVE_TGETENT) && defined(FEAT_TERMRESPONSE)
|
||||||
return term_get_winpos(x, y, timeout);
|
return term_get_winpos(x, y, timeout);
|
||||||
|
# else
|
||||||
|
return FAIL;
|
||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@@ -771,6 +771,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1127,
|
||||||
/**/
|
/**/
|
||||||
1126,
|
1126,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user