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

Keymap presentation refinements and underlying restructuring #5635

Closed
wants to merge 113 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
671f297
Make stickiness configurable
bbodi Oct 9, 2022
09ea56b
Add support for labels in custom menu keymaps
MattCheely Sep 24, 2022
608687d
Add support for labels on typable commands
MattCheely Sep 24, 2022
091b3f5
refactor keymap map visitor to reduce # of cases
MattCheely Sep 25, 2022
56d624e
Simplify labelled command pattern match
MattCheely Oct 4, 2022
3642213
Add some basic docs
MattCheely Oct 18, 2022
7804572
fix typos in menu label docs
MattCheely Nov 15, 2022
0e6c4af
return errors for ambiguous and unsupported labels in menus
MattCheely Nov 16, 2022
6d50d7f
remove one-liner solely used for a test
gibbz00 Dec 17, 2022
37f49f6
Inline helper fuction of singular reference
gibbz00 Dec 17, 2022
c748f7c
Remove order property of KeyTrie struct:
gibbz00 Dec 17, 2022
2c7c4d9
Infobox: Remove superflous command descripition pruning:
gibbz00 Dec 17, 2022
8d35e64
Keymap infobox: Use Vec in place of BTree:
gibbz00 Dec 17, 2022
f187f2d
Keymap infobox: Place in correct order from start:
gibbz00 Dec 17, 2022
2a0e9d2
Keymap infobox: Format body from start
gibbz00 Dec 17, 2022
faec827
keymap.rs file splitting, cleanup and descriptive naming:
gibbz00 Dec 26, 2022
d5520e8
Rename MappableCommand field doc to description:
gibbz00 Dec 26, 2022
aea10f7
Initial sorting of keymap info window
gibbz00 Dec 26, 2022
7f86d01
Infobox: Consistently place lowercase equivalents first
gibbz00 Dec 27, 2022
7935f77
Remove infobox optimization suggestion comment:
gibbz00 Dec 27, 2022
0482d09
keymap testing touchups
gibbz00 Dec 27, 2022
6b01af5
Exclude config no_op bindings in command palette.
gibbz00 Dec 27, 2022
7a8397c
Cleaner infobox join operation
gibbz00 Dec 27, 2022
546010b
use statement cleanups
gibbz00 Dec 28, 2022
036ce4a
Move Config related tests from keymap tests Config tests
gibbz00 Dec 28, 2022
ac98d82
Config test cleanup
gibbz00 Dec 28, 2022
109228b
Load keymap config consistently
gibbz00 Dec 29, 2022
527198a
Make use of new self context in keymap config load
gibbz00 Dec 29, 2022
917ca0d
Minor keymap module visibilyti cleanup
gibbz00 Dec 29, 2022
8b8fadb
Renamed the keymap! macro to keytrie!:
gibbz00 Dec 29, 2022
7747777
Fix failed cherry picks
gibbz00 Jan 19, 2023
342f794
Removed keymap::Keymap:
gibbz00 Dec 29, 2022
020c53a
Switched keymap::keymaps::Keymaps to keymap::Keymap
gibbz00 Dec 30, 2022
bda06bc
Re-implemented pre-defined orders in keytrie
gibbz00 Jan 20, 2023
87fc571
Add sort_infobox editor config option
gibbz00 Jan 21, 2023
ecf5d61
Refine sorting behavior
gibbz00 Jan 22, 2023
5e7f4a0
Removed warnings
gibbz00 Jan 22, 2023
c88a817
Use .join(", ") rather that own implementation
gibbz00 Jan 22, 2023
2f0fa30
Fix apply_trasaction rebase fail
gibbz00 Jan 22, 2023
1eaaf2d
Fix failing test
gibbz00 Jan 22, 2023
ae6790c
Run cargo fmt
gibbz00 Jan 23, 2023
44ad646
Use description conistenly
gibbz00 Jan 23, 2023
abf2f28
Fix undeterministic test failure
gibbz00 Jan 23, 2023
eccda6e
Implement clippy tips
gibbz00 Jan 23, 2023
2afcfcf
Make cargo fmt happy
gibbz00 Jan 23, 2023
c617fd1
Make updated cargo clippy happy
gibbz00 Jan 24, 2023
7dbacf3
Merge branch 'master' into keymap-presentation
gibbz00 Jan 24, 2023
b4b82b4
Fight with cargo fmt round 3
gibbz00 Jan 24, 2023
8c1333a
Merge branch 'keymap-presentation' of https://github.com/gibbz00/heli…
gibbz00 Jan 24, 2023
c8dd563
remove one-liner solely used for a test
gibbz00 Dec 17, 2022
df49f60
Inline helper fuction of singular reference
gibbz00 Dec 17, 2022
69ed135
Remove order property of KeyTrie struct:
gibbz00 Dec 17, 2022
10151a9
Infobox: Remove superflous command descripition pruning:
gibbz00 Dec 17, 2022
465c0ef
Keymap infobox: Use Vec in place of BTree:
gibbz00 Dec 17, 2022
8768bf9
Keymap infobox: Place in correct order from start:
gibbz00 Dec 17, 2022
b50050b
Keymap infobox: Format body from start
gibbz00 Dec 17, 2022
eb50de1
keymap.rs file splitting, cleanup and descriptive naming:
gibbz00 Dec 26, 2022
d74be02
Rename MappableCommand field doc to description:
gibbz00 Dec 26, 2022
7192a4e
Initial sorting of keymap info window
gibbz00 Dec 26, 2022
26adc32
Infobox: Consistently place lowercase equivalents first
gibbz00 Dec 27, 2022
4fb58f7
Remove infobox optimization suggestion comment:
gibbz00 Dec 27, 2022
d33ff8b
keymap testing touchups
gibbz00 Dec 27, 2022
958e8bc
Exclude config no_op bindings in command palette.
gibbz00 Dec 27, 2022
d0f93ec
Cleaner infobox join operation
gibbz00 Dec 27, 2022
876885e
use statement cleanups
gibbz00 Dec 28, 2022
315fa89
Move Config related tests from keymap tests Config tests
gibbz00 Dec 28, 2022
fcf8e6b
Config test cleanup
gibbz00 Dec 28, 2022
e233a1b
Load keymap config consistently
gibbz00 Dec 29, 2022
4a188d2
Make use of new self context in keymap config load
gibbz00 Dec 29, 2022
baf8640
Minor keymap module visibilyti cleanup
gibbz00 Dec 29, 2022
3466209
Renamed the keymap! macro to keytrie!:
gibbz00 Dec 29, 2022
ff25380
Fix failed cherry picks
gibbz00 Jan 19, 2023
5c6c0ed
Removed keymap::Keymap:
gibbz00 Dec 29, 2022
ff6b53f
Switched keymap::keymaps::Keymaps to keymap::Keymap
gibbz00 Dec 30, 2022
aed2e90
Re-implemented pre-defined orders in keytrie
gibbz00 Jan 20, 2023
5edce2e
Add sort_infobox editor config option
gibbz00 Jan 21, 2023
0b08e38
Refine sorting behavior
gibbz00 Jan 22, 2023
5049e7c
Removed warnings
gibbz00 Jan 22, 2023
4f758ee
Use .join(", ") rather that own implementation
gibbz00 Jan 22, 2023
c224bf3
Fix apply_trasaction rebase fail
gibbz00 Jan 22, 2023
95a2b87
Fix failing test
gibbz00 Jan 22, 2023
941624b
Run cargo fmt
gibbz00 Jan 23, 2023
7735b34
Use description conistenly
gibbz00 Jan 23, 2023
8e1a3da
Fix undeterministic test failure
gibbz00 Jan 23, 2023
16e2d74
Implement clippy tips
gibbz00 Jan 23, 2023
dc8e463
Make cargo fmt happy
gibbz00 Jan 23, 2023
4bfa470
Make updated cargo clippy happy
gibbz00 Jan 24, 2023
03088b2
Fight with cargo fmt round 3
gibbz00 Jan 24, 2023
eaf883b
Merge branch 'keymap-presentation' of https://github.com/gibbz00/heli…
gibbz00 Jan 25, 2023
fa615c2
Merge remote-tracking branch 'origin/master' into keymap-presentation
gibbz00 Jan 25, 2023
4af3d1d
Merge remote-tracking branch 'origin' into keymap-presentation
gibbz00 Jan 25, 2023
13a9f3e
merge escaped keymap test
gibbz00 Jan 25, 2023
8dd2169
Initial alternative solution to #5203
gibbz00 Jan 25, 2023
b8e1ee4
Scrapped FromIterator<InfoboxRow> idea
gibbz00 Jan 25, 2023
375238f
Infobox: Typaple commands w/ arguments formatting
gibbz00 Jan 25, 2023
8d4626c
Merge 'matt-cheely/labels-for-config-menus'
gibbz00 Feb 13, 2023
a7abb1f
Merge branch 'master' of https://github.com/helix-editor/helix into k…
gibbz00 Feb 13, 2023
b06eb3f
fix clippy warnigs
gibbz00 Feb 13, 2023
f44a348
Sorted infobox: place A- before C- bindings
gibbz00 Feb 14, 2023
b62d9a4
keyboard.rs: remove reduntant comments
gibbz00 Feb 14, 2023
b609a02
Merge 'bbodi/sticky-config/sticky-config'
gibbz00 Feb 15, 2023
72e1581
Sticky can now overwrite pre-defined sticky.
gibbz00 Feb 15, 2023
ad9bc2a
cargo fmt
gibbz00 Feb 15, 2023
34db341
Clarify sticky in remapping.md
gibbz00 Feb 15, 2023
2d9cea8
Add tests for user defined sticky
gibbz00 Feb 15, 2023
68c66ac
config.rs: clean up tests
gibbz00 Feb 15, 2023
6a81215
fix keytrie on default mappable command override bug
gibbz00 Feb 15, 2023
91d8d92
keytrie.rs: merge_keytrie() refactor
gibbz00 Feb 15, 2023
159150b
replace custom join with vec::join
gibbz00 Feb 15, 2023
683931a
revert some cleanup of use statements
gibbz00 Feb 15, 2023
e98afd2
improve keymap deserialize error handlig
gibbz00 Feb 15, 2023
d326827
fix clippy lints
gibbz00 Feb 16, 2023
a0d918a
custom description refinements
gibbz00 Feb 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
return errors for ambiguous and unsupported labels in menus
  • Loading branch information
MattCheely committed Dec 8, 2022
commit 0e6c4af38bad31c344d416f2b5592facccc4f26c
6 changes: 6 additions & 0 deletions helix-term/src/keymap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,12 @@ impl<'de> serde::de::Visitor<'de> for KeyTrieVisitor {

match command {
None => Ok(KeyTrie::Node(KeyTrieNode::new(label, mapping, order))),
Some(_command) if !order.is_empty() => {
Err(serde::de::Error::custom("ambiguous mapping: 'command' is only valid with 'label', but I found other keys"))
}
Some(MappableCommand::Static { .. }) if !label.is_empty() => {
Err(serde::de::Error::custom("custom labels are only available for typable commands (the ones starting with ':')"))
}
Some(MappableCommand::Typable { name, args, .. }) if !label.is_empty() => {
Ok(KeyTrie::Leaf(MappableCommand::Typable {
name,
Expand Down