File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -37,32 +37,32 @@ public BlockNavigation(List<Models.TextDiffLine> lines)
3737
3838 var lineIdx = 0 ;
3939 var blockStartIdx = 0 ;
40- var isNewBlock = true ;
40+ var isReadingBlock = false ;
4141 var blocks = new List < Block > ( ) ;
4242
4343 foreach ( var line in lines )
4444 {
4545 lineIdx ++ ;
4646 if ( line . Type is Models . TextDiffLineType . Added or Models . TextDiffLineType . Deleted or Models . TextDiffLineType . None )
4747 {
48- if ( isNewBlock )
48+ if ( ! isReadingBlock )
4949 {
50- isNewBlock = false ;
50+ isReadingBlock = true ;
5151 blockStartIdx = lineIdx ;
5252 }
5353 }
5454 else
5555 {
56- if ( ! isNewBlock )
56+ if ( isReadingBlock )
5757 {
5858 blocks . Add ( new Block ( blockStartIdx , lineIdx - 1 ) ) ;
59- isNewBlock = true ;
59+ isReadingBlock = false ;
6060 }
6161 }
6262 }
6363
64- if ( ! isNewBlock )
65- blocks . Add ( new Block ( blockStartIdx , lines . Count - 1 ) ) ;
64+ if ( isReadingBlock )
65+ blocks . Add ( new Block ( blockStartIdx , lines . Count ) ) ;
6666
6767 _blocks . AddRange ( blocks ) ;
6868 }
You can’t perform that action at this time.
0 commit comments