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

Feature Eval: store and retrieve text #650

Closed
6 of 56 tasks
LexiconCode opened this issue Jul 16, 2019 · 2 comments
Closed
6 of 56 tasks

Feature Eval: store and retrieve text #650

LexiconCode opened this issue Jul 16, 2019 · 2 comments
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.

Comments

@LexiconCode
Copy link
Member

LexiconCode commented Jul 16, 2019

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

  • adobe_acrobat
  • atom
  • dragon
  • eclipse
  • emacs
  • excel
  • explorer
  • file_dialogue
  • flashdevelop
  • fman
  • foxitreader
  • gitbash
  • githubdesktop
  • gitter Added store and retrieve to gitter #651
  • griddouglas
  • gridlegion
  • gridrainbow
  • ide
  • kdiff3
  • lyx
  • msvc
  • notepadplusplus
  • outlook
  • rstudio
  • shared
  • sqldeveloper
  • ssms
  • sublime
  • totalcmd
  • typora
  • visualstudio
  • vscode
  • winword

lib\ccr

Noted Limitations

@LexiconCode LexiconCode added Enhancement Enhancement of an existing feature Grammar Related to a grammar for an application or programming language. Caster Core Spec Issues for Caster Specs that are not part of the application or language specific grammar/ccr labels Jul 16, 2019
@LexiconCode LexiconCode changed the title Feature Eval: store and retrieve Feature Eval: store and retrieve text Jul 16, 2019
@LexiconCode LexiconCode added the Documentation Needed Issue needs grammars or function documentation label Jul 16, 2019
@LexiconCode
Copy link
Member Author

Note different editors treat the clipboard differently when no text is selected. VScode copies a whole line if no text is selected.

@LexiconCode
Copy link
Member Author

This can cause issues if an editor copies online when there is no text selected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

No branches or pull requests

1 participant