Commit 6058a885 authored by hjk's avatar hjk
Browse files

Fixes: fakevim: improvements for 'o' and 's'

parent 530f0fc2
......@@ -908,11 +908,13 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
moveToFirstNonBlankOnLine();
finishMovement();
} else if (key == 'i') {
recordBeginGroup();
enterInsertMode();
updateMiniBuffer();
if (atEndOfLine())
moveLeft();
} else if (key == 'I') {
recordBeginGroup();
setAnchor();
enterInsertMode();
if (m_gflag)
......@@ -976,13 +978,13 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
} else if (key == 'N') {
search(lastSearchString(), !m_lastSearchForward);
} else if (key == 'o' || key == 'O') {
recordBeginGroup();
recordMove();
enterInsertMode();
moveToFirstNonBlankOnLine();
recordBeginGroup();
int numSpaces = leftDist();
moveUp();
if (key == 'o')
moveDown();
if (key == 'O')
moveUp();
moveToEndOfLine();
recordInsertText("\n");
moveToStartOfLine();
......@@ -990,7 +992,6 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
recordInsertText(QString(indentDist(), ' '));
else
recordInsertText(QString(numSpaces, ' '));
recordEndGroup();
} else if (key == 'p' || key == 'P') {
recordBeginGroup();
QString text = m_registers[m_register];
......@@ -1034,8 +1035,13 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
redo();
} else if (key == 's') {
recordBeginGroup();
m_submode = ChangeSubMode;
setAnchor();
moveRight(qMin(count(), rightDist()));
m_registers[m_register] = recordRemoveSelectedText();
//m_dotCommand = QString("%1s").arg(count());
m_opcount.clear();
m_mvcount.clear();
enterInsertMode();
} else if (key == 't' || key == 'T') {
m_subsubmode = FtSubSubMode;
m_subsubdata = key;
......@@ -2043,7 +2049,6 @@ void FakeVimHandler::Private::enterInsertMode()
EDITOR(setOverwriteMode(false));
m_mode = InsertMode;
m_lastInsertion.clear();
recordBeginGroup();
}
void FakeVimHandler::Private::enterCommandMode()
......
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