Commit 64d058a8 authored by hjk's avatar hjk
Browse files

Fixes: fakevim: fix df<x>

    Details:  was broken due to wrong cursor selection approach
parent f73861d4
......@@ -367,6 +367,7 @@ bool FakeVimHandler::Private::handleEvent(QKeyEvent *ev)
quit();
return true;
}
m_mode = CommandMode;
return false;
}
......@@ -1824,11 +1825,15 @@ void FakeVimHandler::Private::recordEndGroup()
QString FakeVimHandler::Private::recordRemoveSelectedText()
{
EditOperation op;
//qDebug() << "1 POS: " << position() << " ANCHOR: " << anchor() << m_tc.anchor();
m_tc.setPosition(anchor(), KeepAnchor);
op.m_position = qMin(position(), anchor());
//qDebug() << "2 POS: " << position() << " ANCHOR: " << anchor() << m_tc.anchor();
//qDebug() << "POS: " << position() << " ANCHOR: " << anchor() << m_tc.anchor();
int pos = m_tc.position();
if (pos == anchor())
return QString();
m_tc.setPosition(anchor(), MoveAnchor);
m_tc.setPosition(pos, KeepAnchor);
op.m_position = qMin(pos, anchor());
op.m_from = m_tc.selection().toPlainText();
//qDebug() << "OP: " << op;
recordOperation(op);
m_tc.deleteChar();
return op.m_from;
......
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