forked from qt-creator/qt-creator
@@ -571,7 +571,6 @@ EventResult FakeVimHandler::Private::handleEvent(QKeyEvent *ev)
|
|||||||
key += 32;
|
key += 32;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_undoCursorPosition[m_tc.document()->revision()] = m_tc.position();
|
|
||||||
//if (m_mode == InsertMode)
|
//if (m_mode == InsertMode)
|
||||||
// joinPreviousEditBlock();
|
// joinPreviousEditBlock();
|
||||||
//else
|
//else
|
||||||
@@ -656,6 +655,7 @@ void FakeVimHandler::Private::restoreWidget()
|
|||||||
EventResult FakeVimHandler::Private::handleKey(int key, int unmodified,
|
EventResult FakeVimHandler::Private::handleKey(int key, int unmodified,
|
||||||
const QString &text)
|
const QString &text)
|
||||||
{
|
{
|
||||||
|
m_undoCursorPosition[m_tc.document()->revision()] = m_tc.position();
|
||||||
//qDebug() << "KEY: " << key << text << "POS: " << m_tc.position();
|
//qDebug() << "KEY: " << key << text << "POS: " << m_tc.position();
|
||||||
if (m_mode == InsertMode)
|
if (m_mode == InsertMode)
|
||||||
return handleInsertMode(key, unmodified, text);
|
return handleInsertMode(key, unmodified, text);
|
||||||
|
@@ -291,7 +291,6 @@ void tst_FakeVim::command_dd_2()
|
|||||||
move("j", "@" + l[1]);
|
move("j", "@" + l[1]);
|
||||||
check("dd", l[0] + "\n@" + lmid(2));
|
check("dd", l[0] + "\n@" + lmid(2));
|
||||||
check("p", l[0] + "\n" + l[2] + "\n@" + l[1] + "\n" + lmid(3));
|
check("p", l[0] + "\n" + l[2] + "\n@" + l[1] + "\n" + lmid(3));
|
||||||
return; // FIXME
|
|
||||||
check("u", l[0] + "\n@" + lmid(2));
|
check("u", l[0] + "\n@" + lmid(2));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -318,8 +317,6 @@ void tst_FakeVim::command_dfx_down()
|
|||||||
check("df ", l[0] + "\n#inc@<QtCore>\n" + lmid(2));
|
check("df ", l[0] + "\n#inc@<QtCore>\n" + lmid(2));
|
||||||
check("j", l[0] + "\n#inc<QtCore>\n#inc@lude <QtGui>\n" + lmid(3));
|
check("j", l[0] + "\n#inc<QtCore>\n#inc@lude <QtGui>\n" + lmid(3));
|
||||||
check(".", l[0] + "\n#inc<QtCore>\n#inc@<QtGui>\n" + lmid(3));
|
check(".", l[0] + "\n#inc<QtCore>\n#inc@<QtGui>\n" + lmid(3));
|
||||||
qWarning("FIXME");
|
|
||||||
return;
|
|
||||||
check("u", l[0] + "\n#inc<QtCore>\n#inc@lude <QtGui>\n" + lmid(3));
|
check("u", l[0] + "\n#inc<QtCore>\n#inc@lude <QtGui>\n" + lmid(3));
|
||||||
check("u", l[0] + "\n#inc@lude <QtCore>\n" + lmid(2));
|
check("u", l[0] + "\n#inc@lude <QtCore>\n" + lmid(2));
|
||||||
}
|
}
|
||||||
@@ -366,9 +363,8 @@ void tst_FakeVim::command_i()
|
|||||||
// small insertion at start of document
|
// small insertion at start of document
|
||||||
check("ix" + escape, "@x" + lines);
|
check("ix" + escape, "@x" + lines);
|
||||||
check("u", "@" + lines);
|
check("u", "@" + lines);
|
||||||
// FIXME redo broken
|
check(control('r'), "@x" + lines);
|
||||||
//check(control('r'), "@x" + lines);
|
check("u", "@" + lines);
|
||||||
//check("u", "@" + lines);
|
|
||||||
|
|
||||||
// small insertion at start of document
|
// small insertion at start of document
|
||||||
check("ixxx" + escape, "xx@x" + lines);
|
check("ixxx" + escape, "xx@x" + lines);
|
||||||
@@ -386,9 +382,8 @@ void tst_FakeVim::command_i()
|
|||||||
check("icyy" + escape, "bcy@yxa" + lines);
|
check("icyy" + escape, "bcy@yxa" + lines);
|
||||||
check("u", "b@xa" + lines);
|
check("u", "b@xa" + lines);
|
||||||
check("u", "@a" + lines);
|
check("u", "@a" + lines);
|
||||||
// FIXME undo broken
|
checkEx("redo", "b@xa" + lines);
|
||||||
// checkEx("redo", "b@xa" + lines);
|
check("u", "@a" + lines);
|
||||||
// check("u", "@a" + lines);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_FakeVim::command_left()
|
void tst_FakeVim::command_left()
|
||||||
@@ -470,19 +465,6 @@ return; // FIXME
|
|||||||
check("G", lmid(0) + "@");
|
check("G", lmid(0) + "@");
|
||||||
check("yyp", lmid(0) + "@" + lmid(9, 1));
|
check("yyp", lmid(0) + "@" + lmid(9, 1));
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
|
|
||||||
#include <QtCore>
|
|
||||||
#include <QtGui>
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
|
||||||
{
|
|
||||||
QApplication app(argc, argv);
|
|
||||||
|
|
||||||
return app.exec();
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
void tst_FakeVim::test_i_cw_i()
|
void tst_FakeVim::test_i_cw_i()
|
||||||
{
|
{
|
||||||
@@ -496,6 +478,19 @@ return; // FIXME: not in sync with Gui behaviour?
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
#include <QtCore>
|
||||||
|
#include <QtGui>
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
QApplication app(argc, argv);
|
||||||
|
|
||||||
|
return app.exec();
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Main
|
// Main
|
||||||
|
Reference in New Issue
Block a user