mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
58203bbaa5
commit
2960c06867
@ -136,7 +136,7 @@ class SyntaxHighlighter(object):
|
|||||||
doc.contentsChange.connect(self.reformat_blocks)
|
doc.contentsChange.connect(self.reformat_blocks)
|
||||||
|
|
||||||
def parse_single_block(self, block):
|
def parse_single_block(self, block):
|
||||||
ud, new_ud = self.get_user_data(block)
|
ud, is_new_ud = self.get_user_data(block)
|
||||||
orig_state = ud.state
|
orig_state = ud.state
|
||||||
pblock = block.previous()
|
pblock = block.previous()
|
||||||
if pblock.isValid():
|
if pblock.isValid():
|
||||||
@ -152,7 +152,7 @@ class SyntaxHighlighter(object):
|
|||||||
for i, num, fmt in run_loop(ud, self.state_map, self.formats, unicode(block.text())):
|
for i, num, fmt in run_loop(ud, self.state_map, self.formats, unicode(block.text())):
|
||||||
if fmt is not None:
|
if fmt is not None:
|
||||||
formats.append((i, num, fmt))
|
formats.append((i, num, fmt))
|
||||||
force_next_highlight = new_ud or ud.state != orig_state
|
force_next_highlight = is_new_ud or ud.state != orig_state
|
||||||
return formats, force_next_highlight
|
return formats, force_next_highlight
|
||||||
|
|
||||||
def reformat_block(self, block):
|
def reformat_block(self, block):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user