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

Hoist helper functions from Selection into Cursor class. #196

Merged
merged 1 commit into from
Jul 1, 2021

Conversation

jenstroeger
Copy link
Collaborator

@jenstroeger jenstroeger commented Oct 29, 2020

This helper function is useful to check whether the cursor is currently inside of a certain element. For example, within links I want to ignore split and linefeed events:

      if (cursor.getParentContainer('A')) {
        return;
      }

@peyerluk, I think you had implemented a similar function in PR #99 regarding links and not wanting to wrap a link in a link. This PR might support yours?

src/cursor.js Outdated Show resolved Hide resolved
@jenstroeger
Copy link
Collaborator Author

@peyerluk, I rebased on yesterday’s master.

@jenstroeger
Copy link
Collaborator Author

I removed the getParentContainer() function, and this PR now contains only the hoisted functions in a single commit.

@jenstroeger jenstroeger changed the title Add getParentContainer() helper function to cursor. Hoist helper functions from Selection into Cursor class. Jul 1, 2021
@peyerluk peyerluk merged commit 8e42af7 into livingdocsIO:master Jul 1, 2021
@livingdocs-automation
Copy link
Collaborator

🎉 This PR is included in version 2.10.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@jenstroeger
Copy link
Collaborator Author

@peyerluk, @marcbachmann, when hoisting these three methods from Selection to Cursor I forgot to adjust the comments, e.g. “Get all tags that affect the current selection.” I think that should be “Get all tags that affect the current cursor or selection.”. Do you care, then I’ll add another PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants