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

Proposal : First version of an ExternalUndoBufferInterface #112

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

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

TextEditor.h Outdated Show resolved Hide resolved
@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.
TextEditor.h Outdated Show resolved Hide resolved
@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.

None yet

1 participant