|
@@ -84,8 +84,9 @@ class Hunk(object):
|
84
|
84
|
self._hunk_list = [] # list of tuple (attr, line)
|
85
|
85
|
|
86
|
86
|
def append(self, hunk_line):
|
87
|
|
- """hunk_line is a 2-element tuple: (attr, text), where attris : '-':
|
88
|
|
- old, '+': new, ' ': common"""
|
|
87
|
+ """hunk_line is a 2-element tuple: (attr, text), where attr is:
|
|
88
|
+ '-': old, '+': new, ' ': common
|
|
89
|
+ """
|
89
|
90
|
self._hunk_list.append(hunk_line)
|
90
|
91
|
|
91
|
92
|
def mdiff(self):
|
|
@@ -146,13 +147,13 @@ class Diff(object):
|
146
|
147
|
return False
|
147
|
148
|
|
148
|
149
|
def parse_hunk_meta(self, line):
|
149
|
|
- """Returns a 2-element tuple, each of them is a tuple in form of (start,
|
150
|
|
- offset)"""
|
|
150
|
+ """Returns a 2-element tuple, each is a tuple of (start, offset)"""
|
151
|
151
|
return None
|
152
|
152
|
|
153
|
153
|
def parse_hunk_line(self, line):
|
154
|
|
- """Returns a 2-element tuple: (attr, text), where attr is: '-': old,
|
155
|
|
- '+': new, ' ': common"""
|
|
154
|
+ """Returns a 2-element tuple: (attr, text), where attr is:
|
|
155
|
+ '-': old, '+': new, ' ': common
|
|
156
|
+ """
|
156
|
157
|
return None
|
157
|
158
|
|
158
|
159
|
def is_old(self, line):
|
|
@@ -219,8 +220,8 @@ class Diff(object):
|
219
|
220
|
|
220
|
221
|
def _fit_with_marker_mix(text, base_color, width, pad=False):
|
221
|
222
|
"""Wrap or pad input text which contains mdiff tags, markup at the
|
222
|
|
- meantime with the markup_fix_fn, note only left side need to set
|
223
|
|
- `pad`"""
|
|
223
|
+ meantime, note only left side need to set `pad`
|
|
224
|
+ """
|
224
|
225
|
out = [COLORS[base_color]]
|
225
|
226
|
count = 0
|
226
|
227
|
tag_re = re.compile(r'\x00[+^-]|\x01')
|