0
0
mirror of https://github.com/vim/vim.git synced 2025-10-02 05:04:20 -04:00

patch 9.0.0761: cannot use 'indentexpr' for Lisp indenting

Problem:    Cannot use 'indentexpr' for Lisp indenting.
Solution:   Add the 'lispoptions' option.
This commit is contained in:
Bram Moolenaar
2022-10-15 16:05:33 +01:00
parent 297164cb79
commit 49846fb1a3
11 changed files with 95 additions and 24 deletions

View File

@@ -97,8 +97,23 @@ func Test_lispindent_with_indentexpr()
exe "normal a(x\<CR>1\<CR>2)\<Esc>"
let expected = ['(x', ' 1', ' 2)']
call assert_equal(expected, getline(1, 3))
" with Lisp indenting the first line is not indented
normal 1G=G
call assert_equal(expected, getline(1, 3))
%del
setl lispoptions=expr:1 indentexpr=5
exe "normal a(x\<CR>1\<CR>2)\<Esc>"
let expected_expr = ['(x', ' 1', ' 2)']
call assert_equal(expected_expr, getline(1, 3))
normal 2G2<<=G
call assert_equal(expected_expr, getline(1, 3))
setl lispoptions=expr:0
" with Lisp indenting the first line is not indented
normal 1G3<<=G
call assert_equal(expected, getline(1, 3))
bwipe!
endfunc