mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-01 21:54:04 +01:00
221ca0c404
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> |
||
---|---|---|
.. | ||
3307.md | ||
3337.md | ||
3434.md | ||
3642.md | ||
3654.md | ||
3723.md | ||
3729.md | ||
3791.md | ||
3808.md | ||
3836.md | ||
3838.md | ||
3847.md | ||
3870.md | ||
3886.md | ||
3917.md | ||
3922.md | ||
3985.md | ||
3989.md | ||
4027.md | ||
4072.md | ||
4083.md | ||
4136.md |