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

Add insertion property for custom scripts #75

Closed
Clarko opened this issue Jun 24, 2020 · 2 comments
Closed

Add insertion property for custom scripts #75

Clarko opened this issue Jun 24, 2020 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@Clarko
Copy link

Clarko commented Jun 24, 2020

Scripts may want to add data at the current insertion point, rather than replace data.

Reason for request: I just wrote a Lorem Ipsum script and realized it can't just insert a lipsum paragraph into an existing string. It can only replace the fullText or replace a (non-zero-length) selection.

Totally invented use cases for insertion:

  • get today's date
  • roll a die
  • flip a coin
@IvanMathy IvanMathy added enhancement New feature or request good first issue Good for newcomers labels Jun 27, 2020
@IvanMathy
Copy link
Owner

Interesting, this is a good idea. I feel like it could work nicely as a function maybe? Something like

state.insert("Something")

In the meantime, you can probably get the same behavior with:

state.text = state.text + "Something"

Not ideal, obviously.

@IvanMathy
Copy link
Owner

Fixed in #109, look for it in release 1.2.0!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants