From 0476f049f4f259cf172e0390f4dc655209ea0c34 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 20 Dec 2020 16:51:00 -0500 Subject: vim-patch:8.2.0686: formatoptions not sufficiently tested Problem: Formatoptions not sufficiently tested. Solution: Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#6031) https://github.com/vim/vim/commit/2eaeaf3c317a5145fb0bc926411561d50883019b Cherry-pick Test_fo_a_w() from patch v8.2.0482. --- src/nvim/testdir/test_normal.vim | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/nvim/testdir/test_normal.vim') diff --git a/src/nvim/testdir/test_normal.vim b/src/nvim/testdir/test_normal.vim index ad6d325510..7a846e5ea0 100644 --- a/src/nvim/testdir/test_normal.vim +++ b/src/nvim/testdir/test_normal.vim @@ -222,6 +222,21 @@ func Test_normal05_formatexpr_setopt() set formatexpr= endfunc +" When 'formatexpr' returns non-zero, internal formatting is used. +func Test_normal_formatexpr_returns_nonzero() + new + call setline(1, ['one', 'two']) + func! Format() + return 1 + endfunc + setlocal formatexpr=Format() + normal VGgq + call assert_equal(['one two'], getline(1, '$')) + setlocal formatexpr= + delfunc Format + close! +endfunc + func Test_normal06_formatprg() " basic test for formatprg " only test on non windows platform -- cgit