forked from qt-creator/qt-creator
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:
@@ -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;
|
||||
|
@@ -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));
|
||||
|
Reference in New Issue
Block a user