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 QString &msg)> extraInformationChanged;
|
||||||
Signal<void(const QList<QTextEdit::ExtraSelection> &selection)> selectionChanged;
|
Signal<void(const QList<QTextEdit::ExtraSelection> &selection)> selectionChanged;
|
||||||
Signal<void(const QString &needle)> highlightMatches;
|
Signal<void(const QString &needle)> highlightMatches;
|
||||||
Signal<void(QString *error)> writeAllRequested;
|
|
||||||
Signal<void(bool *moved, bool *forward, QTextCursor *cursor)> moveToMatchingParenthesis;
|
Signal<void(bool *moved, bool *forward, QTextCursor *cursor)> moveToMatchingParenthesis;
|
||||||
Signal<void(bool *result, QChar c)> checkForElectricCharacter;
|
Signal<void(bool *result, QChar c)> checkForElectricCharacter;
|
||||||
Signal<void(int beginLine, int endLine, QChar typedChar)> indentRegion;
|
Signal<void(int beginLine, int endLine, QChar typedChar)> indentRegion;
|
||||||
|
@@ -1921,14 +1921,16 @@ void FakeVimPluginPrivate::handleExCommand(FakeVimHandler *handler, bool *handle
|
|||||||
|
|
||||||
if (!saved)
|
if (!saved)
|
||||||
handler->showMessage(MessageError, Tr::tr("File not saved"));
|
handler->showMessage(MessageError, Tr::tr("File not saved"));
|
||||||
} else if (cmd.matches("wa", "wall")) {
|
} else if (cmd.matches("wa", "wall") || cmd.matches("wqa", "wqall")) {
|
||||||
// :w[all]
|
// :wa[ll] :wqa[ll]
|
||||||
triggerAction(Core::Constants::SAVEALL);
|
triggerAction(Core::Constants::SAVEALL);
|
||||||
const QList<IDocument *> failed = DocumentManager::modifiedDocuments();
|
const QList<IDocument *> failed = DocumentManager::modifiedDocuments();
|
||||||
if (failed.isEmpty())
|
if (failed.isEmpty())
|
||||||
handler->showMessage(MessageInfo, Tr::tr("Saving succeeded"));
|
handler->showMessage(MessageInfo, Tr::tr("Saving succeeded"));
|
||||||
else
|
else
|
||||||
handler->showMessage(MessageError, Tr::tr("%n files not saved", 0, failed.size()));
|
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")) {
|
} else if (cmd.matches("q", "quit")) {
|
||||||
// :q[uit]
|
// :q[uit]
|
||||||
emit delayedQuitRequested(cmd.hasBang, m_editorToHandler.key(handler));
|
emit delayedQuitRequested(cmd.hasBang, m_editorToHandler.key(handler));
|
||||||
|
Reference in New Issue
Block a user