diff src/testdir/test_fold.vim @ 28938:ddbb36c1830b v8.2.4991

patch 8.2.4991: no test for hwat patch 8.1.0535 fixes Commit: https://github.com/vim/vim/commit/93c1573dd284dc9cf5ed9265a0143aaf520d2920 Author: zeertzjq <zeertzjq@outlook.com> Date: Sat May 21 16:34:38 2022 +0100 patch 8.2.4991: no test for hwat patch 8.1.0535 fixes Problem: No test for hwat patch 8.1.0535 fixes. Solution: Add a test. (closes https://github.com/vim/vim/issues/10462)
author Bram Moolenaar <Bram@vim.org>
date Sat, 21 May 2022 17:45:03 +0200
parents 2ac9beab876c
children 65946c949965
line wrap: on
line diff
--- a/src/testdir/test_fold.vim
+++ b/src/testdir/test_fold.vim
@@ -231,6 +231,26 @@ func Test_update_folds_expr_read()
   set foldmethod& foldexpr&
 endfunc
 
+" Test for what patch 8.1.0535 fixes.
+func Test_foldexpr_no_interrupt_addsub()
+  new
+  func! FoldFunc()
+    call setpos('.', getcurpos())
+    return '='
+  endfunc
+
+  set foldmethod=expr
+  set foldexpr=FoldFunc()
+  call setline(1, '1.2')
+
+  exe "norm! $\<C-A>"
+  call assert_equal('1.3', getline(1))
+
+  bwipe!
+  delfunc FoldFunc
+  set foldmethod& foldexpr&
+endfunc
+
 func Check_foldlevels(expected)
   call assert_equal(a:expected, map(range(1, line('$')), 'foldlevel(v:val)'))
 endfunc