diff options
author | hluk <hluk@email.cz> | 2013-08-05 20:47:11 +0200 |
---|---|---|
committer | hjk <hjk121@nokiamail.com> | 2013-08-12 13:10:15 +0200 |
commit | 2890242df5011a1be4ceab28b5324ed3fbce892d (patch) | |
tree | a58e1f9b70253918aa40f4b65ad6322dbeb376ba /src/plugins/fakevim | |
parent | d935b4cfc62890b41fb0b343197e62214244c65d (diff) | |
download | qt-creator-2890242df5011a1be4ceab28b5324ed3fbce892d.tar.gz |
FakeVim: Fix checking if text was re-inserted
Change-Id: I213ad5c9d6f8d313f07daaceb253a7d03b9035a3
Reviewed-by: hjk <hjk121@nokiamail.com>
Diffstat (limited to 'src/plugins/fakevim')
-rw-r--r-- | src/plugins/fakevim/fakevimhandler.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index 1fe2e0795c..af1aeb73e2 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -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); |