Closed gilbox closed 8 years ago
You can do by changing default configuration of lazy-motion, but it have some drawback. Read following issue for detail this is same topic.
Thanks for the link. It make a lot of sense. I wish that space would match a separate token. So I guess this is a feature request, but maybe it is too complicated.
So def show
would match:
def show
def thing_show
log('definately should match because I also say "show"');
But not match:
log('definately should not match now')
... although the letters from def show
do appear in order in the phrase above, since should
and now
are separate tokens they should not match.
Matching non-adjacent tokens as I outlined above might be a mess. But I think it would be equally (or more) useful if it would only match adjacent tokens. So from the example above only the following two would match def show
:
def show
def thing_show
Did you try my isearch package? The ideas I can think from your above requirement is
space
, it disable fuzzy search and use simple incremental search.I have a plan to consolidate my lazy-motion and isearch as single package. And switch search strategy based on search pattern user input like.
space
it use exact match strategyor simply change strategy whthere search pattern include space or not..
How do you think?
Since lazy-motion heavily depending on filtering/scoreing feature of fuzzaldrin library, I cannot and dont want to tweak lazy search algorithm itself, so switching between simple search and lazy search is what I can do.
I tried isearch before lazy-motion and decided I liked lazy-motion better but it's been a while so I don't remember why anymore.
But I like your ideas of combining the two!
In my master branch(I still not releasing), I implemented your feature request.
Now you can specify multiple space separated search word to narrow mached result. If search pattern include white space char, it is splited then later word used to narrow former match.
Means, when you search 'def show' first, search text is split into ['def', 'show']
.
def
maching tokens.show
matching tokens from the line where def
token found.show
tokens where it's position is NOT greater than def
token.So when you search def show
, you can find show token only which comes right position of def
token.
This logic allow narrowing token by space separated search word.
Hi, I love this plugin. I'm wondering do you ever want to jump to something with a space? For example I often want to jump to something like
def show
. Is there a way to do this? Maybe this is not really the intention of this plugin but it breaks my flow a little to remember that I have to use the regular cmd+f find instead of lazy-motion.