Skip to content

Display the keybinding of a command within the palette#1723

Merged
dzhou121 merged 1 commit intomasterfrom
palette-command-keybind
Nov 20, 2022
Merged

Display the keybinding of a command within the palette#1723
dzhou121 merged 1 commit intomasterfrom
palette-command-keybind

Conversation

@MinusGix
Copy link
Copy Markdown
Member

@MinusGix MinusGix commented Nov 19, 2022

  • Added an entry to CHANGELOG.md if this change could be valuable to users

This PR adds the keybinding for a command as the hint in the palette. Fixes #1683. This will make it easier for users to know the keybinding for a command they might be using often.
image

It pays attention to what mode the user is in, so it won't recommend completely incorrect keybinds.


Could be improved with some better alignment of the keybindings?
I think this could also be improved by taking into account when the keybind can be used.

@MinusGix MinusGix added the A-ui Area: UI rendering and interactions label Nov 19, 2022
@MinusGix MinusGix force-pushed the palette-command-keybind branch from 3e52764 to 00b21b3 Compare November 19, 2022 12:29
@MinusGix MinusGix marked this pull request as ready for review November 19, 2022 12:30
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Nov 19, 2022

Codecov Report

Merging #1723 (8856131) into master (6492ec2) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

@@            Coverage Diff            @@
##           master   #1723      +/-   ##
=========================================
- Coverage    6.56%   6.55%   -0.02%     
=========================================
  Files         127     127              
  Lines       53944   54039      +95     
=========================================
  Hits         3541    3541              
- Misses      50403   50498      +95     
Impacted Files Coverage Δ
lapce-data/src/data.rs 0.00% <0.00%> (ø)
lapce-data/src/palette.rs 4.10% <0.00%> (-0.03%) ⬇️
lapce-ui/src/palette.rs 0.00% <0.00%> (ø)
lapce-ui/src/status.rs 0.00% <0.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@dzhou121
Copy link
Copy Markdown
Collaborator

Would you mind changing it to be painted at the end of the line and in this style https://github.com/lapce/lapce/blob/master/lapce-data/src/keypress/mod.rs#L45

@MinusGix MinusGix force-pushed the palette-command-keybind branch from 00b21b3 to e801728 Compare November 20, 2022 18:29
@MinusGix MinusGix force-pushed the palette-command-keybind branch from e801728 to 8856131 Compare November 20, 2022 18:43
@MinusGix
Copy link
Copy Markdown
Member Author

MinusGix commented Nov 20, 2022

Okay, I've made them right aligned and using the same style as the keymaps.

@Gerrit0
Copy link
Copy Markdown

Gerrit0 commented Nov 20, 2022

Also fixes #1391

@dzhou121 dzhou121 merged commit 5a903c9 into master Nov 20, 2022
@dzhou121 dzhou121 deleted the palette-command-keybind branch November 20, 2022 20:26
@panekj panekj added this to the Next release milestone Nov 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ui Area: UI rendering and interactions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Please, please in the control pallet after the description add the short-cut.

5 participants