From 8821354b45fb7cba2cfee4fa4f8ea42474c165c4 Mon Sep 17 00:00:00 2001 From: Alex Klapheke Date: Sat, 14 Dec 2024 14:06:06 -0500 Subject: [PATCH] Fix `.` and `!` mappings in wide and long listings In these listings, use two or more spaces to delimit filenames (see :help netrw-cr). Fixes --- plugin/vinegar.vim | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugin/vinegar.vim b/plugin/vinegar.vim index 660ee29..c06dd24 100644 --- a/plugin/vinegar.vim +++ b/plugin/vinegar.vim @@ -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