Skip to content

Commit

Permalink
Update g:netrw_list_hide from 'wildignore'
Browse files Browse the repository at this point in the history
(1) s:setup_vinegar() is called two times; second time &wig is empty, use netrw save w:netrw_wigkeep
(2) Fixed index bug when copying existing code: from [-strlen(s:dotfiles)-1:-1] to [-strlen(s:dotfiles):-1]

For more details see tpope#69
  • Loading branch information
kiryph authored Jun 23, 2016
1 parent 6594465 commit 4cf7f50
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions plugin/vinegar.vim
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,11 @@ function! s:escaped(first, last) abort
endfunction

function! s:setup_vinegar() abort
unsilent echo "Updating g:netrw_list_hide within s:setup_vinegar()"
let g:netrw_list_hide =
\ join(map(split(&wildignore, ','), '"^".' . s:escape . '. "$"'), ',') . ',^\.\.\=/\=$' .
\ (get(g:, 'netrw_list_hide', '')[-strlen(s:dotfiles)-1:-1] ==# s:dotfiles ? ','.s:dotfiles : '')
if exists("w:netrw_wigkeep")
let g:netrw_list_hide =
\ join(map(split(w:netrw_wigkeep, ','), '"^".' . s:escape . '. "$"'), ',') . ',^\.\.\=/\=$' .
\ (get(g:, 'netrw_list_hide', '')[-strlen(s:dotfiles):-1] ==# s:dotfiles ? ','.s:dotfiles : '')
endif
if empty(s:netrw_up)
" save netrw mapping
let s:netrw_up = substitute(maparg('-', 'n'), '\c^:\%(<c-u>\)\=', '', '')
Expand Down

0 comments on commit 4cf7f50

Please sign in to comment.