Skip to content

Commit 2ddd8ee

Browse files
committed
fix(mappings): "." does not escape Vim special chars
Problem: If "." is used on a file with "%" or "#", Vim treats those as special chars. Solution: Pass the {special} arg to shellescape().
1 parent 3851bed commit 2ddd8ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ftplugin/dirvish.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ execute 'xnoremap '.s:nowait.'<buffer> P '.s:call_prefix.'call dirvish#open("
5151
nnoremap <buffer><silent> R :<C-U><C-R>=v:count ? ':let g:dirvish_mode='.v:count.'<Bar>' : ''<CR>Dirvish<CR>
5252
nnoremap <buffer><silent> g? :help dirvish-mappings<CR>
5353
54-
execute 'nnoremap <expr>'.s:nowait.'<buffer> . ":<C-u>".(v:count ? "Shdo".(v:count?"!":"")." {}" : ("! ".shellescape(empty(fnamemodify(getline("."),":.")) ? "." : fnamemodify(getline("."),":."))))."<Home><C-Right>"'
54+
execute 'nnoremap <expr>'.s:nowait.'<buffer> . ":<C-u>".(v:count ? "Shdo".(v:count?"!":"")." {}" : ("! ".shellescape(empty(fnamemodify(getline("."),":.")) ? "." : fnamemodify(getline("."),":."), 1)))."<Home><C-Right>"'
5555
execute 'xnoremap <expr>'.s:nowait.'<buffer> . ":Shdo".(v:count?"!":" ")." {}<Left><Left><Left>"'
5656
execute 'nnoremap <expr>'.s:nowait.'<buffer> cd ":<C-u>".(v:count ? "cd" : "lcd")." %<Bar>pwd<CR>"'
5757

0 commit comments

Comments
 (0)