mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-03 20:10:10 -04:00
tests(indent): also test creating new line when still in insert mode
This commit is contained in:
parent
9940e48675
commit
fc54020531
1 changed files with 11 additions and 0 deletions
|
|
@ -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 = {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue