feature: allow to close document from buffer picker#15278
feature: allow to close document from buffer picker#15278yo-main wants to merge 1 commit intohelix-editor:masterfrom
Conversation
23d9104 to
036f217
Compare
helix-term/src/commands.rs
Outdated
| CloseError::BufferModified(s) => format!("Could not close modified buffer: {}", s), | ||
| _ => "Could not close buffer".to_owned(), |
There was a problem hiding this comment.
The CloseError::SaveError contains an anyhow::Error with potentially useful information that gets discarded.
| CloseError::BufferModified(s) => format!("Could not close modified buffer: {}", s), | |
| _ => "Could not close buffer".to_owned(), | |
| CloseError::BufferModified(s) => format!("Could not close modified buffer: {}", s), | |
| CloseError::SaveError(e) => format!("Could not close buffer: {}", e), | |
| CloseError::DoesNotExist => "Buffer does not exist".to_owned(), |
here.gif
Outdated
There was a problem hiding this comment.
I don't think this should be included in the worktree, you should be able to upload to github directly on the PR itself as a file attached to a comment.
helix-term/src/ui/picker.rs
Outdated
| ctrl!('t') => { | ||
| self.toggle_preview(); | ||
| } | ||
| key!(Delete) => { |
There was a problem hiding this comment.
On some keyboards (Mac for instance), there's typically only a Backspace key. Consider also binding something more portable, I don't really know what's the standard in the rest of the codebase (I can see ctrl!('d') in some places but not sure what's the "standard").
There was a problem hiding this comment.
I've set an alternative with alt('d') as ctrl!('d') is already in the picker
There was a problem hiding this comment.
You could add a few integration tests, I've found commands/write.rs:131-160 and splits.rs:6-70 that you could take inspiration from to make your own integration test.
The feature seems to be working well though, it's useful and I think reasonable to add to core instead of a plugin.
(I'm just a contributor trying to help review things as they come in to make it easier for maintainers when they get here, don't take my word authoritatively)
036f217 to
a473e02
Compare
Allow to close an opened buffer using the
DELkey while inside the buffer picker.This is something that I have been missing: it's a bit annoying to open and manually close each buffer I want to close from the buffer picker.
There's probably a better way to implement this. Happy to get some directions if that is the case.