diff --git a/meld/filediff.py b/meld/filediff.py index 0aabdba..0403dfa 100644 --- a/meld/filediff.py +++ b/meld/filediff.py @@ -762,7 +762,9 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component): None, True) self.queue_draw() - def _filter_text(self, txt): + def _filter_text(self, txt, buf): + dimmed_tag = buf.get_tag_table().lookup("dimmed") + buf.remove_tag(dimmed_tag, buf.get_start_iter(), buf.get_end_iter()) def killit(m): assert m.group().count("\n") == 0 if len(m.groups()): @@ -772,6 +774,8 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component): s = s.replace(g,"") return s else: + dimmed_tag = buf.get_tag_table().lookup("dimmed") + buf.apply_tag(dimmed_tag, buf.get_iter_at_offset(m.start()), buf.get_iter_at_offset(m.end())) return "" try: for filt in self.text_filters: diff --git a/meld/meldbuffer.py b/meld/meldbuffer.py index 9c89999..7cfd471 100644 --- a/meld/meldbuffer.py +++ b/meld/meldbuffer.py @@ -223,7 +223,7 @@ class BufferLines(object): end = self.buf.get_iter_at_line_or_eof(hi) txt = text_type(self.buf.get_text(start, end, False), 'utf8') - filter_txt = self.textfilter(txt) + filter_txt = self.textfilter(txt, self.buf) lines = filter_txt.splitlines() ends = filter_txt.splitlines(True) @@ -269,7 +269,7 @@ class BufferLines(object): if not line_end.ends_line(): line_end.forward_to_line_end() txt = self.buf.get_text(line_start, line_end, False) - return text_type(self.textfilter(txt), 'utf8') + return text_type(self.textfilter(txt, self.buf), 'utf8') def __len__(self): return self.buf.get_line_count() diff --git a/meld/sourceview.py b/meld/sourceview.py index 0d142f3..86d8bc9 100644 --- a/meld/sourceview.py +++ b/meld/sourceview.py @@ -124,6 +124,10 @@ class MeldSourceView(GtkSource.View): buf = meldbuffer.MeldBuffer() buf.create_tag("inline") + buf.create_tag("dimmed") + dimmed_tag = buf.get_tag_table().lookup("dimmed") + dimmed_tag.set_property("scale", (1 / 1.2)) + dimmed_tag.set_property("scale-set", True) self.set_buffer(buf) meldsettings.connect('changed', self.on_setting_changed)