Skip to content

Commit

Permalink
Only switch focus between editor and viewer when viewer is visible (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
vkbo committed Jul 3, 2024
1 parent e1bcfcf commit 42b1e6a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions novelwriter/guimain.py
Original file line number Diff line number Diff line change
Expand Up @@ -1023,9 +1023,10 @@ def _switchFocus(self, paneNo: nwFocus) -> None:
self.projView.setTreeFocus()
elif paneNo == nwFocus.DOCUMENT:
self._changeView(nwView.EDITOR)
if self.docEditor.anyFocus():
hasViewer = self.splitView.isVisible()
if hasViewer and self.docEditor.anyFocus():
self.docViewer.setFocus()
elif self.docViewer.anyFocus():
elif hasViewer and self.docViewer.anyFocus():
self.docEditor.setFocus()
else:
self.docEditor.setFocus()
Expand Down

0 comments on commit 42b1e6a

Please sign in to comment.