File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1007,8 +1007,8 @@ private void CopyWithoutIndicators()
10071007 if ( startPosition . Location > endPosition . Location )
10081008 ( startPosition , endPosition ) = ( endPosition , startPosition ) ;
10091009
1010- var startIdx = Math . Min ( startPosition . Line - 1 , lines . Count - 1 ) ;
1011- var endIdx = Math . Min ( endPosition . Line - 1 , lines . Count - 1 ) ;
1010+ var startIdx = startPosition . Line - 1 ;
1011+ var endIdx = endPosition . Line - 1 ;
10121012
10131013 if ( startIdx == endIdx )
10141014 {
@@ -1025,7 +1025,7 @@ private void CopyWithoutIndicators()
10251025 }
10261026
10271027 var builder = new StringBuilder ( ) ;
1028- for ( var i = startIdx ; i <= endIdx ; i ++ )
1028+ for ( var i = startIdx ; i <= endIdx && i <= lines . Count - 1 ; i ++ )
10291029 {
10301030 var line = lines [ i ] ;
10311031 if ( line . Type == Models . TextDiffLineType . Indicator ||
@@ -1040,7 +1040,7 @@ private void CopyWithoutIndicators()
10401040
10411041 if ( i == endIdx && endPosition . Column < line . Content . Length )
10421042 {
1043- builder . AppendLine ( line . Content . Substring ( 0 , endPosition . Column ) ) ;
1043+ builder . AppendLine ( line . Content . Substring ( 0 , endPosition . Column - 1 ) ) ;
10441044 continue ;
10451045 }
10461046
You can’t perform that action at this time.
0 commit comments