Correct display of comments at start of file

Due to a math error, comments at the start of the file when outside
of the diff context may have not been displayed.  This corrects
the error.

Change-Id: Ic879d3c434faaa5d884547889a602a7157d1b2a8
This commit is contained in:
James E. Blair 2016-01-06 14:16:30 -08:00
parent 9b931602a6
commit 37298824ed
1 changed files with 2 additions and 1 deletions

View File

@ -303,6 +303,7 @@ class BaseDiffView(urwid.WidgetWrap):
lines += self.makeLines(diff, chunk.lines[-10:], comment_lists)
del chunk.lines[-10:]
chunk.calcRange()
chunk.button.update()
if not chunk.lines:
lines.remove(button)
else:
@ -352,7 +353,7 @@ class BaseDiffView(urwid.WidgetWrap):
if from_start:
self.expandChunk(diff, chunk, comment_lists, from_start=i+10)
else:
self.expandChunk(diff, chunk, comment_lists, from_end=i-10)
self.expandChunk(diff, chunk, comment_lists, from_end=0-(len(chunk.lines)-i)-10)
break
def expandChunk(self, diff, chunk, comment_lists={}, from_start=None, from_end=None,