diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-05-07 08:34:28 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-07 08:34:28 -0400 |
commit | 5165513198dbbe7415f1b8c51225ae8f822628ec (patch) | |
tree | 3ed35d03f4a1c606ec33a18ee878d61138efbaf2 /test/functional/ui/float_spec.lua | |
parent | 4be0e92db01a502863ac4bb26dd0fee16d833145 (diff) | |
parent | 1def3d1542d6a65f057e743faea39a760b50db87 (diff) | |
download | rneovim-5165513198dbbe7415f1b8c51225ae8f822628ec.tar.gz rneovim-5165513198dbbe7415f1b8c51225ae8f822628ec.tar.bz2 rneovim-5165513198dbbe7415f1b8c51225ae8f822628ec.zip |
Merge pull request #13664 from ivechan/win_exectute
vim-patch:8.1.{1418,1425,1832,2124},8.2.{0137, 2340}
Diffstat (limited to 'test/functional/ui/float_spec.lua')
-rw-r--r-- | test/functional/ui/float_spec.lua | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua index cd3bea6595..66aaf0c941 100644 --- a/test/functional/ui/float_spec.lua +++ b/test/functional/ui/float_spec.lua @@ -62,6 +62,24 @@ describe('float window', function() eq(1000, funcs.win_getid()) end) + it('win_execute() should work' , function() + local buf = meths.create_buf(false, false) + meths.buf_set_lines(buf, 0, -1, true, {'the floatwin'}) + 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) + funcs.win_execute(win, 'bwipe!') + end) + + it('win_execute() call commands that not allowed' , function() + local buf = meths.create_buf(false, false) + meths.buf_set_lines(buf, 0, -1, true, {'the floatwin'}) + local win = meths.open_win(buf, true, {relative='win', width=16, height=1, row=0, col=10}) + eq(pcall_err(funcs.win_execute, win, 'close'), 'Vim(close):E37: No write since last change (add ! to override)') + eq(pcall_err(funcs.win_execute, win, 'bdelete'), 'Vim(bdelete):E89: No write since last change for buffer 2 (add ! to override)') + funcs.win_execute(win, 'bwipe!') + end) + it('closed immediately by autocmd #11383', function() eq('Error executing lua: [string "<nvim>"]:0: Window was closed immediately', pcall_err(exec_lua, [[ |