Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
huzilin committed Oct 21, 2020
1 parent 04d1abf commit be6e1ac
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions autoload/buffet.vim
Original file line number Diff line number Diff line change
Expand Up @@ -361,13 +361,14 @@ function! buffet#bswitch(index)
endfunction

function! buffet#bnext()
let next_buffer_id = (s:last_current_buffer_id+1)%len(s:buffer_ids)
call buffet#bswitch(next_buffer_id)
let current_buffer_id_i = index(s:buffer_ids, s:last_current_buffer_id)
let next_buffer_id_i = (current_buffer_id_i+2)%len(s:buffer_ids)
call buffet#bswitch(next_buffer_id_i)
endfunction

function! buffet#bprev()
let next_buffer_id = (s:last_current_buffer_id-1)
call buffet#bswitch(next_buffer_id)
let current_buffer_id_i = index(s:buffer_ids, s:last_current_buffer_id)
call buffet#bswitch(current_buffer_id_i)
endfunction

" inspired and based on https://vim.fandom.com/wiki/Deleting_a_buffer_without_closing_the_window
Expand Down

0 comments on commit be6e1ac

Please sign in to comment.