File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -1865,7 +1865,7 @@ H.full_path = function(path) return (vim.fn.fnamemodify(path, ':p'):gsub('(.)/$'
18651865
18661866H .short_path = function (path , cwd )
18671867 cwd = cwd or vim .fn .getcwd ()
1868- if not vim .startswith (path , cwd ) then return path end
1868+ if not vim .startswith (path , cwd ) then return vim . fn . fnamemodify ( path , ' :~ ' ) end
18691869 local res = path :sub (cwd :len () + 1 ):gsub (' ^/+' , ' ' ):gsub (' /+$' , ' ' )
18701870 return res
18711871end
Original file line number Diff line number Diff line change @@ -2686,7 +2686,8 @@ T['pickers']['oldfiles()']['respects `opts.source.cwd`'] = function()
26862686 pick_oldfiles ({}, { source = { cwd = real_files_dir } })
26872687 local items = get_picker_items ()
26882688 eq (items [1 ], ' LICENSE' )
2689- expect .match (items [2 ], vim .pesc (ref_oldfiles [2 ]))
2689+ -- - For paths not from `cwd` it should shorten home directory to `~`
2690+ expect .match (items [2 ], vim .pesc (child .fn .fnamemodify (ref_oldfiles [2 ], ' :~' )))
26902691end
26912692
26922693T [' pickers' ][' options()' ] = new_set ()
You can’t perform that action at this time.
0 commit comments