fabianmichael / kirby-markdown-field

Super-sophisticated markdown editor for Kirby 3, community built.
Other
160 stars 14 forks source link

Tab handling #138

Closed ieteo closed 2 years ago

ieteo commented 2 years ago

Version: 2.0.0-rc1

Hello,

could you add an option to turn on TAB handling please

https://codemirror.net/6/examples/tab/

Thank you

fabianmichael commented 2 years ago

Can’t promise anything, but will have a look into this.

ieteo commented 2 years ago

Thank you for considering it.

I believe this would be a welcome addition, since without the TAB functionality writing nested lists is of a little pain.

The activation of TAB handling itself is easy

File: src/components/Editor.js

The problem of custom tweaking is, that it have to be done on every update or deployment. Since composer update|install overwrites the changes.

An option to activate the TAB would be vey helpful here. Even have this turned on by default and letting users know that TABing to next field can be done with:

Press Escape, then Tab to move to this field. Or Escape, Shift-Tab to move to the field before the editor.(Option+Tab on Mac)

fabianmichael commented 2 years ago

@ieteo I finally had a few minutes for looking into this. I decided against adding this to the core, because I’m afraid that this already by far the largest JavaScript project I’ve ever managed, and I don’t want it to become bloated. So I added a generic extension API and added your requested feature as a separate extension to the extension-examples/indent-with-tab folder. Please let me know whether this solves your problem. :-)

See https://github.com/fabianmichael/kirby-markdown-field/releases/tag/2.0.0-rc2

ieteo commented 2 years ago

@fabianmichael Yes it has :-)

Thank you!