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(commands): command palette #1400

Merged
merged 11 commits into from
Feb 17, 2022
Merged

feat(commands): command palette #1400

merged 11 commits into from
Feb 17, 2022

Conversation

matoous
Copy link
Contributor

@matoous matoous commented Dec 29, 2021

Add new command to display command pallete that can be used
to discover and execute available commands.

Fixes: #559

helix-term/src/commands.rs Outdated Show resolved Hide resolved
Copy link
Contributor Author

@matoous matoous left a comment

Choose a reason for hiding this comment

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

Screen Shot 2022-01-01 at 21 58 50

Current state ⬆️

I would like to align the key bindings to the right side but that would require larger changes.

helix-term/src/keymap.rs Outdated Show resolved Hide resolved
helix-term/src/keymap.rs Show resolved Hide resolved
@matoous matoous requested a review from archseer January 1, 2022 21:01
@matoous matoous marked this pull request as ready for review January 1, 2022 21:02
helix-term/src/keymap.rs Outdated Show resolved Hide resolved
@archseer
Copy link
Member

archseer commented Jan 2, 2022

I would like to align the key bindings to the right side but that would require larger changes.

I agree that this can be done later on, but take a look at how the completion Menu component uses the Item trait/Table tui component:

pub trait Item {
fn sort_text(&self) -> &str;
fn filter_text(&self) -> &str;
fn label(&self) -> &str;
fn row(&self) -> Row;
}

Most components would then have to use some default implementation that only exposes a single row.

@archseer
Copy link
Member

archseer commented Jan 2, 2022

(There's an old TODO here to actually implement the picker list via Menu too but it's possible the components have diverged too much now

// TODO: it's like a slimmed down picker, share code? (picker = menu + prompt with different
// rendering)
)

@heliostatic
Copy link
Contributor

I'd love to have this functionality -- what's the current state?

@matoous
Copy link
Contributor Author

matoous commented Jan 31, 2022

@heliostatic I went down the rabbit hole of

There's an old TODO here to actually implement the picker list via Menu too but it's possible the components have diverged too much now

But didn't have time to finish it yet.

@archseer
Copy link
Member

I'll merge this as is and we can work on the improvement in a follow-up. Can you fix the conflicts?

@matoous
Copy link
Contributor Author

matoous commented Feb 11, 2022

@archseer done, sorry for taking so long with this PR, I sadly don't have much time lately.

@matoous
Copy link
Contributor Author

matoous commented Feb 13, 2022

@archseer suggestions applied and issues fixed.

@archseer
Copy link
Member

Sorry, one more rebase! I merged the debugger branch so there's some conflicts.

@matoous
Copy link
Contributor Author

matoous commented Feb 15, 2022

@archseer done ✅

@archseer
Copy link
Member

Thanks for the patience! 🎉

@archseer archseer merged commit afec544 into helix-editor:master Feb 17, 2022
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.

VS Code like command palette to search for commands and keybinds
5 participants