File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -361,13 +361,14 @@ function! buffet#bswitch(index)
361361endfunction
362362
363363function ! buffet#bnext ()
364- let next_buffer_id = (s: last_current_buffer_id+ 1 )% len (s: buffer_ids )
365- call buffet#bswitch (next_buffer_id)
364+ let current_buffer_id_i = index (s: buffer_ids , s: last_current_buffer_id )
365+ let next_buffer_id_i = (current_buffer_id_i+ 2 )% len (s: buffer_ids )
366+ call buffet#bswitch (next_buffer_id_i)
366367endfunction
367368
368369function ! buffet#bprev ()
369- let next_buffer_id = (s: last_current_buffer_id- 1 )
370- call buffet#bswitch (next_buffer_id )
370+ let current_buffer_id_i = index (s: buffer_ids , s: last_current_buffer_id )
371+ call buffet#bswitch (current_buffer_id_i )
371372endfunction
372373
373374" inspired and based on https://vim.fandom.com/wiki/Deleting_a_buffer_without_closing_the_window
You can’t perform that action at this time.
0 commit comments