Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Removes unnecessary check for non-word character boundaries in selectNextOccurrence - #356

Closed
erkattak wants to merge 1 commit into
atom:masterfrom
erkattak:master
Closed

erkattak wants to merge 1 commit into
atom:masterfrom
erkattak:master

Conversation

@erkattak

Copy link
Copy Markdown

Fixes #340

TL;DR - If I've selected a string of text, I expect that I'm able to jump to every occurrence of that string in the buffer, regardless of it's boundaries.

Note: There is a failing test. For the life of me, I can't figure out why it is failing - it should work. Maybe it's just a stupid mistake because I'm tired.

@benogle

benogle commented Feb 27, 2015

Copy link
Copy Markdown
Contributor

What happens when you put a forgot in that spec? Does it match the for in forget?

@erkattak

Copy link
Copy Markdown
Author

Not sure which spec you're referring to, but if I have selected for it should match any instance of for regardless of whether it's part of a word or not.

ie.

[for]
[for]got
[for]get
un[for]get

@benogle

benogle commented Feb 27, 2015

Copy link
Copy Markdown
Contributor

I'm inclined to keep it the way it is. Maybe the regex that handles the boundary should be adjusted for the _ case. Maybe the nonWordRegex setting should not be used here. But when I search for for, I do not want it to match [for]get.

@erkattak

Copy link
Copy Markdown
Author

I'm open to whatever everyone thinks is best. I personally find it frustrating that the matches that richrace/highlight-selected finds do not match the find-and-replace matches (and also other editors - from Sublime to vim and less [linux]). It's tripped me up a few times, thinking I replaced everything I needed to, only to find there were weird cases like with underscores.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Select next misses matches when starting with selection at the end of a word

3 participants