Skip to content

Commit a051caf

Browse files
committed
trim out cwd from selecte filenames
1 parent 157cc45 commit a051caf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

autoload/nnn.vim

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ function! s:eval_temp_file(opts)
8181
if (type(l:Cmd) == v:t_func)
8282
call l:Cmd(l:names)
8383
else
84+
" Consider trimming out current working directory from filename
85+
let l:cwd = getcwd()
86+
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
8487
" Edit the first item.
8588
execute 'silent' l:Cmd fnameescape(l:names[0])
8689
" Add any remaining items to the arg list/buffer list.

0 commit comments

Comments
 (0)