Commit 2890242d authored by hluk's avatar hluk Committed by hjk

FakeVim: Fix checking if text was re-inserted

Change-Id: I213ad5c9d6f8d313f07daaceb253a7d03b9035a3
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent d935b4cf
......@@ -7203,10 +7203,10 @@ void FakeVimHandler::Private::onContentsChanged(int position, int charsRemoved,
if (position < m_insertState.pos1) {
// backspaces
const int bs = m_insertState.pos1 - position;
const QString inserted = textAt(position, position + charsAdded);
const QString inserted = textAt(position, m_oldPosition);
const QString removed = m_insertState.textBeforeCursor.right(bs);
// Ignore backspaces if same text was just inserted.
if ( !inserted.startsWith(removed) ) {
if ( !inserted.endsWith(removed) ) {
m_insertState.backspaces += bs;
m_insertState.pos1 = position;
m_insertState.pos2 = qMax(position, m_insertState.pos2 - bs);
......
Markdown is supported
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