Mercurial > vim
comparison src/testdir/test_vim9_script.vim @ 29475:fab3a46d0af7 v9.0.0079
patch 9.0.0079: error in autoload script not reported for 'foldexpr'
Commit: https://github.com/vim/vim/commit/6809ff978a5c5b798952db9fa663df9e1776f3ff
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jul 26 15:10:56 2022 +0100
patch 9.0.0079: error in autoload script not reported for 'foldexpr'
Problem: Error in autoload script not reported for 'foldexpr'.
Solution: Reset "emsg_off" when auto-loading a script. (closes https://github.com/vim/vim/issues/10685)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 26 Jul 2022 16:15:03 +0200 |
parents | 11609f025219 |
children | 9d54c8e6c682 |
comparison
equal
deleted
inserted
replaced
29474:1101803eb1fa | 29475:fab3a46d0af7 |
---|---|
3436 END | 3436 END |
3437 v9.CheckScriptSuccess(lines) | 3437 v9.CheckScriptSuccess(lines) |
3438 | 3438 |
3439 &rtp = save_rtp | 3439 &rtp = save_rtp |
3440 delete(dir, 'rf') | 3440 delete(dir, 'rf') |
3441 enddef | |
3442 | |
3443 def Test_error_in_autoload_script_foldexpr() | |
3444 var save_rtp = &rtp | |
3445 mkdir('Xvim/autoload', 'p') | |
3446 &runtimepath = 'Xvim' | |
3447 | |
3448 var lines =<< trim END | |
3449 vim9script | |
3450 eval [][0] | |
3451 echomsg 'no error' | |
3452 END | |
3453 lines->writefile('Xvim/autoload/script.vim') | |
3454 | |
3455 lines =<< trim END | |
3456 vim9script | |
3457 import autoload 'script.vim' | |
3458 &foldmethod = 'expr' | |
3459 &foldexpr = 'script.Func()' | |
3460 redraw | |
3461 END | |
3462 v9.CheckScriptFailure(lines, 'E684: List index out of range: 0') | |
3463 | |
3464 delete('Xvim', 'rf') | |
3441 enddef | 3465 enddef |
3442 | 3466 |
3443 def Test_invalid_sid() | 3467 def Test_invalid_sid() |
3444 assert_fails('func <SNR>1234_func', 'E123:') | 3468 assert_fails('func <SNR>1234_func', 'E123:') |
3445 | 3469 |