We'd like for users to be able to define more complex custom grammars. To do so, they'll need full access to the types of commands supported by cursorless, whereas today they can just do a single target, with no extra arguments
Proposal
See #492 (comment) below
Old proposal
Example
complete [<user.cursorless_target>]:
target = user.cursorless_target("collectionItem", cursorless_target)
user.cursorless_command("setSelectionBefore", target)
key(right:3 delete x)
More verbose alternative
complete [<user.cursorless_target>]:
user_target = cursorless_target or "this"
item_modifier = user.cursorless_containing_scope("collectionItem")
target = user.cursorless_add_modifier(item_modifier, user_target)
# Could reduce the above two lines to:
# target = user.cursorless_expand_to_scope("collectionItem", user_target)
Use cases
Checking a box in a markdown checklist
See also #452 and #453
Consider if we want to support extending/overriding other internal cursorless features.
eg support for when focus is not on the text editor. #1717 (comment)
We'd like for users to be able to define more complex custom grammars. To do so, they'll need full access to the types of commands supported by cursorless, whereas today they can just do a single target, with no extra arguments
extraArgsgetTextactionactions.user.cursorless_implicit_target_command?Proposal
See #492 (comment) below
Old proposal
cursorless_targetthat accepts a list of scope ids, followed by an optional target dict. Can accept None as last arg as well and that's equivalent to "this" / omitting mark. If it gets a target it prepends the containing scope modifiers to the target's modifierscursorless_target("every", "collectionItem", "this")Example
More verbose alternative
Use cases
Checking a box in a markdown checklist
See also #452 and #453
Consider if we want to support extending/overriding other internal cursorless features.
eg support for when focus is not on the text editor. #1717 (comment)