mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-11 09:13:57 -04:00
Insert context boundary at top of file is first change is not at top of file
This commit is contained in:
parent
75bdef4fe3
commit
e26ee89caf
@ -653,13 +653,13 @@ class DiffSplit(QSplitter): # {{{
|
|||||||
QApplication.processEvents(QEventLoop.ExcludeUserInputEvents | QEventLoop.ExcludeSocketNotifiers)
|
QApplication.processEvents(QEventLoop.ExcludeUserInputEvents | QEventLoop.ExcludeSocketNotifiers)
|
||||||
else:
|
else:
|
||||||
for i, group in enumerate(cruncher.get_grouped_opcodes(context)):
|
for i, group in enumerate(cruncher.get_grouped_opcodes(context)):
|
||||||
if i > 0:
|
for j, (tag, alo, ahi, blo, bhi) in enumerate(group):
|
||||||
self.changes.append(Change(
|
if j == 0 and (i > 0 or min(alo, blo) > 0):
|
||||||
ltop=cl.block().blockNumber()-1, lbot=cl.block().blockNumber(),
|
self.changes.append(Change(
|
||||||
rtop=cr.block().blockNumber()-1, rbot=cr.block().blockNumber(), kind='boundary'))
|
ltop=cl.block().blockNumber()-1, lbot=cl.block().blockNumber(),
|
||||||
self.left.line_number_map[self.changes[-1].ltop] = '-'
|
rtop=cr.block().blockNumber()-1, rbot=cr.block().blockNumber(), kind='boundary'))
|
||||||
self.right.line_number_map[self.changes[-1].rtop] = '-'
|
self.left.line_number_map[self.changes[-1].ltop] = '-'
|
||||||
for tag, alo, ahi, blo, bhi in group:
|
self.right.line_number_map[self.changes[-1].rtop] = '-'
|
||||||
getattr(self, tag)(alo, ahi, blo, bhi)
|
getattr(self, tag)(alo, ahi, blo, bhi)
|
||||||
QApplication.processEvents(QEventLoop.ExcludeUserInputEvents | QEventLoop.ExcludeSocketNotifiers)
|
QApplication.processEvents(QEventLoop.ExcludeUserInputEvents | QEventLoop.ExcludeSocketNotifiers)
|
||||||
cl.insertBlock(), cr.insertBlock()
|
cl.insertBlock(), cr.insertBlock()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user