akinsho / bufferline.nvim

A snazzy bufferline for Neovim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature Request]: A way to retrieve a buffer's `current_index`

thenbe opened this issue · comments

What?

I wanted to create a keymap to move buffers. Bufferline has a function that allows us to do this:

require('bufferline').move_to(new_index, current_index)

However, I don't know what the buffer's current_index is. I know everything about the buffer I want to act on, except it's current_index. How can I get a buffer's current_index for the purposes of the function above?

Is there some way one can exchange a bufnr for a bufferline current_index?

Why?

I'm trying to attach mappings to a telescope buffer picker.

I'm not sure this is a dupe of #861 because #861 still assumes we're still in the buffer we want to act on AFAICT. Whereas this issue assumes we want to act on "non-current" buffers (i.e. buffers other than the current one).

commented

@thenbe can you please move this discussion either to #861 despite the perceived differences I have too many open issues to keep track of this sort of distinction alternatively please look at #868 to see if that might cover what you want if not maybe comment there