forked from qt-creator/qt-creator
fakevim: support snippets, by doing nothing.
Reviewed-by: con Task-number: QTCREATORBUG-4379
This commit is contained in:
@@ -1105,6 +1105,13 @@ EventResult FakeVimHandler::Private::handleEvent(QKeyEvent *ev)
|
|||||||
return EventPassedToCore;
|
return EventPassedToCore;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool inSnippetMode = false;
|
||||||
|
QMetaObject::invokeMethod(editor(),
|
||||||
|
"inSnippetMode", Q_ARG(bool *, &inSnippetMode));
|
||||||
|
|
||||||
|
if (inSnippetMode)
|
||||||
|
return EventPassedToCore;
|
||||||
|
|
||||||
// Fake "End of line"
|
// Fake "End of line"
|
||||||
//m_tc = cursor();
|
//m_tc = cursor();
|
||||||
|
|
||||||
|
|||||||
@@ -6159,3 +6159,8 @@ void BaseTextEditorWidget::transformSelection(Internal::TransformationMethod met
|
|||||||
cursor.setPosition(pos, QTextCursor::KeepAnchor);
|
cursor.setPosition(pos, QTextCursor::KeepAnchor);
|
||||||
setTextCursor(cursor);
|
setTextCursor(cursor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BaseTextEditorWidget::inSnippetMode(bool *active)
|
||||||
|
{
|
||||||
|
*active = d->m_snippetOverlay->isVisible();
|
||||||
|
}
|
||||||
|
|||||||
@@ -345,6 +345,7 @@ private slots:
|
|||||||
bool inFindScope(const QTextCursor &cursor);
|
bool inFindScope(const QTextCursor &cursor);
|
||||||
bool inFindScope(int selectionStart, int selectionEnd);
|
bool inFindScope(int selectionStart, int selectionEnd);
|
||||||
void currentEditorChanged(Core::IEditor *editor);
|
void currentEditorChanged(Core::IEditor *editor);
|
||||||
|
void inSnippetMode(bool *active);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Internal::BaseTextEditorPrivate *d;
|
Internal::BaseTextEditorPrivate *d;
|
||||||
|
|||||||
Reference in New Issue
Block a user