[meld] Remove unused change range arguments and cleanup appropriately
- From: Kai Willadsen <kaiw src gnome org>
- To: svn-commits-list gnome org
- Subject: [meld] Remove unused change range arguments and cleanup appropriately
- Date: Mon, 8 Jun 2009 22:07:30 -0400 (EDT)
commit 686aac8799d0c54cac3f512b40d54f9bcbc5d1fe
Author: Kai Willadsen <kai willadsen gmail com>
Date: Mon Sep 29 13:04:21 2008 +0200
Remove unused change range arguments and cleanup appropriately
FileDiff._update_highlighting() has unused arguments, making the return
values for Differ.change_sequence() and Differ._change_sequence() also
unused. This commit removes all of these, plus the unused
all_changes_in_range() method from Differ.
---
diffutil.py | 13 +++----------
filediff.py | 9 ++++-----
2 files changed, 7 insertions(+), 15 deletions(-)
diff --git a/diffutil.py b/diffutil.py
index ab88818..d0b4505 100644
--- a/diffutil.py
+++ b/diffutil.py
@@ -69,16 +69,14 @@ class Differ(object):
def change_sequence(self, sequence, startidx, sizechange, texts):
assert sequence in (0,1,2)
- changes = [[0,0],[0,0]]
if sequence != 1: #0 or 2
which = sequence / 2
- changes[which] = self._change_sequence(which, sequence, startidx, sizechange, texts)
+ self._change_sequence(which, sequence, startidx, sizechange, texts)
else: # sequence==1:
- changes[0] = self._change_sequence( 0, sequence, startidx, sizechange, texts)
+ self._change_sequence(0, sequence, startidx, sizechange, texts)
if self.num_sequences == 3:
- changes[1] = self._change_sequence( 1, sequence, startidx, sizechange, texts)
+ self._change_sequence(1, sequence, startidx, sizechange, texts)
self.seqlength[sequence] += sizechange
- return changes
def _locate_chunk(self, whichdiffs, sequence, line):
"""Find the index of the chunk which contains line."""
@@ -127,7 +125,6 @@ class Differ(object):
c[3] + lines_added[x], c[4] + lines_added[x])
for c in self.diffs[which][hiidx:] ]
self.diffs[which][loidx:hiidx] = newdiffs
- return loidx,hiidx
def reverse(self, c):
return self.reversemap[c[0]], c[3],c[4], c[1],c[2]
@@ -136,10 +133,6 @@ class Differ(object):
for c in self._merge_diffs(self.diffs[0], self.diffs[1], texts):
yield c
- def all_changes_in_range(self, texts, l0, h0, l1, h1):
- for c in self._merge_diffs(self.diffs[0][l0:h0], self.diffs[1][l0:h0], texts):
- yield c
-
def pair_changes(self, fromindex, toindex, texts):
"""Give all changes between file1 and either file0 or file2.
"""
diff --git a/filediff.py b/filediff.py
index 634e757..478ac6a 100644
--- a/filediff.py
+++ b/filediff.py
@@ -195,8 +195,8 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
def _after_text_modified(self, buffer, startline, sizechange):
if self.num_panes > 1:
pane = self.textbuffer.index(buffer)
- change_range = self.linediffer.change_sequence( pane, startline, sizechange, self._get_texts())
- for it in self._update_highlighting( change_range[0], change_range[1] ):
+ self.linediffer.change_sequence(pane, startline, sizechange, self._get_texts())
+ for it in self._update_highlighting():
pass
self.queue_draw()
self._update_cursor_status(buffer)
@@ -595,8 +595,7 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
yield 1
self.scheduler.add_task( lambda: self.next_diff(gdk.SCROLL_DOWN, jump_to_first=True), True )
self.queue_draw()
- lenseq = [len(d) for d in self.linediffer.diffs]
- self.scheduler.add_task( self._update_highlighting( (0,lenseq[0]), (0,lenseq[1]) ).next )
+ self.scheduler.add_task(self._update_highlighting().next)
self._connect_buffer_handlers()
if srcviewer:
for i in range(len(files)):
@@ -604,7 +603,7 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
srcviewer.set_highlighting_enabled_from_file(self.textbuffer[i], files[i], self.prefs.use_syntax_highlighting)
yield 0
- def _update_highlighting(self, range0, range1):
+ def _update_highlighting(self):
for b in self.textbuffer:
taglist = ["delete line", "conflict line", "replace line", "inline line"]
table = b.get_tag_table()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]