Add :q/:w/:x commands that are normally expected in vi's

Common things like :wq, :x, and :qa didn't work - now they do.
This commit is contained in:
Rhys Weatherley
2009-05-29 08:34:06 +10:00
parent 8fa417bdd7
commit ef4d2c301a
3 changed files with 30 additions and 5 deletions

View File

@@ -242,6 +242,7 @@ private slots:
void changeSelection(const QList<QTextEdit::ExtraSelection> &selections);
void writeFile(bool *handled, const QString &fileName, const QString &contents);
void quitFile(bool forced);
void quitAllFiles(bool forced);
void moveToMatchingParenthesis(bool *moved, bool *forward, QTextCursor *cursor);
void indentRegion(int *amount, int beginLine, int endLine, QChar typedChar);
@@ -391,6 +392,8 @@ void FakeVimPluginPrivate::editorOpened(Core::IEditor *editor)
this, SLOT(showCommandBuffer(QString)));
connect(handler, SIGNAL(quitRequested(bool)),
this, SLOT(quitFile(bool)), Qt::QueuedConnection);
connect(handler, SIGNAL(quitAllRequested(bool)),
this, SLOT(quitAllFiles(bool)), Qt::QueuedConnection);
connect(handler, SIGNAL(writeFileRequested(bool*,QString,QString)),
this, SLOT(writeFile(bool*,QString,QString)));
connect(handler, SIGNAL(selectionChanged(QList<QTextEdit::ExtraSelection>)),
@@ -460,6 +463,11 @@ void FakeVimPluginPrivate::quitFile(bool forced)
Core::EditorManager::instance()->closeEditors(editors, !forced);
}
void FakeVimPluginPrivate::quitAllFiles(bool forced)
{
Core::EditorManager::instance()->closeAllEditors(!forced);
}
void FakeVimPluginPrivate::writeFile(bool *handled,
const QString &fileName, const QString &contents)
{