Skip to content

Commit

Permalink
Fix [f and ]f behavior in directory containing [, $
Browse files Browse the repository at this point in the history
Without this, glob() fails to list files and [f/]f works incorrectly
when a path contains a special character such as "[".

Resolves: tpope#232
  • Loading branch information
ryym authored Nov 21, 2022
1 parent efdc647 commit 6d44a6d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions plugin/unimpaired.vim
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ call s:MapNextFamily('t', 't', 'trewind')

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

0 comments on commit 6d44a6d

Please sign in to comment.