New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Next match #2279
Next match #2279
Conversation
let isForward = path = SearchPath.Forward | ||
MotionResult.Create(span, motionKind, isForward) |> Some | ||
|
||
_vimData.ResumeDisplayPattern() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed here? I didn't see anything obvious in this function that would kill the display pattern here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was unable to leverage x.SearchCore
because the semantics were so different, but I did use it as a reference as if I were using it. In this case, ResumeDisplayPattern
is the second to last line of x.SearchCore
.
My assumption is that if the user has manually disabled hlsearch
that any kind of search continuation should reenable it. In other words, gn
has the same semantics relative to hlsearch
as n
does.
let checkOptions = findData.FindOptions &&& (~~~FindOptions.SearchReverse) | ||
let checkFindData = FindData(findData.SearchString, snapshot, checkOptions, findData.TextStructureNavigator) | ||
match x.FindNextRaw checkFindData position with | ||
| Some matchSpan -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using when
here. I think it makes it a bit more concise. I've actually becoming a bigger fan of when
after reviewing your PRs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Part of my goal for contributing to VsVim is to get more real-world experience programming F#. One of the side effects of writing a lot of code is gradually learning about language features and formulating opinions about them.
The nuance I now understand about when
with `match is that it subverts "exhaustive matching". That is fine when you are trying to do a match for one thing with an additional condition. But it always has to be weighed against the security of exhaustive matching.
In this case, Some
/None
matching will never be expanded to include a third option and so it is a good candidate for match
/when
.
Really excited about this motion. It's something I've wanted for a while now. |
Changes
gn
andgN
family of key bindingsIssues