From 07c2c7ff62ffd153a67f53dd47e67270f5e213e5 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 28 Jul 2021 12:18:04 +1000 Subject: [PATCH] show warning when trying to indent plain text https://forums.ankiweb.net/t/2-1-45-release-candidate/11362/55 --- ts/editor/FormatBlockButtons.svelte | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ts/editor/FormatBlockButtons.svelte b/ts/editor/FormatBlockButtons.svelte index 3cade2d96..28c0a2dd7 100644 --- a/ts/editor/FormatBlockButtons.svelte +++ b/ts/editor/FormatBlockButtons.svelte @@ -34,6 +34,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html const currentField = document.activeElement as EditingArea; if (getListItem(currentField.shadowRoot!)) { document.execCommand("outdent"); + } else { + alert("Indent/unindent currently only works with lists."); } } @@ -41,6 +43,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html const currentField = document.activeElement as EditingArea; if (getListItem(currentField.shadowRoot!)) { document.execCommand("indent"); + } else { + alert("Indent/unindent currently only works with lists."); } }