Skip to content

Commit 4320120

Browse files
committed
use ':.' fname modifier
1 parent 98b00d0 commit 4320120

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

autoload/nnn.vim

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,12 @@ function! s:eval_temp_file(opts)
9292
else
9393
" Remove directories and missing files
9494
call filter(l:names, {_, val -> !isdirectory(val) && filereadable(val) })
95-
" Consider trimming out current working directory from filename
96-
let l:cwd = getcwd()
97-
call map(l:names, { _, val -> strcharpart(val, 0, strlen(l:cwd)) ==# l:cwd ? strcharpart(val, strlen(l:cwd) + 1) : val }) " + 1 is to also remove the trailing slash
9895
call reverse(l:names)
9996
" Edit the first item.
100-
execute 'silent' l:Cmd fnameescape(l:names[0])
97+
execute 'silent' l:Cmd fnameescape(fnamemodify(l:names[0], ':.'))
10198
" Add any remaining items to the arg list/buffer list.
10299
for l:name in l:names[1:]
103-
execute 'silent argadd' fnameescape(l:name)
100+
execute 'silent argadd' fnameescape(fnamemodify(l:name, ':.'))
104101
endfor
105102
endif
106103

0 commit comments

Comments
 (0)