barbar.nvim
barbar.nvim copied to clipboard
Fix state.move_current_buffer_to and add BufferMoveStart command #284
The state.move_current_buffer_to function has a bug when the current buffer is not the the tabline, instead of doing nothing because the current buffer is not in the list, it removes the first buffer from the list, pushing it back to the last position when the buffer is re-added later on.
Also, create a command BufferMoveStart that uses this function. See use case in #284 (and investigation of the above issue)
Would you mind separating out BufferMoveStart into a separate PR? I'd be happy to merge that while looking at the specifics of your bug report.
The check if idx ~= nil then in the move_current_buffer_to function is no longer necessary as you added a check that returns with an error if idx is nil. This happens when the current buffer is not a regular buffer (a NvimTree window for example).
The PR is updated to only add the BufferMoveStart command
Thanks for updating the PR!
The internals of barbar went through quite a few changes recently (as you've seen). A number of previous issues ended up fixed after the code got another once-over