Skip to content

Commit

Permalink
Fix problem when argument doesn't match any buffer.
Browse files Browse the repository at this point in the history
  • Loading branch information
Raimondi committed May 5, 2012
1 parent 6fbae36 commit d9ccf7b
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions plugin/buffalo.vim
Expand Up @@ -50,10 +50,8 @@ function! s:buffalo(...)
endif
let partial = matchstr(cmdline, '^\a\+\s\+\zs.*')
\ . (char =~'[[:cntrl:]]' ? '' : char)
if char2nr(char) == 128
if char2nr(char) == char2nr("\<BS>")
" Backspace, remove the last char.
" TODO: Make sure it works on different OSes.
" TODO char =~ '\b' doesn't match.
let partial = matchstr(partial, '^.*\ze.')
endif
" fnameescape() doesn't escape '.'
Expand All @@ -70,10 +68,10 @@ function! s:buffalo(...)
call feedkeys(cmdline, 'n')
elseif exists('g:buffalo_pretty') && g:buffalo_pretty
" Use print() to display matching buffers.
let cmdline = empty(bl.buffers().to_l())
\ ? ''
\ : "call vimple#bl.filter(".string(filter).").print()\<CR>:"
\ . cmdline
let cmdline = (empty(bl.buffers().to_l())
\ ? ''
\ : "call vimple#bl.filter(".string(filter).").print()\<CR>:")
\ . cmdline
call feedkeys("\<C-U>" . cmdline . char, 'n')
call feedkeys(s:aux_map)
else
Expand Down

0 comments on commit d9ccf7b

Please sign in to comment.