From: Jinoh Kang jinoh.kang.kr@gmail.com
Signed-off-by: Jinoh Kang jinoh.kang.kr@gmail.com --- dlls/riched20/editor.c | 1 + dlls/riched20/editor.h | 2 +- dlls/riched20/editstr.h | 7 +++++++ 3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 3628e51ac9b..a1e0395f24d 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -2973,6 +2973,7 @@ ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10) ed->nUndoStackSize = 0; ed->nUndoLimit = STACK_SIZE_DEFAULT; ed->nUndoMode = umAddToUndo; + ed->undo_ctl_state = undoActive; ed->nParagraphs = 1; ed->nLastSelStart = ed->nLastSelEnd = 0; ed->last_sel_start_para = ed->last_sel_end_para = ed->pCursors[0].para; diff --git a/dlls/riched20/editor.h b/dlls/riched20/editor.h index 4e8445c99aa..d10ff225335 100644 --- a/dlls/riched20/editor.h +++ b/dlls/riched20/editor.h @@ -396,7 +396,7 @@ void ME_EmptyUndoStack(ME_TextEditor *editor) DECLSPEC_HIDDEN;
static inline BOOL editor_undo_ignored(ME_TextEditor *editor) { - return editor->nUndoMode == umIgnore; + return editor->undo_ctl_state != undoActive || editor->nUndoMode == umIgnore; }
/* txtsrv.c */ diff --git a/dlls/riched20/editstr.h b/dlls/riched20/editstr.h index 3b166234f23..db219d7e4df 100644 --- a/dlls/riched20/editstr.h +++ b/dlls/riched20/editstr.h @@ -285,6 +285,12 @@ typedef enum { umAddBackToUndo } ME_UndoMode;
+typedef enum { + undoActive, + undoSuspended, + undoDisabled +} ME_UndoControlState; + enum undo_type { undo_insert_run, @@ -402,6 +408,7 @@ typedef struct tagME_TextEditor int nUndoStackSize; int nUndoLimit; ME_UndoMode nUndoMode; + ME_UndoControlState undo_ctl_state; int nParagraphs; LONG nLastSelStart, nLastSelEnd; ME_Paragraph *last_sel_start_para, *last_sel_end_para;