Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable undo for opened files #46

Merged
merged 2 commits into from
Jul 11, 2019
Merged

Disable undo for opened files #46

merged 2 commits into from
Jul 11, 2019

Conversation

AmionSky
Copy link
Contributor

Fix for #2

@@ -402,5 +402,18 @@ public void SetText(string text)
{
Document.SetText(TextSetOptions.None, GetTextWithDefaultTabIndentation(text));
}

public void ResetUndoStack()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe name it to "ClearUndoStack"?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, "ClearUndoQueue" according to MS document:

Gets or sets the maximum number of actions that can be stored in the undo queue.
public uint UndoLimit { get; set; }

var undoLimit = Document.UndoLimit;

// Check to prevent the undo limit stuck on zero
// because it returns 0 even if the undo limit isn't set yet
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add comment to describe what you are doing here (Clear UndoQueue by setting its limit to 0 and set it back)

@AmionSky
Copy link
Contributor Author

Updated

@0x7c13 0x7c13 merged commit d6689fe into 0x7c13:master Jul 11, 2019
@AmionSky AmionSky deleted the undo-fix branch July 11, 2019 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants