Skip to content
Snippets Groups Projects
Commit 2d67b9a0 authored by hjk's avatar hjk
Browse files

Fixes: fakevim: clear selection after :w

parent ab8c038e
No related branches found
No related tags found
No related merge requests found
...@@ -1406,13 +1406,15 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0) ...@@ -1406,13 +1406,15 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0)
showRedMessage(tr("File '%1' exists (add ! to override)").arg(fileName)); showRedMessage(tr("File '%1' exists (add ! to override)").arg(fileName));
} else if (file.open(QIODevice::ReadWrite)) { } else if (file.open(QIODevice::ReadWrite)) {
file.close(); file.close();
QTextCursor tc = m_tc;
selectRange(beginLine, endLine); selectRange(beginLine, endLine);
QString contents = selectedText(); QString contents = selectedText();
m_tc = tc;
bool handled = false; bool handled = false;
emit q->writeFileRequested(&handled, fileName, contents); emit q->writeFileRequested(&handled, fileName, contents);
// nobody cared, so act ourselves // nobody cared, so act ourselves
if (!handled) { if (!handled) {
qDebug() << "HANDLING MANUAL SAVE"; //qDebug() << "HANDLING MANUAL SAVE";
QFile file(fileName); QFile file(fileName);
file.open(QIODevice::ReadWrite); file.open(QIODevice::ReadWrite);
{ QTextStream ts(&file); ts << contents; } { QTextStream ts(&file); ts << contents; }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment