Add better keyboard navigation support

This commit is contained in:
Veronica Berglyd Olsen
2024-03-24 16:24:48 +01:00
parent becb404203
commit a4d8c22cd0
2 changed files with 48 additions and 7 deletions
+5 -3
View File
@@ -1152,10 +1152,12 @@ class GuiMain(QMainWindow):
self.viewDocument(tHandle=tHandle, sTitle=sTitle)
return
@pyqtSlot(str, int, int)
def _openDocumentSelection(self, tHandle: str, selStart: int, selLength: int) -> None:
@pyqtSlot(str, int, int, bool)
def _openDocumentSelection(
self, tHandle: str, selStart: int, selLength: int, changeFocus: bool
) -> None:
"""Open a document and select a section of the text."""
if self.openDocument(tHandle):
if self.openDocument(tHandle, changeFocus=changeFocus):
self.docEditor.setCursorSelection(selStart, selLength)
return