diff options
author | Josh Rahm <rahm@google.com> | 2022-07-18 19:37:18 +0000 |
---|---|---|
committer | Josh Rahm <rahm@google.com> | 2022-07-18 19:37:18 +0000 |
commit | 308e1940dcd64aa6c344c403d4f9e0dda58d9c5c (patch) | |
tree | 35fe43e01755e0f312650667004487a44d6b7941 /test/functional/options/cursorbind_spec.lua | |
parent | 96a00c7c588b2f38a2424aeeb4ea3581d370bf2d (diff) | |
parent | e8c94697bcbe23a5c7b07c292b90a6b70aadfa87 (diff) | |
download | rneovim-308e1940dcd64aa6c344c403d4f9e0dda58d9c5c.tar.gz rneovim-308e1940dcd64aa6c344c403d4f9e0dda58d9c5c.tar.bz2 rneovim-308e1940dcd64aa6c344c403d4f9e0dda58d9c5c.zip |
Merge remote-tracking branch 'upstream/master' into rahm
Diffstat (limited to 'test/functional/options/cursorbind_spec.lua')
-rw-r--r-- | test/functional/options/cursorbind_spec.lua | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/test/functional/options/cursorbind_spec.lua b/test/functional/options/cursorbind_spec.lua new file mode 100644 index 0000000000..1a03ed099a --- /dev/null +++ b/test/functional/options/cursorbind_spec.lua @@ -0,0 +1,91 @@ +local helpers = require('test.functional.helpers')(after_each) +local Screen = require('test.functional.ui.screen') +local clear = helpers.clear +local command = helpers.command +local exec = helpers.exec +local feed = helpers.feed + +before_each(clear) + +describe("'cursorbind'", function() + it("behaves consistently whether 'cursorline' is set or not vim-patch:8.2.4795", function() + local screen = Screen.new(60, 8) + screen:set_default_attr_ids({ + [1] = {bold = true, foreground = Screen.colors.Blue}, -- NonText + [2] = {bold = true, reverse = true}, -- StatusLine + [3] = {reverse = true}, -- StatusLineNC + [4] = {background = Screen.colors.Grey90}, -- CursorLine, CursorColumn + }) + screen:attach() + exec([[ + call setline(1, 'aa bb cc dd ee ff gg hh ii jj kk ll mm' .. + \ ' nn oo pp qq rr ss tt uu vv ww xx yy zz') + set nowrap + " The following makes the cursor apparent on the screen dump + set sidescroll=1 cursorcolumn + " add empty lines, required for cursorcolumn + call append(1, ['','','','']) + 20vsp + windo :set cursorbind + ]]) + feed('20l') + screen:expect([[ + a bb cc dd ee ff gg │aa bb cc dd ee ff gg^ hh ii jj kk ll mm | + {4: }│ {4: } | + {4: }│ {4: } | + {4: }│ {4: } | + {4: }│ {4: } | + {1:~ }│{1:~ }| + {3:[No Name] [+] }{2:[No Name] [+] }| + | + ]]) + feed('10l') + screen:expect([[ + hh ii jj kk ll mm n│aa bb cc dd ee ff gg hh ii jj ^kk ll mm | + {4: } │ {4: } | + {4: } │ {4: } | + {4: } │ {4: } | + {4: } │ {4: } | + {1:~ }│{1:~ }| + {3:[No Name] [+] }{2:[No Name] [+] }| + | + ]]) + command('windo :set cursorline') + feed('0') + feed('20l') + screen:expect([[ + {4:a bb cc dd ee ff gg }│{4:aa bb cc dd ee ff gg^ hh ii jj kk ll mm }| + {4: }│ {4: } | + {4: }│ {4: } | + {4: }│ {4: } | + {4: }│ {4: } | + {1:~ }│{1:~ }| + {3:[No Name] [+] }{2:[No Name] [+] }| + | + ]]) + feed('10l') + screen:expect([[ + {4: hh ii jj kk ll mm n}│{4:aa bb cc dd ee ff gg hh ii jj ^kk ll mm }| + {4: } │ {4: } | + {4: } │ {4: } | + {4: } │ {4: } | + {4: } │ {4: } | + {1:~ }│{1:~ }| + {3:[No Name] [+] }{2:[No Name] [+] }| + | + ]]) + command('windo :set nocursorline nocursorcolumn') + feed('0') + feed('40l') + screen:expect([[ + kk ll mm nn oo pp qq│ bb cc dd ee ff gg hh ii jj kk ll mm n^n| + │ | + │ | + │ | + │ | + {1:~ }│{1:~ }| + {3:[No Name] [+] }{2:[No Name] [+] }| + | + ]]) + end) +end) |