Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Clean `ivy--regex-plus' to prepare to `ivy--regex-plus-ignore-order' #344
The current implementation of
When trying to implement the '!' behavior in
I also realized that ivy--regex-plus could be considered as a thin wrapper around "something that returns regex" and added the behavior of '!'. I thought that it could be a good idea to use it around ivy--regex-ignore-order also.
Unfortunately, ivy--regex-plus is difficult to work on since it returns either a string or a list of cons (let's call it a ivy style regex :-)). Also, it assumed that the called function (ivy--regex) returned a string and not an ivy style regex.
The purpose of this patch is to make `ivy--regex-plus' cleaner, not relying on the assumption that the called function returns a string.
To do that, I added ivy--regex-normalize that is fed with either a string or a ivy style regex and return a ivy style regex. Then ivy--regex-plus makes use of it.
I don't know yet how to customize ivy--regex-plus to use either ivy--regex or ivy--regex-ignore-order, but now, I feel that the base is clean enough to do this.
Thanks for the effort, but it's really not a good change:
Please don't take it as offense, I usually try to clean up and salvage contributions, but there's nothing that I can keep from this one.