File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -261,6 +261,10 @@ private int ViFindBrace(int i)
261261 for ( int idx = 0 ; idx < parenthese . Length ; idx ++ )
262262 if ( parenthese [ idx ] == _buffer [ nextParen ] ) goto Outer ;
263263
264+ // if not found, nextParen could exceed the range
265+ if ( nextParen >= _buffer . Length )
266+ return i ;
267+
264268 Outer :
265269 int match = _buffer [ nextParen ] switch
266270 {
Original file line number Diff line number Diff line change 1- using System . Collections . Generic ;
2- using Xunit ;
1+ using Xunit ;
32
43namespace Test
54{
@@ -477,7 +476,7 @@ public void ViGotoBrace()
477476
478477 // Closing paren without backward match
479478 string input2 = $ "0]2)4foo{ closing } ";
480- Test ( input2 , Keys (
479+ TestMustDing ( input2 , Keys (
481480 input2 ,
482481 CheckThat ( ( ) => AssertCursorLeftIs ( 9 ) ) ,
483482 _ . Escape , CheckThat ( ( ) => AssertCursorLeftIs ( 8 ) ) ,
You can’t perform that action at this time.
0 commit comments