Port the new code recently added to master

This commit is contained in:
Kovid Goyal 2014-04-30 21:17:43 +05:30
parent be5531a2e1
commit 93ae0d715c
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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