slab / quill

Quill is a modern WYSIWYG editor built for compatibility and extensibility
https://quilljs.com
BSD 3-Clause "New" or "Revised" License
42.3k stars 3.31k forks source link

feat: possibility to choose sources in undo and redo #4227

Open Marius-Romanus opened 1 month ago

Marius-Romanus commented 1 month ago

Hello!

The undo or redo is set to be executed by the user, but in my case, I am importing the history module and I want to execute an automatic undo for maximum characters and not be registered by the user.

https://github.com/slab/quill/blob/cc898efe9f5662baeadf18dfd2ccca56a3284a7e/packages/quill/src/modules/history.ts#L97

It would be nice to be able to choose who triggers the event, just like for example in deleteText

It could be compatible if by default it remains "Quill.sources.USER" if no parameter arrives.

Greetings!