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

fix(navigator): wrong spans after selection #952

Merged
merged 1 commit into from
Nov 18, 2024
Merged

Conversation

ksqsf
Copy link
Member

@ksqsf ksqsf commented Nov 17, 2024

The cached spans can be wrong if not invalidated after selection.

Consider: aabbccdd which can be understood as both 'aa'bb'cc'dd' and 'aab'bcc'dd'.

Suppose the first candidate is from 'aa'bb'cc'dd'. Now do {Control+Right}{Right}{Space} to select the first candidate of aab. Now do {Control+Right} again:

  • Expected: [aab]bcc|dd
  • Actual: [aab]b|ccdd (| is the caret)

This is because the spans are not recomputed even if we have picked a specific kind of segmentation. This PR adds a select handler and clears the spans to force the recomputation of the spans.

Pull request

Issue tracker

Fixes will automatically close the related issue

Fixes #

Feature

Describe feature of pull request

Unit test

  • Done

Manual test

  • Done

Code Review

  1. Unit and manual test pass
  2. GitHub Action CI pass
  3. At least one contributor reviews and votes
  4. Can be merged clean without conflicts
  5. PR will be merged by rebase upstream base

Additional Info

@ksqsf ksqsf requested a review from lotem November 17, 2024 17:14
@ksqsf ksqsf merged commit 0a983b4 into master Nov 18, 2024
10 checks passed
@ksqsf ksqsf deleted the fix-navigator-spans branch November 18, 2024 01:35
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