diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-01-22 13:39:08 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-01-22 13:39:08 +0000 |
commit | 9530b580a7b71960dbbdb2b12a3aafeb540bd135 (patch) | |
tree | 5e169ea9710cf9d3e1f9dade5ff223c2850a7d59 /src/testdir/test_vim9_import.vim | |
parent | 0bfa84916d110d4f4d863e91e144ff05ba431316 (diff) |
patch 8.2.4179: 'foldtext' is evaluated in the current script contextv8.2.4179
Problem: 'foldtext' is evaluated in the current script context.
Solution: Use the script context where the option was set.
Diffstat (limited to 'src/testdir/test_vim9_import.vim')
-rw-r--r-- | src/testdir/test_vim9_import.vim | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/testdir/test_vim9_import.vim b/src/testdir/test_vim9_import.vim index df22a7719c..3608802b19 100644 --- 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_expression() 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_expression() 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_expression() edit! otherfile redraw - set foldexpr= foldmethod& debug= + set foldexpr= foldtext& foldmethod& debug= bwipe! delete('Xdir', 'rf') &rtp = save_rtp |