forked from cursorless-everywhere/cursorless
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add modifiers, more special marks to cheatsheet (cursorless-dev#885)
* add bounds,inside,row,up,down to cheatsheet * use correct ids * PR comment Co-authored-by: Pokey Rule <[email protected]> * PR comment Co-authored-by: Pokey Rule <[email protected]> * PR comment Co-authored-by: Pokey Rule <[email protected]> * # -> number * include line_direction special marks in cheatsheet * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add modifiers section to cheatsheet * Better special mark descriptions * Modifiers descriptions * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * modifier description fix up * update spoken form defaults * Various improvements * Revert accidental change Co-authored-by: Pokey Rule <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
547e11d
commit 6c54a17
Showing
6 changed files
with
312 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
cursorless-talon/src/cheatsheet_html/sections/modifiers.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
from ..get_list import get_raw_list, make_dict_readable | ||
|
||
MODIFIER_LIST_NAMES = [ | ||
"simple_modifier", | ||
"interior_modifier", | ||
"head_tail_modifier", | ||
] | ||
|
||
|
||
def get_modifiers(): | ||
all_modifiers = {} | ||
for name in MODIFIER_LIST_NAMES: | ||
all_modifiers.update(get_raw_list(name)) | ||
|
||
complex_modifier_ids = [ | ||
"extendThroughStartOf", | ||
"extendThroughEndOf", | ||
] | ||
simple_modifiers = { | ||
key: value | ||
for key, value in all_modifiers.items() | ||
if value not in complex_modifier_ids | ||
} | ||
complex_modifiers = { | ||
value: key | ||
for key, value in all_modifiers.items() | ||
if value in complex_modifier_ids | ||
} | ||
|
||
return [ | ||
*make_dict_readable( | ||
"modifier", | ||
simple_modifiers, | ||
{ | ||
"excludeInterior": "Bounding paired delimiters", | ||
"toRawSelection": "No inference", | ||
"leading": "Leading delimiter range", | ||
"trailing": "Trailing delimiter range", | ||
}, | ||
), | ||
{ | ||
"id": "extendThroughStartOf", | ||
"type": "modifier", | ||
"variations": [ | ||
{ | ||
"spokenForm": complex_modifiers["extendThroughStartOf"], | ||
"description": "Extend through start of line", | ||
}, | ||
{ | ||
"spokenForm": f"{complex_modifiers['extendThroughStartOf']} <M>", | ||
"description": "Extend through start of <M>", | ||
}, | ||
], | ||
}, | ||
{ | ||
"id": "extendThroughEndOf", | ||
"type": "modifier", | ||
"variations": [ | ||
{ | ||
"spokenForm": complex_modifiers["extendThroughEndOf"], | ||
"description": "Extend through end of line", | ||
}, | ||
{ | ||
"spokenForm": f"{complex_modifiers['extendThroughEndOf']} <M>", | ||
"description": "Extend through end of <M>", | ||
}, | ||
], | ||
}, | ||
] |
Oops, something went wrong.