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:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user