-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
feat(commands) increment by range #4418
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
Changes from 2 commits
32644a9
455c46c
ee146f4
0ac55c0
5b5d0a7
c5c59f3
d949f6e
76ff510
fdd5e4b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -311,6 +311,9 @@ pub fn default() -> HashMap<Mode, Keymap> { | |
|
||
"C-a" => increment, | ||
"C-x" => decrement, | ||
|
||
"A-a" => increasing_increment, | ||
// "A-x" => decreasing_decrement, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this uncommented? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Do you have any suggestions for a better keymap? |
||
}); | ||
let mut select = normal.clone(); | ||
select.merge_nodes(keymap!({ "Select mode" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of passing amounts to
increase_impl
, we can create an enumAnd pass that to
increment_impl
, then check thecx.count
andcx.register
in the body ofincrement_impl
and then decide whether to use a positive or negative amount based on the passed direction.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, won't we need a 3rd value for the enum if we don't want to increase it at all?
Alright, that makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Count can't be 0 so we don't need a third member