mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Get rid of the unnecessary tracking of changes in the split view
This commit is contained in:
parent
a9b3adbad3
commit
89f4653068
@ -384,7 +384,6 @@ class DiffSplit(QSplitter): # {{{
|
|||||||
|
|
||||||
def clear(self):
|
def clear(self):
|
||||||
self.left.clear(), self.right.clear()
|
self.left.clear(), self.right.clear()
|
||||||
self.changes = []
|
|
||||||
|
|
||||||
def finalize(self):
|
def finalize(self):
|
||||||
# check horizontal scrollbars and force both if scrollbar visible only at one side
|
# check horizontal scrollbars and force both if scrollbar visible only at one side
|
||||||
@ -470,7 +469,6 @@ class DiffSplit(QSplitter): # {{{
|
|||||||
c.insertBlock()
|
c.insertBlock()
|
||||||
v.images[start] = (img, w)
|
v.images[start] = (img, w)
|
||||||
change.append('replace' if left_data and right_data else 'delete' if left_data else 'insert')
|
change.append('replace' if left_data and right_data else 'delete' if left_data else 'insert')
|
||||||
self.changes.append(Change(*change))
|
|
||||||
self.left.changes.append((change[0], change[1], change[-1]))
|
self.left.changes.append((change[0], change[1], change[-1]))
|
||||||
self.right.changes.append((change[2], change[3], change[-1]))
|
self.right.changes.append((change[2], change[3], change[-1]))
|
||||||
|
|
||||||
@ -497,7 +495,6 @@ class DiffSplit(QSplitter): # {{{
|
|||||||
self.left_insert = partial(self.do_insert, cl, left_highlight, self.left.line_number_map)
|
self.left_insert = partial(self.do_insert, cl, left_highlight, self.left.line_number_map)
|
||||||
self.right_insert = partial(self.do_insert, cr, right_highlight, self.right.line_number_map)
|
self.right_insert = partial(self.do_insert, cr, right_highlight, self.right.line_number_map)
|
||||||
|
|
||||||
ochanges = []
|
|
||||||
self.changes = []
|
self.changes = []
|
||||||
|
|
||||||
if context is None:
|
if context is None:
|
||||||
@ -530,7 +527,7 @@ class DiffSplit(QSplitter): # {{{
|
|||||||
self.left.changes.append((ltop, lbot, kind))
|
self.left.changes.append((ltop, lbot, kind))
|
||||||
self.right.changes.append((rtop, rbot, kind))
|
self.right.changes.append((rtop, rbot, kind))
|
||||||
|
|
||||||
self.changes = ochanges + self.changes
|
del self.changes
|
||||||
|
|
||||||
def coalesce_changes(self):
|
def coalesce_changes(self):
|
||||||
'Merge neighboring changes of the same kind, if any'
|
'Merge neighboring changes of the same kind, if any'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user