diff src/testdir/test_vim9_import.vim @ 27301:ebe56a24acb6 v8.2.4179

patch 8.2.4179: 'foldtext' is evaluated in the current script context Commit: https://github.com/vim/vim/commit/9530b580a7b71960dbbdb2b12a3aafeb540bd135 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jan 22 13:39:08 2022 +0000 patch 8.2.4179: 'foldtext' is evaluated in the current script context Problem: 'foldtext' is evaluated in the current script context. Solution: Use the script context where the option was set.
author Bram Moolenaar <Bram@vim.org>
date Sat, 22 Jan 2022 14:45:02 +0100
parents f7cb41ff22a4
children 30d8437ad7cc
line wrap: on
line diff
--- a/src/testdir/test_vim9_import.vim
+++ b/src/testdir/test_vim9_import.vim
@@ -683,6 +683,9 @@ def Test_use_autoload_import_in_fold_exp
       export def Expr(): string
         return getline(v:lnum) =~ '^#' ? '>1' : '1'
       enddef
+      export def Text(): string
+        return 'fold text'
+      enddef
       g:fold_loaded = 'yes'
   END
   writefile(lines, 'Xdir/autoload/fold.vim')
@@ -691,6 +694,7 @@ def Test_use_autoload_import_in_fold_exp
       vim9script
       import autoload 'fold.vim'
       &foldexpr = 'fold.Expr()'
+      &foldtext = 'fold.Text()'
       &foldmethod = 'expr'
       &debug = 'throw'
   END
@@ -706,7 +710,7 @@ def Test_use_autoload_import_in_fold_exp
   edit! otherfile
   redraw
 
-  set foldexpr= foldmethod& debug=
+  set foldexpr= foldtext& foldmethod& debug=
   bwipe!
   delete('Xdir', 'rf')
   &rtp = save_rtp