diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-08-24 21:02:45 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-24 21:02:45 +0800 |
commit | f91b1885ddeaf971e17afe49b80f1b1412ecc8a2 (patch) | |
tree | 889f79e5f876452e6863c51942c205b1dfcbcc8a /test/functional/ui/multigrid_spec.lua | |
parent | b0fdce55d02c1da7da3257b33b91e974f89eceef (diff) | |
download | rneovim-f91b1885ddeaf971e17afe49b80f1b1412ecc8a2.tar.gz rneovim-f91b1885ddeaf971e17afe49b80f1b1412ecc8a2.tar.bz2 rneovim-f91b1885ddeaf971e17afe49b80f1b1412ecc8a2.zip |
feat(eval)!: make Vim functions return inner window width and height (#19743)
In non-multigrid UI the only change is that the returned height now
excludes winbar, and this is compatible with Vim.
In multigrid UI this means the return value of these functions now
reflect the space available for buffer lines in a window.
No change in nvim_win_get_height() and nvim_win_get_width().
Diffstat (limited to 'test/functional/ui/multigrid_spec.lua')
-rw-r--r-- | test/functional/ui/multigrid_spec.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/functional/ui/multigrid_spec.lua b/test/functional/ui/multigrid_spec.lua index b30aa67fd3..78a1e8c677 100644 --- a/test/functional/ui/multigrid_spec.lua +++ b/test/functional/ui/multigrid_spec.lua @@ -3,7 +3,9 @@ local Screen = require('test.functional.ui.screen') local clear = helpers.clear local feed, command, insert = helpers.feed, helpers.command, helpers.insert local eq = helpers.eq +local funcs = helpers.funcs local meths = helpers.meths +local curwin = helpers.curwin local poke_eventloop = helpers.poke_eventloop @@ -871,6 +873,15 @@ describe('ext_multigrid', function() before_each(function() screen:try_resize_grid(2, 60, 20) end) + + it('winwidth() winheight() getwininfo() return inner width and height #19743', function() + eq(60, funcs.winwidth(0)) + eq(20, funcs.winheight(0)) + local win_info = funcs.getwininfo(curwin().id)[1] + eq(60, win_info.width) + eq(20, win_info.height) + end) + it('gets written till grid width', function() insert(('a'):rep(60).."\n") |