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

feat(supersearch): Insert space before qualifier (LWS-286) #1198

Merged
merged 5 commits into from
Jan 15, 2025

Conversation

jesperengstrom
Copy link
Contributor

@jesperengstrom jesperengstrom commented Jan 8, 2025

Description

Tickets involved

LWS-286

Solves

Avoids breaking a qualifier pill by typing stuff before it, inadvertently altering the qualifierKey.

Summary of changes

  • Provide a insertSpaceBeforeQualifier function with the plugin - a transaction filter that checks if any atomic range overlaps the cursor position. If so, add a blank space at the position (before the pill).
  • For easier access to the atomic ranges, we now build a separate range set while creating the widgets by using a RangeSetBuilder. This can then be passed directly to Editorview.atomicRanges and the insertSpace functions, and previous workarounds (atomic prop, filterAtomic function are no longer needed).
  • Some general refactoring of the plugin.

@jesperengstrom jesperengstrom changed the title fix(supersearch): Insert space before qualifier (LWS-286) feat(supersearch): Insert space before qualifier (LWS-286) Jan 8, 2025
@jesperengstrom jesperengstrom marked this pull request as ready for review January 8, 2025 16:47
Copy link
Contributor

@johanbissemattsson johanbissemattsson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work (also with the usage of RangeSetBuilder)! 🙌

See comments regarding the number of spaces added.

@jesperengstrom jesperengstrom merged commit 666663d into develop Jan 15, 2025
3 checks passed
@jesperengstrom jesperengstrom deleted the fix-supersearch-insert-space-before-qualifier branch January 15, 2025 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants