add some test code for the yet-to-be-born QLinkedList dumper

This commit is contained in:
hjk
2009-01-08 11:02:04 +01:00
parent 0bbed6d786
commit 7b47bd48e1
2 changed files with 47 additions and 1 deletions

View File

@@ -226,6 +226,7 @@ private:
void recordInsert(int position, const QString &data);
void recordRemove(int position, const QString &data);
void recordRemove(int position, int length);
void recordMove(int position, int nestedCount);
void undo();
void redo();
QStack<EditOperation> m_undoStack;
@@ -671,8 +672,8 @@ void FakeVimHandler::Private::handleCommandMode(int key, const QString &text)
QString text = m_registers[m_register];
int n = text.count(QChar(ParagraphSeparator));
if (n > 0) {
m_tc.movePosition(Down);
m_tc.movePosition(StartOfLine);
m_tc.movePosition(Down);
m_tc.insertText(text);
m_tc.movePosition(Up, MoveAnchor, n);
} else {
@@ -680,6 +681,7 @@ void FakeVimHandler::Private::handleCommandMode(int key, const QString &text)
m_tc.insertText(text);
m_tc.movePosition(Left);
}
m_dotCommand = "p";
} else if (key == control('r')) {
redo();
} else if (key == 's') {
@@ -1292,6 +1294,15 @@ void FakeVimHandler::Private::redo()
#endif
}
void FakeVimHandler::Private::recordMove(int position, int nestedCount)
{
EditOperation op;
op.m_position = position;
op.m_itemCount = nestedCount;
m_undoStack.push(op);
m_redoStack.clear();
}
void FakeVimHandler::Private::recordInsert(int position, const QString &data)
{
EditOperation op;