Skip to content

Tyler leonhardt/quick access highlight fix#131292

Merged
TylerLeonhardt merged 5 commits intomainfrom
TylerLeonhardt/quick-access-highlight-fix
Aug 23, 2021
Merged

Tyler leonhardt/quick access highlight fix#131292
TylerLeonhardt merged 5 commits intomainfrom
TylerLeonhardt/quick-access-highlight-fix

Conversation

@TylerLeonhardt
Copy link
Member

Just the "quotes" support from #131215 fixing the highlighting problem so typing:

"26" will actually highlight 2020-7-26 and not 2020-7-26.

Copy link
Member

@bpasero bpasero left a comment

Choose a reason for hiding this comment

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

This is a very elegant fix, good job 👍

Please add a test too that covers this case: highlights are proper when allowNonContiguousMatches: false for the standup file case.

// found out this is contiguous otherwise there wouldn't have been a score
queryIndexGtNull ||
// lastly check if the query is completely contiguous at this index in the target
target.startsWith(query, targetIndex)
Copy link
Member

Choose a reason for hiding this comment

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

A micro-optimization would be to not check for startsWith if query length = 1 because if we have a score, it means the character must match. But not sure its worth it.

Copy link
Member Author

Choose a reason for hiding this comment

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

sounds like the difference is comparing a single character string vs a number... it is faster... but this if statement is already big enough, I think I'd rather leave that optimization out for simplicity

@bpasero bpasero added this to the August 2021 milestone Aug 21, 2021
@TylerLeonhardt TylerLeonhardt marked this pull request as ready for review August 23, 2021 17:58
@TylerLeonhardt TylerLeonhardt merged commit c574731 into main Aug 23, 2021
@TylerLeonhardt TylerLeonhardt deleted the TylerLeonhardt/quick-access-highlight-fix branch August 23, 2021 17:59
@github-actions github-actions bot locked and limited conversation to collaborators Oct 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants