aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/float_spec.lua
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2023-03-13 20:38:21 +0100
committerbfredl <bjorn.linse@gmail.com>2023-03-14 11:01:45 +0100
commit0f1e2b6686694d878795fa090d4a08ba0f8acb4d (patch)
treefa53e1ecbce1699fa3cb91fcb8d1a463ac748372 /test/functional/ui/float_spec.lua
parentf01f18cdf4ffc3ce035db5fde2f45493eebb7fd9 (diff)
downloadrneovim-0f1e2b6686694d878795fa090d4a08ba0f8acb4d.tar.gz
rneovim-0f1e2b6686694d878795fa090d4a08ba0f8acb4d.tar.bz2
rneovim-0f1e2b6686694d878795fa090d4a08ba0f8acb4d.zip
fix(screen): redraw the ruler for a current floating window
Semi-regression. The "ruler" behavior for a floating window was never really specified but in practice followed the users cursor movements in normal mode in a focused float, which seems like a reasonable behavior to now specify.
Diffstat (limited to 'test/functional/ui/float_spec.lua')
-rw-r--r--test/functional/ui/float_spec.lua92
1 files changed, 92 insertions, 0 deletions
diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua
index bae83537e5..5916c8e238 100644
--- a/test/functional/ui/float_spec.lua
+++ b/test/functional/ui/float_spec.lua
@@ -2184,6 +2184,98 @@ describe('float window', function()
end
end)
+ it('show ruler of current floating window', function()
+ command 'set ruler'
+ local buf = meths.create_buf(false, false)
+ meths.buf_set_lines(buf, 0, -1, true, {'aaa aab ',
+ 'abb acc '})
+ meths.open_win(buf, true, {relative='editor', width=9, height=3, row=0, col=5})
+ feed 'gg'
+
+ if multigrid then
+ screen:expect{grid=[[
+ ## grid 1
+ [2:----------------------------------------]|
+ [2:----------------------------------------]|
+ [2:----------------------------------------]|
+ [2:----------------------------------------]|
+ [2:----------------------------------------]|
+ [2:----------------------------------------]|
+ [3:----------------------------------------]|
+ ## grid 2
+ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ ## grid 3
+ 1,1 All |
+ ## grid 5
+ {1:^aaa aab }|
+ {1:abb acc }|
+ {2:~ }|
+ ]], float_pos={
+ [5] = {{id = 1002}, "NW", 1, 0, 5, true, 50};
+ }, win_viewport={
+ [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0};
+ [5] = {win = {id = 1002}, topline = 0, botline = 3, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0};
+ }}
+ else
+ screen:expect{grid=[[
+ {1:^aaa aab } |
+ {0:~ }{1:abb acc }{0: }|
+ {0:~ }{2:~ }{0: }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ 1,1 All |
+ ]]}
+ end
+
+ feed 'w'
+ if multigrid then
+ screen:expect{grid=[[
+ ## grid 1
+ [2:----------------------------------------]|
+ [2:----------------------------------------]|
+ [2:----------------------------------------]|
+ [2:----------------------------------------]|
+ [2:----------------------------------------]|
+ [2:----------------------------------------]|
+ [3:----------------------------------------]|
+ ## grid 2
+ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ ## grid 3
+ 1,5 All |
+ ## grid 5
+ {1:aaa ^aab }|
+ {1:abb acc }|
+ {2:~ }|
+ ]], float_pos={
+ [5] = {{id = 1002}, "NW", 1, 0, 5, true, 50};
+ }, win_viewport={
+ [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0};
+ [5] = {win = {id = 1002}, topline = 0, botline = 3, curline = 0, curcol = 4, linecount = 2, sum_scroll_delta = 0};
+ }}
+ else
+ screen:expect{grid=[[
+ {1:aaa ^aab } |
+ {0:~ }{1:abb acc }{0: }|
+ {0:~ }{2:~ }{0: }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ 1,5 All |
+ ]]}
+ end
+ end)
+
it('can have minimum size', function()
insert("the background text")
local buf = meths.create_buf(false, true)