[meld] Use Myers matcher for inline differences (partially fixes bgo#587410)
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] Use Myers matcher for inline differences (partially fixes bgo#587410)
- Date: Wed, 6 Oct 2010 20:18:48 +0000 (UTC)
commit afc1c6e6f4252a5d595cd4c2c3f187d6ec7548fe
Author: Kai Willadsen <kai willadsen gmail com>
Date: Wed Oct 6 17:24:55 2010 +1000
Use Myers matcher for inline differences (partially fixes bgo#587410)
Using MyersSequenceMatcher to highlight inline differences improves
the chunking behaviour of our matching, and fixes several cases of
unpleasant highlighting behaviour.
meld/filediff.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/meld/filediff.py b/meld/filediff.py
index cb43ed8..03c3ca8 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -31,6 +31,7 @@ import gtk.keysyms
import diffutil
from ui import findbar
from ui import gnomeglade
+import matchers
import misc
import melddoc
import paths
@@ -55,7 +56,7 @@ class CachedSequenceMatcher(object):
self.cache[(text1, textn)][1] = time.time()
return self.cache[(text1, textn)][0]
except KeyError:
- matcher = difflib.SequenceMatcher(None, text1, textn)
+ matcher = matchers.MyersSequenceMatcher(None, text1, textn)
opcodes = matcher.get_opcodes()
self.cache[(text1, textn)] = [opcodes, time.time()]
return opcodes
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]