mirror of
https://github.com/neovim/neovim.git
synced 2025-12-15 19:05:40 +00:00
vim-patch:8.1.1967: line() only works for the current window
Problem: Line() only works for the current window.
Solution: Add an optional argument for the window to use.
8e0a8e7eb7
This commit is contained in:
@@ -64,10 +64,13 @@ describe('float window', function()
|
||||
|
||||
it('win_execute() should work' , function()
|
||||
local buf = meths.create_buf(false, false)
|
||||
meths.buf_set_lines(buf, 0, -1, true, {'the floatwin'})
|
||||
meths.buf_set_lines(buf, 0, -1, true, {'the floatwin', 'abc', 'def'})
|
||||
local win = meths.open_win(buf, false, {relative='win', width=16, height=1, row=0, col=10})
|
||||
local line = funcs.win_execute(win, 'echo getline(1)')
|
||||
eq('\nthe floatwin', line)
|
||||
eq('\n1', funcs.win_execute(win, 'echo line(".",'..win.id..')'))
|
||||
eq('\n3', funcs.win_execute(win, 'echo line("$",'..win.id..')'))
|
||||
eq('\n0', funcs.win_execute(win, 'echo line("$", 123456)'))
|
||||
funcs.win_execute(win, 'bwipe!')
|
||||
end)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user