toggleMark: append mark unless it is already present throughout the selection #17
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "toggle-mark-patch"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
greetings! 👋
we've had a few users report that they expect a mark to be toggled on when only a subset of their selection is already similarly marked.
ie: "something important!" > "something important!"
i checked a few other text editors and the current behavior definitely appears to be an aberration.
if this isn't a change you're interested in landing, no offense taken. if it is something you're willing to entertain, i'm happy polish up this PR by updating the inline documentation and taking a crack at writing a new unit test to verify the expected behavior.
We cannot change the default behavior at this point. But attached patch adds an option that allows you to opt in to the behavior you describe. Does that look like it'd solve your problem?
i appreciate the quick response @marijnh. your patch typically results in the desired behavior.
one quirk i noticed is that the new flag makes it impossible to remove a mark from text selections with trailing whitespace.
ie: "important! " > "important! "
Thanks for spotting that. Attached patch should help.
Pull request closed