vim-patch:8.1.0211: expanding a file name "~" results in $HOME

Problem:    Expanding a file name "~" results in $HOME. (Aidan Shafran)
Solution:   Change "~" to "./~" before expanding. (closes vim/vim#3072)
00136dc321
This commit is contained in:
Jan Edmund Lazo
2019-05-25 17:22:19 -04:00
parent 55419a6904
commit 08aa9b0023
5 changed files with 30 additions and 9 deletions

View File

@@ -62,6 +62,14 @@ describe('expand file name', function()
call delete('Xdir ~ dir', 'd')
call assert_false(isdirectory('Xdir ~ dir'))
endfunc
func Test_expand_tilde_filename()
split ~
call assert_equal('~', expand('%'))
call assert_notequal(expand('%:p'), expand('~/'))
call assert_match('\~', expand('%:p'))
bwipe!
endfunc
]])
end)
@@ -74,4 +82,9 @@ describe('expand file name', function()
call('Test_with_tilde')
expected_empty()
end)
it('does not expand tilde if it is a filename', function()
call('Test_expand_tilde_filename')
expected_empty()
end)
end)