diff src/testdir/test_terminal.vim @ 16253:f28ef3d27f91 v8.1.1131

patch 8.1.1131: getwinpos() does not work in the MS-Windows console commit https://github.com/vim/vim/commit/16c34c37659e6afca74169969bdacb6b866548c9 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Apr 6 22:01:24 2019 +0200 patch 8.1.1131: getwinpos() does not work in the MS-Windows console Problem: getwinpos() does not work in the MS-Windows console. Solution: Implement getwinpos().
author Bram Moolenaar <Bram@vim.org>
date Sat, 06 Apr 2019 22:15:04 +0200
parents de86c7db29db
children d0fef9cb6a9b
line wrap: on
line diff
--- a/src/testdir/test_terminal.vim
+++ b/src/testdir/test_terminal.vim
@@ -1889,12 +1889,6 @@ func Test_terminal_statusline()
 endfunc
 
 func Test_terminal_getwinpos()
-  " getwinpos() does not work in the MS-Windows console, and the GUI runs the
-  " console version in the terminal window.
-  if has('win32')
-    return
-  endif
-
   " split, go to the bottom-right window
   split
   wincmd j
@@ -1913,10 +1907,17 @@ func Test_terminal_getwinpos()
   let xpos = str2nr(substitute(line, '\[\(\d\+\), \d\+\]', '\1', ''))
   let ypos = str2nr(substitute(line, '\[\d\+, \(\d\+\)\]', '\1', ''))
 
-  " Position must be bigger than the getwinpos() result of Vim itself.
-  let [xroot, yroot] = getwinpos()
-  call assert_inrange(xroot + 2, xroot + 1000, xpos)
-  call assert_inrange(yroot + 2, yroot + 1000, ypos)
+  " getwinpos() in the MS-Windows console returns the screen position of the
+  " emulated console.
+  if has('win32')
+    call assert_inrange(0, 4000, xpos)
+    call assert_inrange(0, 2000, ypos)
+  else
+    " Position must be bigger than the getwinpos() result of Vim itself.
+    let [xroot, yroot] = getwinpos()
+    call assert_inrange(xroot + 2, xroot + 1000, xpos)
+    call assert_inrange(yroot + 2, yroot + 1000, ypos)
+  endif
 
   call term_wait(buf)
   call term_sendkeys(buf, ":q\<CR>")