Closed jacekkopecky closed 9 years ago
I can confirm that any exact string containing spaces is not found/highlighted.
Yes, Its expected behavior.
Since default lazy-motion.wordRegExp
config not include space character.
The chars not included this setting is treated as word separator.
'[@\\w-.():?]+'
This is how it works.
wordRegExp
.You can modify wordRegExp
to include space
. But the more we add the character, the more each word become longer and lost uniqueness of each word.
So I don't recommend adding space char to it. If you need search space including char use my isearch package or default search.
You can check currently recognized token by input one space
.
Since in fuzzaldrin's fuzzy filter match space to any candidates.
As you can see, not only space
, ;
and '
is also excluded from candidate word since its not included wordRegExp
.
One note, why single space
match all the candidates is fuzzaldrin replace it to blank char.
So, for space
in your search chars have no meaning, it been replaced to ''
(blank).
But anyway you need to add `(space char) to
lazy-motion.wordRegExp` first to make space containing word as candidate.
Oh, I understand now, that makes perfect sense.
My regexp is now [@\w-.():?]+|"[^"\n]*"|'[^'\n]*'
to also match string literals.
Default wordRegExp is very depending on my preference for coding CoffeeScript. And not necessarily appropriate for everyone. I think I need to improve default wordRegExp setting. But the more you add chars to this setting, the more you have less candidate and each word got long. This result in you can't reach specific position with lazy search.
Yup, I like how the regexp is configurable, and it's good to see the trade-offs. I guess initially I didn't quite understand that lazy-jump
is focused on tokens rather than other forms of fuzzy matches in the file - it may be because I don't know fuzzaldrin.
If you want to improve or change RegExp setting.
Change lazy-motion.wordRegExp
and observe how each candidate(or token) would be, by input single space
as search char.
Why this single space is special is because fuzzaldrin replace single space to blank char before filtering. And filtering candidates with blank char result in all candidate is matched(no filter happen). Like this way you can observe how your wordRegExp setting change candidates.
This is not intended behavior but its harmless and usefull for check your wordRegExp setting. So until fuzzaldrin change this space replacement behavior, this tips is available.
e.g.
\w
single numerical and alphabet and underscore char.
\w+
sequence of \w
I'm editing a file that has the text "the c keybinding" in it; using lazy motion and searching for
the c
doesn't find that. That's with lazy-motion 0.1.9