fakevim: support snippets, by doing nothing.

Reviewed-by: con
Task-number: QTCREATORBUG-4379
This commit is contained in:
hjk
2011-04-06 14:55:26 +02:00
parent 09a3615191
commit 54eac56c00
3 changed files with 13 additions and 0 deletions

View File

@@ -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();

View File

@@ -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();
}

View File

@@ -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;