@@ -21,23 +21,16 @@ public partial class PSConsoleReadLine
2121 /// </summary>
2222 public static void EndOfLine ( ConsoleKeyInfo ? key = null , object arg = null )
2323 {
24- if ( _singleton . LineIsMultiLine ( ) )
24+ int i = _singleton . _current ;
25+ for ( ; i < _singleton . _buffer . Length ; i ++ )
2526 {
26- int i = _singleton . _current ;
27- for ( ; i < _singleton . _buffer . Length ; i ++ )
27+ if ( _singleton . _buffer [ i ] == '\n ' )
2828 {
29- if ( _singleton . _buffer [ i ] == '\n ' )
30- {
31- break ;
32- }
29+ break ;
3330 }
34-
35- _singleton . MoveCursor ( ( i == _singleton . _current ) ? _singleton . _buffer . Length : i ) ;
36- }
37- else
38- {
39- _singleton . MoveCursor ( _singleton . _buffer . Length ) ;
4031 }
32+
33+ _singleton . MoveCursor ( ( i == _singleton . _current ) ? _singleton . _buffer . Length : i ) ;
4134 }
4235
4336 /// <summary>
@@ -97,7 +90,7 @@ public static void ViForwardChar(ConsoleKeyInfo? key = null, object arg = null)
9790 }
9891 else
9992 {
100- ViOffsetCursorPosition ( + numericArg ) ;
93+ ViOffsetCursorPosition ( + numericArg ) ;
10194 }
10295 }
10396 }
@@ -109,7 +102,7 @@ public static void ViBackwardChar(ConsoleKeyInfo? key = null, object arg = null)
109102 {
110103 if ( TryGetArgAsInt ( arg , out var numericArg , 1 ) )
111104 {
112- ViOffsetCursorPosition ( - numericArg ) ;
105+ ViOffsetCursorPosition ( - numericArg ) ;
113106 }
114107 }
115108
@@ -225,7 +218,8 @@ private void MoveToLineImpl(int lineOffset)
225218 point = point ?? ConvertOffsetToPoint ( _current ) ;
226219 int newY = point . Value . Y + lineOffset ;
227220
228- Point newPoint = new Point ( ) {
221+ Point newPoint = new Point ( )
222+ {
229223 X = _moveToLineDesiredColumn ,
230224 Y = Math . Max ( newY , _initialY )
231225 } ;
@@ -470,18 +464,18 @@ public static void GotoBrace(ConsoleKeyInfo? key = null, object arg = null)
470464 int direction ;
471465 switch ( token . Kind )
472466 {
473- case TokenKind . LParen : toMatch = TokenKind . RParen ; direction = 1 ; break ;
474- case TokenKind . LCurly : toMatch = TokenKind . RCurly ; direction = 1 ; break ;
475- case TokenKind . LBracket : toMatch = TokenKind . RBracket ; direction = 1 ; break ;
467+ case TokenKind . LParen : toMatch = TokenKind . RParen ; direction = 1 ; break ;
468+ case TokenKind . LCurly : toMatch = TokenKind . RCurly ; direction = 1 ; break ;
469+ case TokenKind . LBracket : toMatch = TokenKind . RBracket ; direction = 1 ; break ;
476470
477- case TokenKind . RParen : toMatch = TokenKind . LParen ; direction = - 1 ; break ;
478- case TokenKind . RCurly : toMatch = TokenKind . LCurly ; direction = - 1 ; break ;
479- case TokenKind . RBracket : toMatch = TokenKind . LBracket ; direction = - 1 ; break ;
471+ case TokenKind . RParen : toMatch = TokenKind . LParen ; direction = - 1 ; break ;
472+ case TokenKind . RCurly : toMatch = TokenKind . LCurly ; direction = - 1 ; break ;
473+ case TokenKind . RBracket : toMatch = TokenKind . LBracket ; direction = - 1 ; break ;
480474
481- default :
482- // Nothing to match (don't match inside strings/comments)
483- Ding ( ) ;
484- return ;
475+ default :
476+ // Nothing to match (don't match inside strings/comments)
477+ Ding ( ) ;
478+ return ;
485479 }
486480
487481 var matchCount = 0 ;
0 commit comments