BalazsJako / ImGuiColorTextEdit

Colorizing text editor for ImGui
MIT License
1.42k stars 236 forks source link

Wish: UNDO/REDO #109

Closed berdal84 closed 3 years ago

berdal84 commented 4 years ago

Hello,

I'm developing a software to edit both text files and graphs at the same time. User may sometimes work with nodes and then work with the text editor. I want to be able to undo/redo, no matters if it is a textual change (A) or a graphical change (B). But I need to order the events like that, and to know which event I need to undo (A or B stack).

time: ---------------------------------------------------------------------->
A:        --------------        ---         ----     ----------    ----
B:                       ------     ------      ----           ---

Do you think I can handle it without adding changes in ImGuiColorTextEdit ? Or you think I should propose something ?

Thanks you by advance.

BalazsJako commented 4 years ago

Hi, The undo/redo functionality does not have public access other than the two functions doing the actual work. So you have to modify the editor, I am afraid.

berdal84 commented 4 years ago

Thanks for your answer @BalazsJako

I think I'll try something with a virtual class that we can pass to the Editor's constructor. I'll try to move the existing code into a class that implement this virtual class.

No too much time to work on it for now but that's still on my mind ;)

Bye.