File tree Expand file tree Collapse file tree
src/calibre/gui2/tweak_book/editor Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -625,14 +625,21 @@ def go_to_anchor(self, anchor):
625625
626626 # Line numbers and cursor line {{{
627627 def highlight_cursor_line (self ):
628+ self ._highlight_cursor_line ()
629+
630+ def _highlight_cursor_line (self , highlight_now = True ):
631+ if self .highlighter .is_working :
632+ QTimer .singleShot (10 , self .highlight_cursor_line )
633+ if not highlight_now :
634+ return
628635 sel = QTextEdit .ExtraSelection ()
629636 sel .format .setBackground (self .palette ().alternateBase ())
630637 sel .format .setProperty (QTextFormat .Property .FullWidthSelection , True )
631638 sel .cursor = self .textCursor ()
632639 sel .cursor .clearSelection ()
633640 self .current_cursor_line = [sel ]
634641
635- # apply any formats that have a backgroud over the cursor line format
642+ # apply any formats that have a background over the cursor line format
636643 # to ensure they are visible
637644 c = self .textCursor ()
638645 block = c .block ()
You can’t perform that action at this time.
0 commit comments