@@ -1889,12 +1889,6 @@ func Test_terminal_statusline()
18891889endfunc
18901890
18911891func Test_terminal_getwinpos ()
1892- " getwinpos() does not work in the MS-Windows console, and the GUI runs the
1893- " console version in the terminal window.
1894- if has (' win32' )
1895- return
1896- endif
1897-
18981892 " split, go to the bottom-right window
18991893 split
19001894 wincmd j
@@ -1913,10 +1907,17 @@ func Test_terminal_getwinpos()
19131907 let xpos = str2nr (substitute (line , ' \[\(\d\+\), \d\+\]' , ' \1' , ' ' ))
19141908 let ypos = str2nr (substitute (line , ' \[\d\+, \(\d\+\)\]' , ' \1' , ' ' ))
19151909
1916- " Position must be bigger than the getwinpos() result of Vim itself.
1917- let [xroot, yroot] = getwinpos ()
1918- call assert_inrange (xroot + 2 , xroot + 1000 , xpos)
1919- call assert_inrange (yroot + 2 , yroot + 1000 , ypos)
1910+ " getwinpos() in the MS-Windows console returns the screen position of the
1911+ " emulated console.
1912+ if has (' win32' )
1913+ call assert_inrange (0 , 4000 , xpos)
1914+ call assert_inrange (0 , 2000 , ypos)
1915+ else
1916+ " Position must be bigger than the getwinpos() result of Vim itself.
1917+ let [xroot, yroot] = getwinpos ()
1918+ call assert_inrange (xroot + 2 , xroot + 1000 , xpos)
1919+ call assert_inrange (yroot + 2 , yroot + 1000 , ypos)
1920+ endif
19201921
19211922 call term_wait (buf )
19221923 call term_sendkeys (buf , " :q\<CR> " )
0 commit comments