diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/legacy/cmdline_spec.lua | 19 | ||||
-rw-r--r-- | test/functional/ui/float_spec.lua | 45 | ||||
-rw-r--r-- | test/old/testdir/test_cmdline.vim | 13 |
3 files changed, 77 insertions, 0 deletions
diff --git a/test/functional/legacy/cmdline_spec.lua b/test/functional/legacy/cmdline_spec.lua index 2fceb6a132..f7df6ae8d7 100644 --- a/test/functional/legacy/cmdline_spec.lua +++ b/test/functional/legacy/cmdline_spec.lua @@ -239,6 +239,25 @@ describe('cmdline', function() | ]]) end) + + -- oldtest: Test_rulerformat_position() + it("ruler has correct position with 'rulerformat' set", function() + local screen = Screen.new(20, 3) + screen:set_default_attr_ids { + [0] = {bold = true, foreground = Screen.colors.Blue}, -- NonText + } + screen:attach() + meths.set_option('ruler', true) + meths.set_option('rulerformat', 'longish') + meths.set_option('laststatus', 0) + meths.set_option('winwidth', 1) + feed [[<C-W>v<C-W>|<C-W>p]] + screen:expect [[ + │^ | + {0:~ }│{0:~}| + longish | + ]] + end) end) describe('cmdwin', function() 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) diff --git a/test/old/testdir/test_cmdline.vim b/test/old/testdir/test_cmdline.vim index 0c6464ae80..9d506a66c0 100644 --- a/test/old/testdir/test_cmdline.vim +++ b/test/old/testdir/test_cmdline.vim @@ -3599,4 +3599,17 @@ func Test_setcmdline() cunmap a endfunc +func Test_rulerformat_position() + CheckScreendump + + let buf = RunVimInTerminal('', #{rows: 2, cols: 20}) + call term_sendkeys(buf, ":set ruler rulerformat=longish\<CR>") + call term_sendkeys(buf, ":set laststatus=0 winwidth=1\<CR>") + call term_sendkeys(buf, "\<C-W>v\<C-W>|\<C-W>p") + call VerifyScreenDump(buf, 'Test_rulerformat_position', {}) + + " clean up + call StopVimInTerminal(buf) +endfunc + " vim: shiftwidth=2 sts=2 expandtab |