forked from qt-creator/qt-creator
FakeVim: Clear count after insert mode
Change-Id: If02aaecbbbb5e25001d5bafafd0d4228bba5d63e Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -1442,6 +1442,7 @@ public:
|
||||
void finishMovement(const QString &dotCommandMovement = QString());
|
||||
void finishMovement(const QString &dotCommandMovement, int count);
|
||||
void resetCommandMode();
|
||||
void clearCommandMode();
|
||||
QTextCursor search(const SearchData &sd, int startPos, int count, bool showMessages);
|
||||
void search(const SearchData &sd, bool showMessages = true);
|
||||
void searchNext(bool forward = true);
|
||||
@@ -2828,16 +2829,7 @@ void FakeVimHandler::Private::finishMovement(const QString &dotCommandMovement)
|
||||
|
||||
void FakeVimHandler::Private::resetCommandMode()
|
||||
{
|
||||
m_subsubmode = NoSubSubMode;
|
||||
m_submode = NoSubMode;
|
||||
m_movetype = MoveInclusive;
|
||||
m_mvcount.clear();
|
||||
m_opcount.clear();
|
||||
m_gflag = false;
|
||||
m_register = '"';
|
||||
//m_tc.clearSelection();
|
||||
m_rangemode = RangeCharMode;
|
||||
g.currentCommand.clear();
|
||||
clearCommandMode();
|
||||
if (g.returnToMode != CommandMode) {
|
||||
const QString lastInsertion = m_lastInsertion;
|
||||
if (g.returnToMode == InsertMode)
|
||||
@@ -2851,6 +2843,19 @@ void FakeVimHandler::Private::resetCommandMode()
|
||||
setAnchor();
|
||||
}
|
||||
|
||||
void FakeVimHandler::Private::clearCommandMode()
|
||||
{
|
||||
m_submode = NoSubMode;
|
||||
m_subsubmode = NoSubSubMode;
|
||||
m_movetype = MoveInclusive;
|
||||
m_mvcount.clear();
|
||||
m_opcount.clear();
|
||||
m_gflag = false;
|
||||
m_register = '"';
|
||||
m_rangemode = RangeCharMode;
|
||||
g.currentCommand.clear();
|
||||
}
|
||||
|
||||
void FakeVimHandler::Private::updateSelection()
|
||||
{
|
||||
QList<QTextEdit::ExtraSelection> selections = m_extraSelections;
|
||||
@@ -6842,8 +6847,7 @@ void FakeVimHandler::Private::enterCommandMode(Mode returnToMode)
|
||||
if (atEndOfLine())
|
||||
moveLeft();
|
||||
m_mode = CommandMode;
|
||||
m_submode = NoSubMode;
|
||||
m_subsubmode = NoSubSubMode;
|
||||
clearCommandMode();
|
||||
g.returnToMode = returnToMode;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user