File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -351,6 +351,7 @@ function! s:GetBuffer(buffer)
351351endfunction
352352
353353function ! buffet#bswitch (index )
354+ echom " index " . a: index
354355 let i = str2nr (a: index ) - 1
355356 if i < 0 || i > len (s: buffer_ids ) - 1
356357 let buffer_id = s: buffer_ids [len (s: buffer_ids )-1 ]
@@ -361,13 +362,14 @@ function! buffet#bswitch(index)
361362endfunction
362363
363364function ! buffet#bnext ()
364- let next_buffer_id = (s: last_current_buffer_id+ 1 )% len (s: buffer_ids )
365- call buffet#bswitch (next_buffer_id)
365+ let current_buffer_id_i = index (s: buffer_ids , s: last_current_buffer_id )
366+ let next_buffer_id_i = (current_buffer_id_i+ 2 )% len (s: buffer_ids )
367+ call buffet#bswitch (next_buffer_id_i)
366368endfunction
367369
368370function ! buffet#bprev ()
369- let next_buffer_id = (s: last_current_buffer_id- 1 )
370- call buffet#bswitch (next_buffer_id )
371+ let current_buffer_id_i = index (s: buffer_ids , s: last_current_buffer_id )
372+ call buffet#bswitch (current_buffer_id_i )
371373endfunction
372374
373375" 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