superlistapp / super_editor

A Flutter toolkit for building document editors and readers
https://superlist.com/SuperEditor/
MIT License
1.67k stars 245 forks source link

[SuperEditor] - Exception when removing action tags slash character within some text #2373

Open alterhuman opened 2 weeks ago

alterhuman commented 2 weeks ago

In the super_editor action tags example in the example app, if you type some text and then move the caret in between the text and then add / and delete it, the app crashes with the following error:

The following _Exception was thrown while processing the key message handler:
Exception: removeAttribution() did not satisfy start < 0 and start > end, start: 8, end: 7

To Reproduce

  1. Run the super_editor example app
  2. Go to action tags from the sidebar
  3. Type 'hello world'
  4. Move the caret between hello and world.
  5. Add a /
  6. Then delete it

Platform MacOS

Flutter version Flutter 3.25.0-1.0.pre.147 • channel master

@matthew-carroll @angelosilvestre please assist

KevinBrendel commented 2 weeks ago

Might be the same as #2240. In the comment there I mentioned a fix for this.

alterhuman commented 2 weeks ago

Yes this is the exact issue. Thank you so much @KevinBrendel

@angelosilvestre can #2240 solution please be merged with the main repo? I don't want to maintain a fork just for this.

angelosilvestre commented 2 weeks ago

@alterhuman I'll try to take a look at this over the weekend.

alterhuman commented 2 weeks ago

@angelosilvestre thank you so much! Really appreciate it man.