0
0
mirror of https://github.com/vim/vim.git synced 2025-10-28 09:27:14 -04:00

patch 8.2.4841: empty string considered an error for expand()

Problem:    Empty string considered an error for expand() when 'verbose' is
            set. (Christian Brabandt)
Solution:   Do not give an error for an empty result. (closes #10307)
This commit is contained in:
Bram Moolenaar
2022-04-28 17:52:24 +01:00
parent 05c7f5d3d0
commit a96edb736d
6 changed files with 15 additions and 8 deletions

View File

@@ -82,10 +82,14 @@ endfunc
func Test_expand()
new
call assert_equal("", expand('%:S'))
call assert_equal("''", expand('%:S'))
call assert_equal('3', '<slnum>'->expand())
call assert_equal(['4'], expand('<slnum>', v:false, v:true))
" Don't add any line above this, otherwise <slnum> will change.
call assert_equal("", expand('%'))
set verbose=1
call assert_equal("", expand('%'))
set verbose=0
quit
endfunc