Commit 48a75201 authored by hjk's avatar hjk
Browse files

fakevim: fix :wq complaint when writing to the current file.

Reviewed-by: Kornelia Poenitz
parent 3cb91a14
......@@ -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"));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment