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)
37
37
38
38
var lineIdx = 0 ;
39
39
var blockStartIdx = 0 ;
40
- var isNewBlock = true ;
40
+ var isReadingBlock = false ;
41
41
var blocks = new List < Block > ( ) ;
42
42
43
43
foreach ( var line in lines )
44
44
{
45
45
lineIdx ++ ;
46
46
if ( line . Type is Models . TextDiffLineType . Added or Models . TextDiffLineType . Deleted or Models . TextDiffLineType . None )
47
47
{
48
- if ( isNewBlock )
48
+ if ( ! isReadingBlock )
49
49
{
50
- isNewBlock = false ;
50
+ isReadingBlock = true ;
51
51
blockStartIdx = lineIdx ;
52
52
}
53
53
}
54
54
else
55
55
{
56
- if ( ! isNewBlock )
56
+ if ( isReadingBlock )
57
57
{
58
58
blocks . Add ( new Block ( blockStartIdx , lineIdx - 1 ) ) ;
59
- isNewBlock = true ;
59
+ isReadingBlock = false ;
60
60
}
61
61
}
62
62
}
63
63
64
- if ( ! isNewBlock )
65
- blocks . Add ( new Block ( blockStartIdx , lines . Count - 1 ) ) ;
64
+ if ( isReadingBlock )
65
+ blocks . Add ( new Block ( blockStartIdx , lines . Count ) ) ;
66
66
67
67
_blocks . AddRange ( blocks ) ;
68
68
}
You can’t perform that action at this time.
0 commit comments