aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/float_spec.lua
diff options
context:
space:
mode:
authorSean Dewar <seandewar@users.noreply.github.com>2023-04-17 17:32:32 +0100
committerSean Dewar <seandewar@users.noreply.github.com>2023-04-17 18:38:31 +0100
commit7095f8ff9d9ce3519abe34a3da4c8f4bdc3fc865 (patch)
treeb5dbcc244f5ae81581cbc77cd6d9309717dba9e3 /test/functional/ui/float_spec.lua
parent9e5f9c25d9955f8c0ab7de874cf3a40fc077458b (diff)
downloadrneovim-7095f8ff9d9ce3519abe34a3da4c8f4bdc3fc865.tar.gz
rneovim-7095f8ff9d9ce3519abe34a3da4c8f4bdc3fc865.tar.bz2
rneovim-7095f8ff9d9ce3519abe34a3da4c8f4bdc3fc865.zip
vim-patch:9.0.1461: ruler not drawn correctly when using 'rulerformat'
Problem: Ruler not drawn correctly when using 'rulerformat'. Solution: Adjust formatting depending on whether the ruler is drawn in the statusline or the command line. (Sean Dewar, closes vim/vim#12246) https://github.com/vim/vim/commit/fc8a601c3251c0388a88c1235b18c529385f7196 This issue was made apparent after neovim/neovim@0f1e2b6, as `showmode()` calls `win_redr_ruler()` with `curwin` now if it's floating, rather than the last window if there's no statusline (which usually already shares its right side with that of the editor). Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com>
Diffstat (limited to 'test/functional/ui/float_spec.lua')
-rw-r--r--test/functional/ui/float_spec.lua45
1 files changed, 45 insertions, 0 deletions
diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua
index 3203b187cc..0e1842d087 100644
--- a/test/functional/ui/float_spec.lua
+++ b/test/functional/ui/float_spec.lua
@@ -2295,6 +2295,51 @@ describe('float window', function()
end
end)
+ it("correct ruler position in current float with 'rulerformat' set", function()
+ command 'set ruler rulerformat=fish:<><'
+ meths.open_win(0, true, {relative='editor', width=9, height=3, row=0, col=5})
+ if multigrid then
+ screen:expect{grid=[[
+ ## grid 1
+ [2:----------------------------------------]|
+ [2:----------------------------------------]|
+ [2:----------------------------------------]|
+ [2:----------------------------------------]|
+ [2:----------------------------------------]|
+ [2:----------------------------------------]|
+ [3:----------------------------------------]|
+ ## grid 2
+ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ ## grid 3
+ fish:<>< |
+ ## grid 4
+ {1:^ }|
+ {2:~ }|
+ {2:~ }|
+ ]], float_pos={
+ [4] = {{id = 1001}, "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};
+ [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0};
+ }}
+ else
+ screen:expect{grid=[[
+ {1:^ } |
+ {0:~ }{2:~ }{0: }|
+ {0:~ }{2:~ }{0: }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ fish:<>< |
+ ]]}
+ end
+ end)
+
it('can have minimum size', function()
insert("the background text")
local buf = meths.create_buf(false, true)