Fixes: fakevim: fix df<x>

Details:  was broken due to wrong cursor selection approach
This commit is contained in:
hjk
2009-01-21 16:04:34 +01:00
parent f73861d458
commit 64d058a81b

View File

@@ -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;