forked from qt-creator/qt-creator
FakeVim: Use "backtick" mark as alias for "tick" mark
Allows to quickly type jump command ``. Change-Id: Ie45bcf1bdf840a238e7eea1f97df70979d7d0784 Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -7150,6 +7150,7 @@ void FakeVimHandler::Private::undoRedo(bool undo)
|
|||||||
m_lastVisualMode = state.lastVisualMode;
|
m_lastVisualMode = state.lastVisualMode;
|
||||||
m_lastVisualModeInverted = state.lastVisualModeInverted;
|
m_lastVisualModeInverted = state.lastVisualModeInverted;
|
||||||
setMark(QLatin1Char('\''), lastPos);
|
setMark(QLatin1Char('\''), lastPos);
|
||||||
|
setMark(QLatin1Char('`'), lastPos);
|
||||||
setCursorPosition(m_lastChangePosition);
|
setCursorPosition(m_lastChangePosition);
|
||||||
setAnchor();
|
setAnchor();
|
||||||
stack2.push(state);
|
stack2.push(state);
|
||||||
@@ -7254,6 +7255,7 @@ void FakeVimHandler::Private::recordJump(int position)
|
|||||||
CursorPosition pos = position >= 0 ? CursorPosition(document(), position)
|
CursorPosition pos = position >= 0 ? CursorPosition(document(), position)
|
||||||
: CursorPosition(cursor());
|
: CursorPosition(cursor());
|
||||||
setMark(QLatin1Char('\''), pos);
|
setMark(QLatin1Char('\''), pos);
|
||||||
|
setMark(QLatin1Char('`'), pos);
|
||||||
if (m_jumpListUndo.isEmpty() || m_jumpListUndo.top() != pos)
|
if (m_jumpListUndo.isEmpty() || m_jumpListUndo.top() != pos)
|
||||||
m_jumpListUndo.push(pos);
|
m_jumpListUndo.push(pos);
|
||||||
m_jumpListRedo.clear();
|
m_jumpListRedo.clear();
|
||||||
@@ -7267,6 +7269,7 @@ void FakeVimHandler::Private::jump(int distance)
|
|||||||
int len = qMin(qAbs(distance), from.size());
|
int len = qMin(qAbs(distance), from.size());
|
||||||
CursorPosition m(cursor());
|
CursorPosition m(cursor());
|
||||||
setMark(QLatin1Char('\''), m);
|
setMark(QLatin1Char('\''), m);
|
||||||
|
setMark(QLatin1Char('`'), m);
|
||||||
for (int i = 0; i < len; ++i) {
|
for (int i = 0; i < len; ++i) {
|
||||||
to.push(m);
|
to.push(m);
|
||||||
setCursorPosition(from.top());
|
setCursorPosition(from.top());
|
||||||
@@ -7668,7 +7671,7 @@ bool FakeVimHandler::Private::jumpToMark(QChar mark, bool backTickMode)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mark == QLatin1Char('\'') && !m_jumpListUndo.isEmpty())
|
if ((mark == QLatin1Char('\'') || mark == QLatin1Char('`')) && !m_jumpListUndo.isEmpty())
|
||||||
m_jumpListUndo.pop();
|
m_jumpListUndo.pop();
|
||||||
recordJump();
|
recordJump();
|
||||||
setCursorPosition(m.position);
|
setCursorPosition(m.position);
|
||||||
|
Reference in New Issue
Block a user