Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow moving buffers to arbitrary positions #675

Merged
merged 5 commits into from
Feb 17, 2023
Merged

feat: allow moving buffers to arbitrary positions #675

merged 5 commits into from
Feb 17, 2023

Conversation

MisterFISHUP
Copy link
Contributor

I added a move_to function and BufferLineMoveTo{First|Last} commands so one can easily move the current buffer to the n-th position in the bufferline.

It's a bit like :tabmove but for buffers.

move_to takes an 1-based buffer index. Negative integers are allowed but 0 is ignored.


P.S. This is an awesome project! Thank you to all the maintainers for putting in so much time and effort to make this possible. I'm really enjoying using it and I'm so grateful for all the work that went into it. Keep up the great work!"

Copy link
Owner

@akinsho akinsho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MisterFISHUP thanks for the PR. I don't mind the idea of adapting the move function to allow specifying a position to move to, but the current solution is not DRY at all and I think it can be reworked. The move function should be adapted to take an index and when used in the existing mappings the arguments should be calculated.

lua/bufferline/commands.lua Outdated Show resolved Hide resolved
lua/bufferline.lua Outdated Show resolved Hide resolved
@akinsho akinsho changed the title feat: add move_to function and BufferLineMoveToFirst/Last commands feat: allow moving buffers to arbitrary positions Feb 17, 2023
@akinsho akinsho changed the base branch from main to dev February 17, 2023 14:37
@akinsho akinsho merged commit e0aa1fd into akinsho:dev Feb 17, 2023
@akinsho
Copy link
Owner

akinsho commented Feb 17, 2023

Thanks for all your work on this @MisterFISHUP much appreciated 👍🏿

@MisterFISHUP
Copy link
Contributor Author

Thank you for merging this PR, and for all the useful guides you have provided! 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants