make gapcursor stop at defining nodes #3

Closed
johanneswilm wants to merge 3 commits from before-table into master
johanneswilm commented 2017-10-14 15:26:26 +02:00 (Migrated from github.com)

This works for me (I think), but I must admit I don't understand the idea behind some parts of it.
This does two things:

A) Take the defining attribute of nodes as a definite boundary so that the gapcursor can be placed on either side if appropriate.

B) When the old state had a node selection, it seems like we need to look for a valid position starting from the end of the node in the given direction, and given that we start by increasing/decreasing the position by 1 before checking for validity, we need to give it the opposing edge as a starting point.

So for example, current selection (a node selection) is:

<p>blablbla[<image>]</p>

The user uses the right arrow key. The first position we need to check for validity is here:

<p>blablbla<image>|</p>

But because the checker automatically changes the position by one, we need to use this as the starting check position:

<p>blablbla|<image></p>

Maybe this makes sense. Maybe I didn't get central parts about how this is to function.

This works for me (I think), but I must admit I don't understand the idea behind some parts of it. This does two things: A) Take the defining attribute of nodes as a definite boundary so that the gapcursor can be placed on either side if appropriate. B) When the old state had a node selection, it seems like we need to look for a valid position starting from the end of the node in the given direction, and given that we start by increasing/decreasing the position by 1 before checking for validity, we need to give it the opposing edge as a starting point. So for example, current selection (a node selection) is: <p>blablbla[<image>]</p> The user uses the right arrow key. The first position we need to check for validity is here: <p>blablbla<image>|</p> But because the checker automatically changes the position by one, we need to use this as the starting check position: <p>blablbla|<image></p> Maybe this makes sense. Maybe I didn't get central parts about how this is to function.
marijnh commented 2018-03-09 16:07:44 +01:00 (Migrated from github.com)

I'm not comfortable merging this, but I guess the plugin is small enough for you to use a fork (which, I suppose, is what you've been doing in the awful long time that I failed to respond to this).

I'm not comfortable merging this, but I guess the plugin is small enough for you to use a fork (which, I suppose, is what you've been doing in the awful long time that I failed to respond to this).
johanneswilm commented 2018-03-09 16:14:59 +01:00 (Migrated from github.com)

@marijnh Just for the record -- I did not use a fork, because even though the current plugin doesn't entirely do what I want, I don't at all have time to maintain a fork. I hope someone else takes this upon themselves some time in the future.

@marijnh Just for the record -- I did not use a fork, because even though the current plugin doesn't entirely do what I want, I don't at all have time to maintain a fork. I hope someone else takes this upon themselves some time in the future.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
prosemirror/prosemirror-gapcursor!3
No description provided.