FakeVim: Add support for :wqa

Task-number: QTCREATORBUG-20699
Change-Id: I01e5e69abe9a7192f19d604847443f550a20ef0f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Lukas Holecek <hluk@email.cz>
This commit is contained in:
hjk
2018-07-02 15:19:07 +02:00
committed by Lukas Holecek
parent ae01fe7c42
commit b3f4282edc
2 changed files with 4 additions and 3 deletions

View File

@@ -158,7 +158,6 @@ public:
Signal<void(const QString &msg)> extraInformationChanged;
Signal<void(const QList<QTextEdit::ExtraSelection> &selection)> selectionChanged;
Signal<void(const QString &needle)> highlightMatches;
Signal<void(QString *error)> writeAllRequested;
Signal<void(bool *moved, bool *forward, QTextCursor *cursor)> moveToMatchingParenthesis;
Signal<void(bool *result, QChar c)> checkForElectricCharacter;
Signal<void(int beginLine, int endLine, QChar typedChar)> indentRegion;

View File

@@ -1921,14 +1921,16 @@ void FakeVimPluginPrivate::handleExCommand(FakeVimHandler *handler, bool *handle
if (!saved)
handler->showMessage(MessageError, Tr::tr("File not saved"));
} else if (cmd.matches("wa", "wall")) {
// :w[all]
} else if (cmd.matches("wa", "wall") || cmd.matches("wqa", "wqall")) {
// :wa[ll] :wqa[ll]
triggerAction(Core::Constants::SAVEALL);
const QList<IDocument *> failed = DocumentManager::modifiedDocuments();
if (failed.isEmpty())
handler->showMessage(MessageInfo, Tr::tr("Saving succeeded"));
else
handler->showMessage(MessageError, Tr::tr("%n files not saved", 0, failed.size()));
if (cmd.matches("wqa", "wqall"))
emit delayedQuitAllRequested(cmd.hasBang);
} else if (cmd.matches("q", "quit")) {
// :q[uit]
emit delayedQuitRequested(cmd.hasBang, m_editorToHandler.key(handler));