mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #2034900 [Editor - Report: UnboundLocalError: local variable 'raw' referenced before assignment](https://bugs.launchpad.net/calibre/+bug/2034900)
This commit is contained in:
parent
3f217c9cb9
commit
0d4b57722a
@ -503,13 +503,13 @@ class TextEdit(PlainTextEdit):
|
||||
if wrap and not complete:
|
||||
pos = QTextCursor.MoveOperation.End if reverse else QTextCursor.MoveOperation.Start
|
||||
c.movePosition(pos, QTextCursor.MoveMode.KeepAnchor)
|
||||
raw = str(c.selectedText()).replace(PARAGRAPH_SEPARATOR, '\n').rstrip('\0')
|
||||
if hasattr(self.smarts, 'find_text'):
|
||||
self.highlighter.join()
|
||||
found, start, end = self.smarts.find_text(pat, c, reverse)
|
||||
if not found:
|
||||
return False
|
||||
else:
|
||||
raw = str(c.selectedText()).replace(PARAGRAPH_SEPARATOR, '\n').rstrip('\0')
|
||||
m = pat.search(raw)
|
||||
if m is None:
|
||||
return False
|
||||
|
Loading…
x
Reference in New Issue
Block a user