Commit 40c54854 authored by Jinoh Kang's avatar Jinoh Kang Committed by Alexandre Julliard

riched20: Add undo control state variable to ME_TextEditor.

parent 0cd86e01
......@@ -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;
......
......@@ -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 */
......
......@@ -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;
......
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