From 53784b310eb8d993dcf01e59d914d53341034695 Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Fri, 6 Jun 2025 18:39:21 +0200 Subject: [PATCH] Close instead of hide auto-complete menu when inactive (#2386) --- novelwriter/gui/doceditor.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/novelwriter/gui/doceditor.py b/novelwriter/gui/doceditor.py index 0892bb71..8d1c42c1 100644 --- a/novelwriter/gui/doceditor.py +++ b/novelwriter/gui/doceditor.py @@ -1090,11 +1090,14 @@ class GuiDocEditor(QPlainTextEdit): show = self._completer.updateMetaText(text, bPos) else: show = self._completer.updateCommentText(text, bPos) - point = self.cursorRect().bottomRight() - self._completer.move(viewport.mapToGlobal(point)) - self._completer.setVisible(show) + if show: + point = self.cursorRect().bottomRight() + self._completer.move(viewport.mapToGlobal(point)) + self._completer.show() + else: + self._completer.close() else: - self._completer.setVisible(False) + self._completer.close() if self._doReplace and added == 1: cursor = self.textCursor()