akvelon / flutter-code-editor

Flutter Code Editor is a multi-platform code editor supporting syntax highlighting, code blocks folding, autocompletion, read-only code blocks, hiding specific code blocks, themes, and more.

Home Page:https://akvelon.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Outdent on Backspace

sma opened this issue · comments

I would like to implement a "dedent on backspace" but it seems a CodeModifier that wants to register itself on '\b' doesn't work. I checked that the backspace key is delegated to the CodeController's onKey method and you could process it there if nothing else works, but I think, a CodeModifier which is called on '\n' for indentation is the right place to implement this.

I'm using version 0.2.15.

Registering on '\b' does not work because the character to test against is produced from the diff of the two values. Since the value is not +1 char long, modifiers will not be triggered at all.

CodeModifiers are legacy from the old editor. We are going to drop them in favor of something better when we gather enough use cases like this one.