diff options
Diffstat (limited to 'tests/indent/common.lua')
| -rw-r--r-- | tests/indent/common.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/indent/common.lua b/tests/indent/common.lua index c9f91214e..451d2f626 100644 --- a/tests/indent/common.lua +++ b/tests/indent/common.lua @@ -140,6 +140,17 @@ function M.indent_new_line(file, spec, opts, xfail) table.insert(before, spec.on_line + 1, indent .. spec.text) compare_indent(before, after, xfail) + + before, after = M.run_indent_test(file, function() + -- move to the line and input the new one + vim.cmd(string.format("normal! %dG$", spec.on_line)) + vim.cmd(string.format(vim.api.nvim_replace_termcodes("normal! a<cr>%s", true, true, true), spec.text)) + end, opts) + + indent = type(spec.indent) == "string" and spec.indent or string.rep(" ", spec.indent) + table.insert(before, spec.on_line + 1, indent .. spec.text) + + compare_indent(before, after, xfail) end local Runner = {} |
