[meld] Fix previous-diff at the end of a file when it doesn't end in a change
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] Fix previous-diff at the end of a file when it doesn't end in a change
- Date: Mon, 15 Mar 2010 01:04:19 +0000 (UTC)
commit 72a243f9b61d4ff580e71020a8566434516c9408
Author: Kai Willadsen <kai willadsen gmail com>
Date: Mon Mar 15 10:59:04 2010 +1000
Fix previous-diff at the end of a file when it doesn't end in a change
This bug crept in to the recent cursor-related rework, where we didn't
make sure that the line cache was filled in for the end of sequences.
This commit just tags any trailing range at the end of the cache with
the last prev/next details.
meld/diffutil.py | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/meld/diffutil.py b/meld/diffutil.py
index 074b386..c634f1c 100644
--- a/meld/diffutil.py
+++ b/meld/diffutil.py
@@ -136,6 +136,11 @@ class Differ(object):
self._line_cache[seq][start:end] = [(i, prev[seq], next[seq])] * (end - start)
prev[seq], old_end[seq] = i, end
+ for seq in range(3):
+ last, end = old_end[seq], len(self._line_cache[seq])
+ if (last < end):
+ self._line_cache[seq][last:end] = [(None, prev[seq], next[seq])] * (end - last)
+
def _consume_blank_lines(self, c, texts, pane1, pane2):
if c is None:
return None
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]