mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Port the new code recently added to master
This commit is contained in:
parent
be5531a2e1
commit
93ae0d715c
@ -228,7 +228,7 @@ class SyntaxHighlighter(object):
|
||||
def apply_format_changes(self, block, formats):
|
||||
layout = block.layout()
|
||||
preedit_start = layout.preeditAreaPosition()
|
||||
preedit_length = layout.preeditAreaText().length()
|
||||
preedit_length = len(layout.preeditAreaText())
|
||||
if preedit_length != 0 and preedit_start != 0:
|
||||
for r in formats:
|
||||
# Adjust range by pre-edit text, if any
|
||||
|
@ -8,7 +8,7 @@ __copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||
|
||||
import re
|
||||
|
||||
from PyQt4.Qt import QTextBlockUserData
|
||||
from PyQt5.Qt import QTextBlockUserData
|
||||
|
||||
from calibre.gui2.tweak_book import verify_link
|
||||
from calibre.gui2.tweak_book.editor import syntax_text_char_format, LINK_PROPERTY, CSS_PROPERTY
|
||||
|
Loading…
x
Reference in New Issue
Block a user