Skip to content

Commit 6d44a6d

Browse files
authored
Fix [f and ]f behavior in directory containing [, $
Without this, glob() fails to list files and [f/]f works incorrectly when a path contains a special character such as "[". Resolves: tpope#232
1 parent efdc647 commit 6d44a6d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

plugin/unimpaired.vim

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ call s:MapNextFamily('t', 't', 'trewind')
7777

7878
function! s:entries(path) abort
7979
let path = substitute(a:path,'[\\/]$','','')
80+
let path = substitute(path, '[[$*]', '[&]', 'g')
8081
let files = split(glob(path."/.*"),"\n")
8182
let files += split(glob(path."/*"),"\n")
8283
call map(files,'substitute(v:val,"[\\/]$","","")')

0 commit comments

Comments
 (0)