From d0c32df3fed07c27be5446996b368a37cff36b4c Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 10 Jun 2021 14:40:29 +0200 Subject: [PATCH] FakeVim: Don't create two handlers for one editor Amends 206e9f95fb1. Fixes: QTCREATORBUG-25770 Change-Id: I4028a7c8257ee3985fd2198e789d98b25901d92d Reviewed-by: Eike Ziller --- src/plugins/fakevim/fakevimplugin.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp index 3c32384aa05..09148aa5793 100644 --- a/src/plugins/fakevim/fakevimplugin.cpp +++ b/src/plugins/fakevim/fakevimplugin.cpp @@ -1550,6 +1550,14 @@ void FakeVimPluginPrivate::editorOpened(IEditor *editor) if (!editor) return; + if (m_editorToHandler.contains(editor)) { + // We get here via the call from the duplicated handler in case + // it was triggered by triggerAction(Core::Constants::SPLIT). + // On the other hand, we need the path from there to support the + // case of manual calls to IEditor::duplicate(). + return; + } + QWidget *widget = editor->widget(); if (!widget) return;