Commit 0d803c5d authored by hjk's avatar hjk
Browse files

fakevim: fix some target column related issues

parent e84d4ae7
...@@ -605,7 +605,7 @@ EventResult FakeVimHandler::Private::handleKey(int key, int unmodified, ...@@ -605,7 +605,7 @@ EventResult FakeVimHandler::Private::handleKey(int key, int unmodified,
void FakeVimHandler::Private::finishMovement(const QString &dotCommand) void FakeVimHandler::Private::finishMovement(const QString &dotCommand)
{ {
//qDebug() << "ANCHOR: " << m_anchor; //qDebug() << "ANCHOR: " << position() << anchor();
if (m_submode == FilterSubMode) { if (m_submode == FilterSubMode) {
int beginLine = lineForPosition(anchor()); int beginLine = lineForPosition(anchor());
int endLine = lineForPosition(position()); int endLine = lineForPosition(position());
...@@ -921,6 +921,7 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified, ...@@ -921,6 +921,7 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
} else if (key >= '0' && key <= '9') { } else if (key >= '0' && key <= '9') {
if (key == '0' && m_mvcount.isEmpty()) { if (key == '0' && m_mvcount.isEmpty()) {
moveToStartOfLine(); moveToStartOfLine();
setTargetColumn();
finishMovement(); finishMovement();
} else { } else {
m_mvcount.append(QChar(key)); m_mvcount.append(QChar(key));
...@@ -971,9 +972,9 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified, ...@@ -971,9 +972,9 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
} else if (key == '\'') { } else if (key == '\'') {
m_subsubmode = TickSubSubMode; m_subsubmode = TickSubSubMode;
} else if (key == '|') { } else if (key == '|') {
setAnchor();
moveToStartOfLine(); moveToStartOfLine();
moveRight(qMin(count(), rightDist()) - 1); moveRight(qMin(count(), rightDist()) - 1);
setTargetColumn();
finishMovement(); finishMovement();
} else if (key == '!' && m_visualMode == NoVisualMode) { } else if (key == '!' && m_visualMode == NoVisualMode) {
m_submode = FilterSubMode; m_submode = FilterSubMode;
...@@ -992,14 +993,16 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified, ...@@ -992,14 +993,16 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
finishMovement(); finishMovement();
} else if (key == Key_Home) { } else if (key == Key_Home) {
moveToStartOfLine(); moveToStartOfLine();
setTargetColumn();
finishMovement(); finishMovement();
} else if (key == '$' || key == Key_End) { } else if (key == '$' || key == Key_End) {
int submode = m_submode; int submode = m_submode;
moveToEndOfLine(); moveToEndOfLine();
m_moveType = MoveExclusive; m_moveType = MoveExclusive;
finishMovement("$"); setTargetColumn();
if (submode == NoSubMode) if (submode == NoSubMode)
m_targetColumn = -1; m_targetColumn = -1;
finishMovement("$");
} else if (key == ',') { } else if (key == ',') {
// FIXME: use some other mechanism // FIXME: use some other mechanism
//m_passing = true; //m_passing = true;
......
Supports Markdown
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