aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/float_spec.lua
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2019-04-08 12:26:30 +0200
committerBjörn Linse <bjorn.linse@gmail.com>2019-04-08 12:39:08 +0200
commit344c69b66b19c76a0a7e9f07f591f063317943d7 (patch)
treeba7c3a976abc2be1a032c03923164ff6fef79bf7 /test/functional/ui/float_spec.lua
parent11bf89e3b58be1dd534b4ea49b1988150cf7d4b8 (diff)
downloadrneovim-344c69b66b19c76a0a7e9f07f591f063317943d7.tar.gz
rneovim-344c69b66b19c76a0a7e9f07f591f063317943d7.tar.bz2
rneovim-344c69b66b19c76a0a7e9f07f591f063317943d7.zip
api/window: validate cursor in nvim_win_set_buf
validate_cursor() is called regularly, but only for the current window. When changing the buffer for a non-current window, we need to invoke it in the context of that window.
Diffstat (limited to 'test/functional/ui/float_spec.lua')
-rw-r--r--test/functional/ui/float_spec.lua60
1 files changed, 60 insertions, 0 deletions
diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua
index 4a89345ee5..b248bd8f6f 100644
--- a/test/functional/ui/float_spec.lua
+++ b/test/functional/ui/float_spec.lua
@@ -550,6 +550,66 @@ describe('floating windows', function()
end
end)
+ it('validates cursor even when window is not entered', function()
+ screen:try_resize(30,5)
+ command("set nowrap")
+ insert([[some text that is wider than the window]])
+ if multigrid then
+ screen:expect([[
+ ## grid 1
+ [2:------------------------------]|
+ [2:------------------------------]|
+ [2:------------------------------]|
+ [2:------------------------------]|
+ |
+ ## grid 2
+ that is wider than the windo^w |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ ]])
+ else
+ screen:expect([[
+ that is wider than the windo^w |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ |
+ ]])
+ end
+
+ local buf = meths.create_buf(false,true)
+ meths.buf_set_lines(buf, 0, -1, true, {'some floaty text'})
+ meths.open_win(buf, false, {relative='editor', width=20, height=1, row=3, col=1})
+ if multigrid then
+ screen:expect{grid=[[
+ ## grid 1
+ [2:------------------------------]|
+ [2:------------------------------]|
+ [2:------------------------------]|
+ [2:------------------------------]|
+ |
+ ## grid 2
+ that is wider than the windo^w |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ ## grid 4
+ {1:some floaty text }|
+ ]], float_pos={
+ [4] = {{id = 1002}, "NW", 1, 3, 1, true}
+ }}
+ else
+ screen:expect([[
+ that is wider than the windo^w |
+ {0:~ }|
+ {0:~ }|
+ {0:~}{1:some floaty text }{0: }|
+ |
+ ]])
+ end
+ end)
+
if multigrid then
pending("supports second UI without multigrid", function()
local session2 = helpers.connect(eval('v:servername'))