Mercurial > vim
comparison src/testdir/test_functions.vim @ 22083:c67a9d3b3683 v8.2.1591
patch 8.2.1591: using winheight('.') in tests works but is wrong
Commit: https://github.com/vim/vim/commit/c05d1c043a25c7a52dbf0a740d3f715a9d2691f7
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Sep 4 18:38:06 2020 +0200
patch 8.2.1591: using winheight('.') in tests works but is wrong
Problem: Using winheight('.') in tests works but is wrong.
Solution: Use winheight(0). (issue https://github.com/vim/vim/issues/6863)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 04 Sep 2020 18:45:05 +0200 |
parents | 85add08e6a2d |
children | ff21e2962490 |
comparison
equal
deleted
inserted
replaced
22082:a7650f20d72e | 22083:c67a9d3b3683 |
---|---|
1436 resize 2 | 1436 resize 2 |
1437 set winfixheight winfixwidth | 1437 set winfixheight winfixwidth |
1438 let prev_id = win_getid() | 1438 let prev_id = win_getid() |
1439 | 1439 |
1440 wincmd j | 1440 wincmd j |
1441 let wh = winheight('.') | 1441 let wh = winheight(0) |
1442 let dummy_buf = bufnr('dummy_buf1', v:true) | 1442 let dummy_buf = bufnr('dummy_buf1', v:true) |
1443 call setbufvar(dummy_buf, '&buftype', 'nofile') | 1443 call setbufvar(dummy_buf, '&buftype', 'nofile') |
1444 execute 'belowright vertical split #' . dummy_buf | 1444 execute 'belowright vertical split #' . dummy_buf |
1445 call assert_equal(wh, winheight('.')) | 1445 call assert_equal(wh, winheight(0)) |
1446 let dum1_id = win_getid() | 1446 let dum1_id = win_getid() |
1447 | 1447 |
1448 wincmd h | 1448 wincmd h |
1449 let wh = winheight('.') | 1449 let wh = winheight(0) |
1450 let dummy_buf = bufnr('dummy_buf2', v:true) | 1450 let dummy_buf = bufnr('dummy_buf2', v:true) |
1451 eval 'nofile'->setbufvar(dummy_buf, '&buftype') | 1451 eval 'nofile'->setbufvar(dummy_buf, '&buftype') |
1452 execute 'belowright vertical split #' . dummy_buf | 1452 execute 'belowright vertical split #' . dummy_buf |
1453 call assert_equal(wh, winheight('.')) | 1453 call assert_equal(wh, winheight(0)) |
1454 | 1454 |
1455 bwipe! | 1455 bwipe! |
1456 call win_gotoid(prev_id) | 1456 call win_gotoid(prev_id) |
1457 bwipe! | 1457 bwipe! |
1458 call win_gotoid(dum1_id) | 1458 call win_gotoid(dum1_id) |