mirror of
https://github.com/neovim/neovim.git
synced 2026-07-17 22:51:20 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user