diff src/testdir/test_functions.vim @ 22357:0e231e8e70f8 v8.2.1727

patch 8.2.1727: a popup created with "cursorline" will ignore "firstline" Commit: https://github.com/vim/vim/commit/99ca9c4868bb1669706b9e3de9a9218bd11cc459 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Sep 22 21:55:41 2020 +0200 patch 8.2.1727: a popup created with "cursorline" will ignore "firstline" Problem: A popup created with "cursorline" will ignore "firstline". Solution: When both "cursorline" and "firstline" are present put the cursor on "firstline". (closes #7000) Add the "winid" argument to getcurpos().
author Bram Moolenaar <Bram@vim.org>
date Tue, 22 Sep 2020 22:00:03 +0200
parents 0491b9cafd44
children 595ea7f099cd
line wrap: on
line diff
--- a/src/testdir/test_functions.vim
+++ b/src/testdir/test_functions.vim
@@ -2520,7 +2520,19 @@ func Test_getcurpos_setpos()
   call assert_equal('6', @")
   call assert_equal(-1, setpos('.', test_null_list()))
   call assert_equal(-1, setpos('.', {}))
+
+  let winid = win_getid()
+  normal G$
+  let pos = getcurpos()
+  wincmd w
+  call assert_equal(pos, getcurpos(winid))
+
+  wincmd w
   close!
+
+  call assert_equal(getcurpos(), getcurpos(0))
+  call assert_equal([0, 0, 0, 0, 0], getcurpos(-1))
+  call assert_equal([0, 0, 0, 0, 0], getcurpos(1999))
 endfunc
 
 " Test for glob()