Skip to content

Conversation

berdal84
Copy link
Contributor

Hello,

First draft version of an external undo buffer interface.

The concept is simple, this interface consists on a single method that can receive an UndoRecord& as ar gument. This method is called only if the TextEditor as an mExternalUndoRecordBuffer not null.

I had to set public a lot of your classes: UndoRecord, EditorState and the type UndoBuffer.

I choose to modify as less possible things, but I think it should be better to introduce a boolean to says is undobuffer is internal or external and then use that boolean to avoid all internal undo/redo stuff.

I don't really know why UndoRecord.Undo() takes a TextEditor pointer. Is is to avoid to store it in each Record ?

Let me know your impressions about my proposal.

Cheers

@berdal84 berdal84 requested a review from BalazsJako February 14, 2020 17:16
@berdal84
Copy link
Contributor Author

I just added a fix in InsertText public method to add an UndoRecord. From outside of a TextEditor I was unable to undo a text insertion.

User must implement how to undo the UndoRecord received himself.
@berdal84
Copy link
Contributor Author

What do you think of my proposal @BalazsJako ?

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.

1 participant