diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-04-01 20:12:20 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-04-01 20:14:01 +0800 |
commit | ef595e9b93c3841511d8511e11b001e4162a2998 (patch) | |
tree | 2367f938b1e7efea4850f4dea8dbb4ca6ef6192e /test/functional/ui/syntax_conceal_spec.lua | |
parent | 139828cc7ee807cb6680c87bb2cec1aa90e8b4fd (diff) | |
download | rneovim-ef595e9b93c3841511d8511e11b001e4162a2998.tar.gz rneovim-ef595e9b93c3841511d8511e11b001e4162a2998.tar.bz2 rneovim-ef595e9b93c3841511d8511e11b001e4162a2998.zip |
test: add a test for #13916
Diffstat (limited to 'test/functional/ui/syntax_conceal_spec.lua')
-rw-r--r-- | test/functional/ui/syntax_conceal_spec.lua | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/functional/ui/syntax_conceal_spec.lua b/test/functional/ui/syntax_conceal_spec.lua index 92e5a5dd94..9d10c55cb6 100644 --- a/test/functional/ui/syntax_conceal_spec.lua +++ b/test/functional/ui/syntax_conceal_spec.lua @@ -256,6 +256,40 @@ describe('Screen', function() ]]) end) end) -- a region of text (implicit concealing) + + it("cursor position is correct when entering Insert mode with cocu=ni #13916", function() + insert([[foobarfoobarfoobar]]) + -- move to end of line + feed("$") + command("set concealcursor=ni") + command("syn match Foo /foobar/ conceal cchar=&") + screen:expect([[ + {1:&&&}^ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + | + ]]) + feed("i") + -- cursor should stay in place, not jump to column 16 + screen:expect([[ + {1:&&&}^ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {4:-- INSERT --} | + ]]) + end) end) -- match and conceal describe("let the conceal level be", function() |