diff src/testdir/test_display.vim @ 23964:17697c4e5d48 v8.2.2524

patch 8.2.2524: cannot change the characters displayed in the foldcolumn Commit: https://github.com/vim/vim/commit/3aca5a6fbcfbf5f4492b9ea0c4308ac524d33606 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Feb 17 13:14:07 2021 +0100 patch 8.2.2524: cannot change the characters displayed in the foldcolumn Problem: Cannot change the characters displayed in the foldcolumn. Solution: Add fields to 'fillchars'. (Yegappan Lakshmanan, Matthieu Coudron, closes #7860)
author Bram Moolenaar <Bram@vim.org>
date Wed, 17 Feb 2021 13:15:03 +0100
parents 4549133c1e77
children dafaa9c80334
line wrap: on
line diff
--- a/src/testdir/test_display.vim
+++ b/src/testdir/test_display.vim
@@ -279,4 +279,58 @@ func Test_eob_fillchars()
   close
 endfunc
 
+" Test for 'foldopen', 'foldclose' and 'foldsep' in 'fillchars'
+func Test_fold_fillchars()
+  new
+  set fdc=2 foldenable foldmethod=manual
+  call setline(1, ['one', 'two', 'three', 'four', 'five'])
+  2,4fold
+  " First check for the default setting for a closed fold
+  let lines = ScreenLines([1, 3], 8)
+  let expected = [
+        \ '  one   ',
+        \ '+ +--  3',
+        \ '  five  '
+        \ ]
+  call assert_equal(expected, lines)
+  normal 2Gzo
+  " check the characters for an open fold
+  let lines = ScreenLines([1, 5], 8)
+  let expected = [
+        \ '  one   ',
+        \ '- two   ',
+        \ '| three ',
+        \ '| four  ',
+        \ '  five  '
+        \ ]
+  call assert_equal(expected, lines)
+
+  " change the setting
+  set fillchars=vert:\|,fold:-,eob:~,foldopen:[,foldclose:],foldsep:-
+
+  " check the characters for an open fold
+  let lines = ScreenLines([1, 5], 8)
+  let expected = [
+        \ '  one   ',
+        \ '[ two   ',
+        \ '- three ',
+        \ '- four  ',
+        \ '  five  '
+        \ ]
+  call assert_equal(expected, lines)
+
+  " check the characters for a closed fold
+  normal 2Gzc
+  let lines = ScreenLines([1, 3], 8)
+  let expected = [
+        \ '  one   ',
+        \ '] +--  3',
+        \ '  five  '
+        \ ]
+  call assert_equal(expected, lines)
+
+  %bw!
+  set fillchars& fdc& foldmethod& foldenable&
+endfunc
+
 " vim: shiftwidth=2 sts=2 expandtab