Forgejo/release-notes/8.0.0
Danko Aleksejevs 221ca0c404 Implement tab indentation and list continuation in the new editor (#3848, #3849) (#4072)
This overrides handling of Tab and Enter keys in the ComboMarkdownEditor, so that:

* Pressing Tab prepending 4 spaces to the line under cursor, or all the lines in the selection.
* Pressing Shift+Tab removes up to 4 spaces.
* Pressing Enter repeats any indentation and a "repeatable" prefix (list or blockquote) from the current line.

Since Tab "capture" can interfere with keyboard navigation, it's only done if there was any previous input in the textarea or if it was selected with a pointer. Additionally, presing Esc will make the textarea lose focus, resuming tab navigation. This seems adequate to me, but I might be wrong.

Had to use the "deprecated" execCommand method, since anything else I tried messes up the undo history. There's a fallback for when (if?) it's actually removed.

Only tested in desktop Firefox and Chrome so far.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4072
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Beowulf <beowulf@noreply.codeberg.org>
Co-authored-by: Danko Aleksejevs <danko@very.lv>
Co-committed-by: Danko Aleksejevs <danko@very.lv>
2024-06-15 13:40:31 +00:00
..
feat Implement tab indentation and list continuation in the new editor (#3848, #3849) (#4072) 2024-06-15 13:40:31 +00:00
fix [skip ci] docs(release-notes): 7.0.4 2024-06-13 08:09:27 +02:00
perf [skip ci] docs(release-notes): 7.0.4 2024-06-13 08:09:27 +02:00
3139.md Add release note for #3139 2024-04-28 22:44:59 +02:00
3285.md Add a release note for #3285 2024-05-10 09:32:07 +02:00
3383.md Release notes for Limit database max connections by default 2024-04-27 22:03:25 +02:00
3414.md ldap: default domain name (#3414) 2024-04-26 22:38:58 +00:00
3616.md Add slogan config (#3752) 2024-06-07 17:12:48 +00:00
3724.md Update module github.com/caddyserver/certmagic to v0.21.0 (#3724) 2024-05-12 14:56:39 +00:00
3811.md Add minimal implementation for RubyGems compact index API. (#3811) 2024-05-19 23:30:41 +00:00
3830.md fix(actions): prevent deleted records' UUID from colliding with new records (#3830) 2024-05-19 10:46:15 +00:00
3934.md Add a release note about the previous changes 2024-05-31 08:21:55 +02:00
4095.md Disable issue subscribe button for guest users (#4095) 2024-06-11 05:54:35 +00:00