File tree 2 files changed +17
-18
lines changed
2 files changed +17
-18
lines changed Original file line number Diff line number Diff line change @@ -11,28 +11,17 @@ public partial class PSConsoleReadLine
11
11
/// <param name="current">The position in the current logical line.</param>
12
12
private static int GetBeginningOfLinePos ( int current )
13
13
{
14
- var newCurrent = current ;
15
-
16
- if ( _singleton . LineIsMultiLine ( ) )
14
+ int i = Math . Max ( 0 , current ) ;
15
+ while ( i > 0 )
17
16
{
18
- int i = Math . Max ( 0 , current ) ;
19
- while ( i > 0 )
17
+ if ( _singleton . _buffer [ -- i ] == '\n ' )
20
18
{
21
- if ( _singleton . _buffer [ -- i ] == '\n ' )
22
- {
23
- i += 1 ;
24
- break ;
25
- }
19
+ i += 1 ;
20
+ break ;
26
21
}
27
-
28
- newCurrent = i ;
29
- }
30
- else
31
- {
32
- newCurrent = 0 ;
33
22
}
34
23
35
- return newCurrent ;
24
+ return i ;
36
25
}
37
26
38
27
/// <summary>
@@ -114,7 +103,7 @@ private static int GetFirstNonBlankOfLogicalLinePos(int current)
114
103
115
104
var newCurrent = beginningOfLine ;
116
105
117
- while ( IsVisibleBlank ( newCurrent ) )
106
+ while ( newCurrent < _singleton . _buffer . Length && IsVisibleBlank ( newCurrent ) )
118
107
{
119
108
newCurrent ++ ;
120
109
}
Original file line number Diff line number Diff line change @@ -178,6 +178,16 @@ public void ViMoveToFirstNonBlankOfLogicalLine_NoOp_OnEmptyLine()
178
178
) ) ;
179
179
}
180
180
181
+ [ SkippableFact ]
182
+ public void ViDefect2050 ( )
183
+ {
184
+ TestSetup ( KeyMode . Vi ) ;
185
+
186
+ Test ( "" , Keys (
187
+ _ . Escape , _ . Underbar
188
+ ) ) ;
189
+ }
190
+
181
191
[ SkippableFact ]
182
192
public void ViMoveToEndOfLine_NoOp_OnEmptyLine ( )
183
193
{
You can’t perform that action at this time.
0 commit comments