Mercurial > vim
diff src/testdir/test_lispindent.vim @ 30853:40df8a6515f6 v9.0.0761
patch 9.0.0761: cannot use 'indentexpr' for Lisp indenting
Commit: https://github.com/vim/vim/commit/49846fb1a31de99f49d6a7e70efe685197423c84
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Oct 15 16:05:33 2022 +0100
patch 9.0.0761: cannot use 'indentexpr' for Lisp indenting
Problem: Cannot use 'indentexpr' for Lisp indenting.
Solution: Add the 'lispoptions' option.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 15 Oct 2022 17:15:04 +0200 |
parents | 942f1b3bc694 |
children |
line wrap: on
line diff
--- a/src/testdir/test_lispindent.vim +++ b/src/testdir/test_lispindent.vim @@ -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