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/close buffer from picker #4522

Closed

Conversation

EricHenry
Copy link
Contributor

Closes: #1593

Hey all, this allows the user to delete a buffer from the file picker by using ctrl-x to close and ctrl-X to force close. I didn't update any documentation yet; I first wanted to get feedback on my approach and the keybindings that I used.

Please let me know any ideas on how to improve this implementation.

@kirawi kirawi added A-helix-term Area: Helix term improvements S-waiting-on-review Status: Awaiting review from a maintainer. labels Oct 31, 2022
@lukepighetti
Copy link

What about C-d instead of C-x? That will match the close buffer key in normal mode

@EricHenry
Copy link
Contributor Author

@lukepighetti I initially wanted to use c-d, but it is already being used by the picker to scroll the page down.

@EricHenry
Copy link
Contributor Author

EricHenry commented Jun 23, 2023

I think I have landed on an implementation that is simple but adds flexibility to the picker. The PR adds the ability for any specific usage of the picker to define a special handling of key events that do not conflict with the default key events for the picker. Let me know your thoughts!

@the-mikedavis
Copy link
Member

My hangup with this change is that I think it's better solved by #5505. I don't think the code added here will be reused in the solution for that and I'm fairly certain that #5055 will make it very easy to implement this.

@EricHenry
Copy link
Contributor Author

@the-mikedavis hey! Thanks for the feedback. I totally see where you are coming from. #5505 would be a great enhancement and allow for this exact flexibility.

If no one is working on that issue. I’d love to pick it up since I’ve been in that code with this PR. Do you have any guidance or thoughts on the implementation. You mentioned #5055, what are your thoughts on using the dynamic picker to achieve #5505. Would you like to see this PR left open and then updated once the other change is made?

P.S. let me know if you’d like to take the conversation to that issue.

@the-mikedavis
Copy link
Member

Ah, 5055 was a typo. I meant 5505 😅

I've been thinking about #5505 and tinkering with ideas for a while and it's very tricky to solve. I wrote out some ideas in this branch (see 478fc9a in particular). Feel free to have a go at it but I suspect that this is something that may end up being a very large change, and we will probably want to discuss it or solve it internally since really large changes are hard to collaborate on.

@gabydd
Copy link
Member

gabydd commented Jun 26, 2023

I tried to implement the AnyPicker here https://github.com/gabydd/helix/tree/md-compositor-key-remapping-idea very interesting problem, definitely a difficult one to design well, this way(see the commit on my branch that uses an Enum and Any) seems better then changing the way Items work though.

@pascalkuthe
Copy link
Member

This branch has gone quite stale. We also intend to solve this differently (see above) so I am closing this out. Thanks for contributing

@pascalkuthe pascalkuthe closed this Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow using ctrl + d to close a buffer from buffer picker by default
7 participants