Commit 8285584f authored by hjk's avatar hjk
Browse files

fakevim: handle '$s' properly

parent e4bd6c55
...@@ -1271,6 +1271,8 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified, ...@@ -1271,6 +1271,8 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
} else if (key == control('r')) { } else if (key == control('r')) {
redo(); redo();
} else if (key == 's') { } else if (key == 's') {
if (atEndOfLine())
moveLeft();
setAnchor(); setAnchor();
moveRight(qMin(count(), rightDist())); moveRight(qMin(count(), rightDist()));
m_registers[m_register] = removeSelectedText(); m_registers[m_register] = removeSelectedText();
...@@ -1632,7 +1634,7 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0) ...@@ -1632,7 +1634,7 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0)
QString cmd = cmd0; QString cmd = cmd0;
if (cmd.startsWith("%")) if (cmd.startsWith("%"))
cmd = "1,$" + cmd.mid(1); cmd = "1,$" + cmd.mid(1);
int beginLine = -1; int beginLine = -1;
int endLine = -1; int endLine = -1;
......
Supports Markdown
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