ImGuiColorTextEdit icon indicating copy to clipboard operation
ImGuiColorTextEdit copied to clipboard

Proposal : First version of an ExternalUndoBufferInterface

Open berdal84 opened this issue 5 years ago • 2 comments

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 avatar Feb 14 '20 10:02 berdal84

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.

berdal84 avatar Feb 15 '20 11:02 berdal84

What do you think of my proposal @BalazsJako ?

berdal84 avatar Apr 28 '20 06:04 berdal84