Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Buffer reordering #3707

Closed
Omnikar opened this issue Sep 5, 2022 · 6 comments
Closed

Buffer reordering #3707

Omnikar opened this issue Sep 5, 2022 · 6 comments
Labels
A-helix-term Area: Helix term improvements C-enhancement Category: Improvements

Comments

@Omnikar
Copy link
Contributor

Omnikar commented Sep 5, 2022

With the new bufferline feature introduced by #2759, the order of buffers becomes much more apparent and important. As a result, I feel it necessary to have commands that can be used to reorder buffers. Unfortunately, it would appear that the data structure currently used to store buffers, BTreeMap, does not allow its data to be in an arbitrary order.

@Omnikar Omnikar added the C-enhancement Category: Improvements label Sep 5, 2022
@kirawi kirawi added the A-helix-term Area: Helix term improvements label Sep 6, 2022
@emilyyyylime
Copy link
Contributor

I'm working on implementing this, do you reckon having just a "move currently active document left/right" command would be good? And what keybinds should it use? I was thinking we could change "Select symbol references" to something else and use <space>h and <space>l

@emilyyyylime
Copy link
Contributor

Looking into it Kakoune went with a specialised command that would take a list of buffers and put them at the front in order: https://discuss.kakoune.com/t/brainstorm-for-a-more-flexible-buffer-list/767/9. I think this is a good idea, it should work quite well with command completions. I do feel like there should also be an option to move buffers to the end, should that just be a separate command? like :reorder-buffers and :reorder-buffers-reverse?

@emilyyyylime
Copy link
Contributor

Also in terms of implementation do you think it might be a good idea to use a different collection for this? Because currently my code for swapping 2 documents removes them both from the map and then inserts them back in each others previous ID. I'm not sure if we even documents to retain their ids between operations, anywhere we use document ids we get an id and then immediately throw it away — we might be able to get away with just a Vec, as I can't imagine anyone ever needing even 20 documents open

@emilyyyylime
Copy link
Contributor

I'm working on implementing this, do you reckon having just a "move currently active document left/right" command would be good? And what keybinds should it use? I was thinking we could change "Select symbol references" to something else and use <space>h and <space>l

also if we do want a move left/right we could use the [/] menus. Maybe ]] and [[?

@jabbalaci
Copy link

I would also need this feature. Moving a tab left / right would be enough for me. I don't know about the default keybinding but if there are two associated commands, I could map them to what I like. Moving a tab to the first and last place would be a plus, but moving to left / right would be enough for me.

@7ombie

This comment was marked as spam.

@helix-editor helix-editor locked and limited conversation to collaborators Apr 8, 2024
@pascalkuthe pascalkuthe converted this issue into discussion #10278 Apr 8, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
A-helix-term Area: Helix term improvements C-enhancement Category: Improvements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants