Skip to content

Commit

Permalink
Implemented fix for failed cursor iteration (olivierkes#729)
Browse files Browse the repository at this point in the history
A long time ago, I identified this failure but wasn't sure why it was
failing. I still don't know why, but the emergency fix at least prevents
other people from running into it. As a bonus, since we have a proper
logging facility now, we can actually log it as I desired to do back
then!

This commit tentatively fixes issue 729.
  • Loading branch information
worstje committed Jul 10, 2021
1 parent bc00e40 commit 01a5c28
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion manuskript/ui/views/MDEditView.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,10 @@ def getClickRects(self):
r3.setLeft(self.viewport().geometry().left())
r3.setRight(self.viewport().geometry().right())
refs.append(ClickThing(r3, rx, rx.capturedTexts()))
cursor.movePosition(cursor.Down)
if not cursor.movePosition(cursor.Down):
# Super-rare failure. Leaving log message for future investigation.
LOGGER.debug("Failed to move cursor down while calculating clickables. Aborting.")
break

self.clickRects = refs

Expand Down

0 comments on commit 01a5c28

Please sign in to comment.