commit d9e5737fdceebe17da52d5c9b41db21259449c19
parent 04ba37773e5755375f4fa3f5af23cbbdb5eb5fc8
Author: zeertzjq <zeertzjq@outlook.com>
Date: Tue, 5 Jul 2022 15:09:02 +0800
vim-patch:8.2.5122: lisp indenting my run over the end of the line
Problem: Lisp indenting my run over the end of the line.
Solution: Check for NUL earlier.
https://github.com/vim/vim/commit/0e8e938d497260dd57be67b4966cb27a5f72376f
Diffstat:
2 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/src/nvim/indent.c b/src/nvim/indent.c
@@ -656,6 +656,9 @@ int get_lisp_indent(void)
}
}
}
+ if (*that == NUL) {
+ break;
+ }
}
if ((*that == '(') || (*that == '[')) {
parencount++;
diff --git a/src/nvim/testdir/test_indent.vim b/src/nvim/testdir/test_indent.vim
@@ -144,6 +144,16 @@ func Test_lisp_indent()
close!
endfunc
+func Test_lisp_indent_quoted()
+ " This was going past the end of the line
+ new
+ setlocal lisp autoindent
+ call setline(1, ['"[', '='])
+ normal Gvk=
+
+ bwipe!
+endfunc
+
" Test for setting the 'indentexpr' from a modeline
func Test_modeline_indent_expr()
let modeline = &modeline