commit ef595e9b93c3841511d8511e11b001e4162a2998 parent 139828cc7ee807cb6680c87bb2cec1aa90e8b4fd Author: zeertzjq <zeertzjq@outlook.com> Date: Fri, 1 Apr 2022 20:12:20 +0800 test: add a test for #13916 Diffstat:
| M | test/functional/ui/syntax_conceal_spec.lua | | | 34 | ++++++++++++++++++++++++++++++++++ |
1 file changed, 34 insertions(+), 0 deletions(-)
diff --git 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()