aboutsummaryrefslogtreecommitdiff
path: root/test/functional/vimscript/screenrowcol_spec.lua
diff options
context:
space:
mode:
authorNanashi. <sevenc7c@sevenc7c.com>2026-02-09 21:19:50 +0900
committerGitHub <noreply@github.com>2026-02-09 07:19:50 -0500
commit7ee41a4b33c080b9bd29eef7a9fb57715f4c97e9 (patch)
tree12a0864436c3f30f97cb05686dada0ecb3703111 /test/functional/vimscript/screenrowcol_spec.lua
parente254688016a40366e33058d54628935b14bdcb24 (diff)
downloadrneovim-7ee41a4b33c080b9bd29eef7a9fb57715f4c97e9.tar.gz
rneovim-7ee41a4b33c080b9bd29eef7a9fb57715f4c97e9.tar.bz2
rneovim-7ee41a4b33c080b9bd29eef7a9fb57715f4c97e9.zip
test: add failing case for screenrow/screencol #37761
Diffstat (limited to 'test/functional/vimscript/screenrowcol_spec.lua')
-rw-r--r--test/functional/vimscript/screenrowcol_spec.lua65
1 files changed, 65 insertions, 0 deletions
diff --git a/test/functional/vimscript/screenrowcol_spec.lua b/test/functional/vimscript/screenrowcol_spec.lua
new file mode 100644
index 0000000000..ba9aea1cb0
--- /dev/null
+++ b/test/functional/vimscript/screenrowcol_spec.lua
@@ -0,0 +1,65 @@
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
+local Screen = require('test.functional.ui.screen')
+
+local clear, eq, api = n.clear, t.eq, n.api
+local command, fn = n.command, n.fn
+local feed = n.feed
+
+describe('screenrow() and screencol() function', function()
+ local function with_ext_multigrid(multigrid)
+ before_each(function()
+ clear()
+ Screen.new(41, 41, { ext_multigrid = multigrid })
+ end)
+
+ pending('works in floating window', function()
+ local opts = {
+ relative = 'editor',
+ height = 8,
+ width = 12,
+ row = 6,
+ col = 8,
+ anchor = 'NW',
+ style = 'minimal',
+ border = 'none',
+ focusable = 1,
+ }
+ local float = api.nvim_open_win(api.nvim_create_buf(false, true), false, opts)
+
+ api.nvim_set_current_win(float)
+ command('redraw')
+
+ eq(7, fn.screenrow())
+ eq(9, fn.screencol())
+ end)
+
+ pending('works in vertical split', function()
+ command('vsplit')
+ command('wincmd l') -- move to right split
+ feed('iA<CR>BC<ESC>') -- insert two lines
+ command('redraw')
+
+ eq(2, fn.screenrow())
+ eq(23, fn.screencol()) -- 20 (left) | 1 (border) | 2 (2nd col)
+ end)
+
+ pending('works in horizontal split', function()
+ command('split')
+ command('wincmd j') -- move to bottom split
+ feed('iA<CR>BC<ESC>') -- insert two lines
+ command('redraw')
+
+ eq(22, fn.screenrow()) -- 19 (top) | 1 (border) | 2 (2nd row) + 17 (rest) | 2 (cmd)
+ eq(2, fn.screencol())
+ end)
+ end
+
+ describe('with ext_multigrid', function()
+ with_ext_multigrid(true)
+ end)
+
+ describe('without ext_multigrid', function()
+ with_ext_multigrid(false)
+ end)
+end)