singerdmx / flutter-quill

Rich text editor for Flutter
https://pub.dev/packages/flutter_quill
MIT License
2.6k stars 839 forks source link

Find & Replace in document from user selection with styles #2359

Open bloemy7 opened 1 week ago

bloemy7 commented 1 week ago

Is there an existing issue for this?

The question

First of all thanks for the amazing work with flutter quill! I have a question: I am implementing a feature where the user can select some text, and then through a feature basically change that text to some new one (might be longer, shorter, etc.). I then need to replace that text with the new generated text, but leave all the rest untouched.

I'm having a conceptual issue in terms of how I can achieve this, since the underlying format is delta, and when there are new lines there are various insert entries in the Delta of course, and when I do a "search" it only does it on a per line basis seemingly, while the user could select more text. Also when the user selects text it's in "plain text" format as it's within the editor, but I need the change to affect the underlying delta representation.

I feel this is something that must be supported so I'm wondering what I'm missing here?

Thanks a lot!