From 48a75201a6206bfc72b0138c29e2b0e6f3c9cd52 Mon Sep 17 00:00:00 2001 From: hjk <qtc-committer@nokia.com> Date: Mon, 11 Oct 2010 11:52:49 +0200 Subject: [PATCH] fakevim: fix :wq complaint when writing to the current file. Reviewed-by: Kornelia Poenitz --- src/plugins/fakevim/fakevimplugin.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp index f377d465391..40c0893dbd9 100644 --- a/src/plugins/fakevim/fakevimplugin.cpp +++ b/src/plugins/fakevim/fakevimplugin.cpp @@ -945,7 +945,7 @@ void FakeVimPluginPrivate::handleExCommand(bool *handled, const ExCommand &cmd) QTC_ASSERT(editorManager(), return); *handled = true; - if (cmd.matches("w", "write")) { + if (cmd.matches("w", "write") || cmd.cmd == "wq") { // :w[rite] Core::IEditor *editor = m_editorToHandler.key(handler); const QString fileName = handler->currentFileName(); @@ -962,6 +962,8 @@ void FakeVimPluginPrivate::handleExCommand(bool *handled, const ExCommand &cmd) handler->showBlackMessage(FakeVimHandler::tr("\"%1\" %2 %3L, %4C written") .arg(fileName).arg(" ") .arg(ba.count('\n')).arg(ba.size())); + if (cmd.cmd == "wq") + delayedQuitRequested(cmd.hasBang, m_editorToHandler.key(handler)); } else { handler->showRedMessage(tr("File not saved")); } -- GitLab