Feature Eval: store and retrieve text #650
Labels
Caster Core Spec
Issues for Caster Specs that are not part of the application or language specific grammar/ccr
Documentation Needed
Issue needs grammars or function documentation
Enhancement
Enhancement of an existing feature
Grammar
Related to a grammar for an application or programming language.
Store and Retrieve text #649
Code Reference: temporary.py
Stores the currently highlighted text in a temporary variable,
to be Retrieved after some other action. If no text was
highlighted, an empty string will be stored.
Sample usage:
"find that": Store() + Key("c-f") + Retrieve() + Key("enter")
In order to enable use with web URLs, Store() takes a string,
space, which will replace all space characters, and a bool,
remove_cr, which if true will remove any newlines in the
selection, to avoid them triggering the request early.
Sample usage:
"wikipedia that": Store(space="+", remove_cr=True) + Key("c-t") + Text("https://en.wikipedia.org/w/index.php?search=") + Retrieve() + Key("enter")
There are cases where you may want the same function to do
different things depending on whether or not text was highlighted.
The action_if_no_text and action_if_text arguments to Retrieve()
are calls to Key() and allow this.
For example, you may want to finish inside a set of brackets
if no text was highlighted, but outside if there was text.
Sample usage:
"insert bold text": Store() + Text("\\textbf{}") + Key("left") + Retrieve(action_if_text="right")
NOTE:
If the highlighted text is the same as what is currently on the
clipboard, an empty string will be stored. This is a necessary
side-effect of being able to detect when no text is highlighted.
Grammar List
Pull request will be marked for each item. Checked item without a pull request means no changes were made
castervoice\apps
lib\ccr
Noted Limitations
Multiline highlights with Store/Retrieve can cause unexpected results mileage may vary. This feature is best utilized with single-line selections.resolved by Changed output of Retrieve() from Text to dragonfly Paste action #652The text was updated successfully, but these errors were encountered: