FakeVim: only block suggestion when fakevim is in use

This fixes the issue that no copilot suggestion were shown after
switching documents.

Change-Id: Ic81bfbe266877964eeaf688d9915a7937607118b
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
David Schulz
2023-05-15 09:05:51 +02:00
parent 63b2934a62
commit fe74e6d43b
3 changed files with 9 additions and 0 deletions

View File

@@ -1587,6 +1587,8 @@ void FakeVimPluginPrivate::editorOpened(IEditor *editor)
handler->modeChanged.set([tew, this, editor](bool insertMode) {
HandlerAndData &handlerAndData = m_editorToHandler[editor];
if (!handlerAndData.handler->inFakeVimMode())
return;
// We don't want to show suggestions unless we are in insert mode.
if (insertMode != (handlerAndData.suggestionBlocker == nullptr))