Fix that ViFindBrace doesn't search for brace when current char is not a brace#4862
Fix that ViFindBrace doesn't search for brace when current char is not a brace#4862sharpchen wants to merge 1 commit intoPowerShell:masterfrom
Conversation
|
S |
|
You are right that's how it works. I'm hoping we can do two things: verify the order of precedence in vanilla Vi (I was playing around trying to determine it and couldn't make heads or tails of it), and add some unit tests. Thanks! Love the fix though. |
Not sure what it means? If you mean the standard behavior,
And
It indeed requires some tests. I did find at least one inconsistent behavior. |
|
Hi @andyleejordan. I've rewrote the implementation, I think it's now good to go. |
| // find next of any kind of paren | ||
| for (; nextParen < _buffer.Length; nextParen++) | ||
| for (int idx = 0; idx < parenthese.Length; idx++) | ||
| if (parenthese[idx] == _buffer[nextParen]) goto Outer; |
There was a problem hiding this comment.
The rare great use of goto
|
I'm not sure but if this build is like others (looking at PSScriptAnalyzer right now), AppVeyor is at least running tests, looks like |
611243c to
fee3566
Compare
|
Looks like tests are only available on Windows.
I honestly have no idea why test's failing. There's is a input but claims no key. |
I forgot about that but yes this is unfortunately true. |
PR Summary
Vi searches right pair of first left brace, or first right brace when current char is not a brace. This pr added this functionality.
After the update,

ViGotoBraceshould work like this(of course this will also affect other methods such asViDeleteBrace):PR Checklist
Microsoft Reviewers: Open in CodeFlow