forked from qt-creator/qt-creator
fakevim: fix :!cmd if there is no selection
Change-Id: Ieafb77ecc4d211f97b7b8321fc84fd7d6c81dfc0 Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -3727,6 +3727,9 @@ bool FakeVimHandler::Private::handleExBangCommand(const ExCommand &cmd) // :!
|
||||
proc.closeWriteChannel();
|
||||
proc.waitForFinished();
|
||||
QString result = QString::fromUtf8(proc.readAllStandardOutput());
|
||||
if (text.isEmpty()) {
|
||||
emit q->extraInformationChanged(result);
|
||||
} else {
|
||||
beginEditBlock();
|
||||
removeText(currentRange());
|
||||
insertText(result);
|
||||
@@ -3736,6 +3739,7 @@ bool FakeVimHandler::Private::handleExBangCommand(const ExCommand &cmd) // :!
|
||||
//qDebug() << "FILTER: " << command;
|
||||
showBlackMessage(FakeVimHandler::tr("%n lines filtered", 0,
|
||||
text.count('\n')));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -3866,13 +3870,14 @@ void FakeVimHandler::Private::handleExCommand(const QString &line0)
|
||||
}
|
||||
if (beginLine != -1 && endLine == -1)
|
||||
endLine = beginLine;
|
||||
const int beginPos = firstPositionInLine(beginLine);
|
||||
const int endPos = lastPositionInLine(endLine);
|
||||
ExCommand cmd;
|
||||
cmd.setContentsFromLine(line);
|
||||
if (beginLine != -1) {
|
||||
const int beginPos = firstPositionInLine(beginLine);
|
||||
const int endPos = lastPositionInLine(endLine);
|
||||
cmd.range = Range(beginPos, endPos, RangeLineMode);
|
||||
if (beginLine != -1)
|
||||
cmd.count = beginLine;
|
||||
}
|
||||
//qDebug() << "CMD: " << cmd;
|
||||
|
||||
enterCommandMode();
|
||||
|
Reference in New Issue
Block a user