aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_lispindent.vim
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-10-16 08:06:07 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-10-16 08:34:55 +0800
commit19eb7054ff7b1fbc78e56e7f9ed6537b085147bc (patch)
treef10b35a7a415ebd3cbfc3b944aec96e65892becc /src/nvim/testdir/test_lispindent.vim
parentbc798dfd8cea9a5f93461e05dcb8409b6d96afc0 (diff)
downloadrneovim-19eb7054ff7b1fbc78e56e7f9ed6537b085147bc.tar.gz
rneovim-19eb7054ff7b1fbc78e56e7f9ed6537b085147bc.tar.bz2
rneovim-19eb7054ff7b1fbc78e56e7f9ed6537b085147bc.zip
vim-patch:9.0.0761: cannot use 'indentexpr' for Lisp indenting
Problem: Cannot use 'indentexpr' for Lisp indenting. Solution: Add the 'lispoptions' option. https://github.com/vim/vim/commit/49846fb1a31de99f49d6a7e70efe685197423c84 vim-patch:9.0.0762: build failure Problem: Build failure. Solution: Add missing change. https://github.com/vim/vim/commit/4b082c4bd05f504fda1acaa9d28fca55a2d04857
Diffstat (limited to 'src/nvim/testdir/test_lispindent.vim')
-rw-r--r--src/nvim/testdir/test_lispindent.vim15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_lispindent.vim b/src/nvim/testdir/test_lispindent.vim
index 8987f67a80..2d6060bba3 100644
--- a/src/nvim/testdir/test_lispindent.vim
+++ b/src/nvim/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