Fix an exception when chaging diff context on very small diffs

This commit is contained in:
Kovid Goyal 2019-01-16 21:24:34 +05:30
parent fa01e0b76f
commit 3bddb9d95b
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -208,7 +208,7 @@ class DiffHandler(Handler):
break break
if num is not None: if num is not None:
self.scroll_pos = min(num, self.max_scroll_pos) self.scroll_pos = max(0, min(num, self.max_scroll_pos))
@property @property
def num_lines(self): def num_lines(self):