]> granicus.if.org Git - vim/commitdiff
patch 8.2.1591: using winheight('.') in tests works but is wrong v8.2.1591
authorBram Moolenaar <Bram@vim.org>
Fri, 4 Sep 2020 16:38:06 +0000 (18:38 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 4 Sep 2020 16:38:06 +0000 (18:38 +0200)
Problem:    Using winheight('.') in tests works but is wrong.
Solution:   Use winheight(0). (issue #6863)

src/testdir/test_functions.vim
src/testdir/test_quickfix.vim
src/version.c

index fd9057ddc9c09cab092f076c421fe306267a4e49..70dc33939a0d292a0c990cc0eafb4e7d65e0727c 100644 (file)
@@ -1438,19 +1438,19 @@ func Test_setbufvar_options()
   let prev_id = win_getid()
 
   wincmd j
-  let wh = winheight('.')
+  let wh = winheight(0)
   let dummy_buf = bufnr('dummy_buf1', v:true)
   call setbufvar(dummy_buf, '&buftype', 'nofile')
   execute 'belowright vertical split #' . dummy_buf
-  call assert_equal(wh, winheight('.'))
+  call assert_equal(wh, winheight(0))
   let dum1_id = win_getid()
 
   wincmd h
-  let wh = winheight('.')
+  let wh = winheight(0)
   let dummy_buf = bufnr('dummy_buf2', v:true)
   eval 'nofile'->setbufvar(dummy_buf, '&buftype')
   execute 'belowright vertical split #' . dummy_buf
-  call assert_equal(wh, winheight('.'))
+  call assert_equal(wh, winheight(0))
 
   bwipe!
   call win_gotoid(prev_id)
index 8faf69a318a0dea221510701bd8de71b6539accc..1faf02dc29256e97c7e5ee630040529f1ca61aaf 100644 (file)
@@ -261,13 +261,13 @@ func XwindowTests(cchar)
   " Open the window
   Xopen 5
   call assert_true(winnr('$') == 2 && getline('.') ==# '|| non-error 1'
-                     \  && winheight('.') == 5)
+                     \  && winheight(0) == 5)
 
   " Opening the window again, should move the cursor to that window
   wincmd t
   Xopen 7
   call assert_true(winnr('$') == 2 && winnr() == 2 &&
-       \ winheight('.') == 7 &&
+       \ winheight(0) == 7 &&
        \ getline('.') ==# '|| non-error 1')
 
   " :cnext in quickfix window should move to the next entry
index 53a3ed0470d94c7e8327f488f8f609d1f0975b5a..60c62945a6d1dacac57027f3a40042d7e405f675 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1591,
 /**/
     1590,
 /**/