Skip to content

Commit

Permalink
Fix . and ! mappings in wide and long listings
Browse files Browse the repository at this point in the history
In these listings, use two or more spaces to delimit filenames (see
:help netrw-cr).

Fixes <tpope#112>
  • Loading branch information
alexklapheke committed Dec 14, 2024
1 parent bb1bcdd commit 8821354
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plugin/vinegar.vim
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ function! s:absolutes(first, ...) abort
let files = getline(a:first, a:0 ? a:1 : a:first)
call filter(files, 'v:val !~# "^\" "')
call map(files, "substitute(v:val, '^\\(| \\)*', '', '')")
if get(b:, 'netrw_liststyle') == 1
call map(files, "substitute(v:val, ' .*', '', '')")
elseif get(b:, 'netrw_liststyle') == 2
call map(files, "substitute(v:val, '^.\\{," . col('.') . "\\} ', '', '')")
call map(files, "substitute(v:val, ' .*', '', '')")
endif
call map(files, 'b:netrw_curdir . s:slash() . substitute(v:val, "[/*|@=]\\=\\%(\\t.*\\)\\=$", "", "")')
return files
endfunction
Expand Down

0 comments on commit 8821354

Please sign in to comment.