forked from qt-creator/qt-creator
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:
@@ -9546,6 +9546,11 @@ bool FakeVimHandler::jumpToLocalMark(QChar mark, bool backTickMode)
|
||||
return d->jumpToMark(mark, backTickMode);
|
||||
}
|
||||
|
||||
bool FakeVimHandler::inFakeVimMode()
|
||||
{
|
||||
return d->m_inFakeVim;
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace FakeVim
|
||||
|
||||
|
@@ -136,6 +136,8 @@ public:
|
||||
|
||||
bool jumpToLocalMark(QChar mark, bool backTickMode);
|
||||
|
||||
bool inFakeVimMode();
|
||||
|
||||
bool eventFilter(QObject *ob, QEvent *ev) override;
|
||||
|
||||
Callback<void(const QString &msg, int cursorPos, int anchorPos, int messageLevel)>
|
||||
|
@@ -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))
|
||||
|
Reference in New Issue
Block a user