FakeVim: Perform undo/redo at least once

Change-Id: I289cb48cab47f4b0462f00ac490c66607a40dba2
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
hluk
2013-04-22 19:41:55 +02:00
committed by hjk
parent ce0efbda46
commit ecc3c9f0a3

View File

@@ -7157,8 +7157,8 @@ void FakeVimHandler::Private::undoRedo(bool undo)
++m_editBlockLevel; ++m_editBlockLevel;
// Do undo/redo [count] times to reach previous revision. // Do undo/redo [count] times to reach previous revision.
int count = m_undoState.isValid() ? m_undoState.revisions int count = qMax(1, m_undoState.isValid() ? m_undoState.revisions
: state.isValid() ? state.revisions : 1; : state.revisions);
while (count-- > 0) { while (count-- > 0) {
if (undo) if (undo)
EDITOR(undo()); EDITOR(undo());