diff options
author | Sean Dewar <seandewar@users.noreply.github.com> | 2023-04-18 10:01:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-18 10:01:42 +0100 |
commit | 9033d5eccc505d31b4a95d9fd23a7e2a8d2f282c (patch) | |
tree | 70b76b061e9b54c57baa2ea17b5e2e6f74612e79 /test/functional/ui/statusline_spec.lua | |
parent | d4eff4052a29079e108b5efcb030f07643978994 (diff) | |
parent | 65dd3c1180cef5ec15a46bd278ab3a0cb1c3460d (diff) | |
download | rneovim-9033d5eccc505d31b4a95d9fd23a7e2a8d2f282c.tar.gz rneovim-9033d5eccc505d31b4a95d9fd23a7e2a8d2f282c.tar.bz2 rneovim-9033d5eccc505d31b4a95d9fd23a7e2a8d2f282c.zip |
Merge pull request #23005 from seandewar/fix-ruf-cmdline-pos
fix(ruler): fix some ruler issues with no statusline
Diffstat (limited to 'test/functional/ui/statusline_spec.lua')
-rw-r--r-- | test/functional/ui/statusline_spec.lua | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/test/functional/ui/statusline_spec.lua b/test/functional/ui/statusline_spec.lua index 8e301dc70c..c41d4983a7 100644 --- a/test/functional/ui/statusline_spec.lua +++ b/test/functional/ui/statusline_spec.lua @@ -653,3 +653,62 @@ it('ruler is redrawn in cmdline with redrawstatus #22804', function() other value | ]]) end) + +it("shows correct ruler in cmdline with no statusline", function() + clear() + local screen = Screen.new(30, 8) + screen:set_default_attr_ids { + [1] = {bold = true, foreground = Screen.colors.Blue}, -- NonText + [2] = {bold = true, reverse = true}, -- StatusLine + [3] = {reverse = true}, -- StatusLineNC + } + screen:attach() + -- Use long ruler to check 'ruler' with 'rulerformat' set has correct width. + command [[ + set ruler rulerformat=%{winnr()}longlonglong ls=0 winwidth=10 + split + wincmd b + vsplit + wincmd t + wincmd | + mode + ]] + -- Window 1 is current. It has a statusline, so cmdline should show the + -- last window's ruler, which has no statusline. + command '1wincmd w' + screen:expect [[ + ^ | + {1:~ }| + {1:~ }| + {2:[No Name] 1longlonglong }| + │ | + {1:~ }│{1:~ }| + {1:~ }│{1:~ }| + 3longlonglong | + ]] + -- Window 2 is current. It has no statusline, so cmdline should show its + -- ruler instead. + command '2wincmd w' + screen:expect [[ + | + {1:~ }| + {1:~ }| + {3:[No Name] 1longlonglong }| + ^ │ | + {1:~ }│{1:~ }| + {1:~ }│{1:~ }| + 2longlonglong | + ]] + -- Window 3 is current. Cmdline should again show its ruler. + command '3wincmd w' + screen:expect [[ + | + {1:~ }| + {1:~ }| + {3:[No Name] 1longlonglong }| + │^ | + {1:~ }│{1:~ }| + {1:~ }│{1:~ }| + 3longlonglong | + ]] +end) |