Pressing escape in HTML editor shouldn't close entire editing session

Please consider modifying the behaviour of the esc key while in the HTML editor. Currently, it closes the the HTML editor and then also closes the card editor.

I realise that just the HTML editor can be closed by pressing ctrl-shft-x but, to me, pressing escape once to exit the HTML editor and again to exit the card editor is more intuitive.

1 Like

I personally prefer the current behavior. The HTML editor now is inline and not in a separate dialog/window, so it makes sense for me to treat it as a part of the editor.


I guess it’s down to personal preference.

It is inline, but the changes you make in the HTML are not reflected until you close it. I will always want to drop back into the card editor after using the HTML editor so to check the effect of the changes I’ve made before finally closing the card editor.

For me, it would seem much simpler to just press esc to drop back to the card editor or esc esc if you want to close both editors.

This is literally driving me nuts. I don’t use the editor very often and I have to fight ten years of muscle memory to close the editor without closing the entire window. I’ve started it up and literally stared at it trying to remember how to close it. I go weeks between needing the editor.

1 Like

I use it almost daily, and it still seems like a major retrograde step to me. It would be great to include customization so that everyone can set it up how they like it.

1 Like

That’s wrong. Changes to the inline HTML editor are reflected immediately.

From 2.1.50 onward, it can even be displayed alongside the rich text output, so you can watch it update as you’re typing.

For the old behaviour of the HTML editor, Esc would have made sense to close the pop-up. With current builds, this shouldn’t be an issue, because the HTML view is part of the field now.

I reckon you’re on a version below 2.1.45?

What exactly seems retrograde?

1 Like

This add-on might be of interest to you: extended editor for field (for tables, search&replace, ...) - AnkiWeb

Sorry for the late reply. I must have missed the notification.

When I go into the HTML editor, I see only the HTML. It’s a while since the new editor replaced the old one, but I’m sure in the old one I could see both the html and the note text. For example, if I changed a font, that change would immediately be visible in the text. With the new version, I can’t see the text until I close the html editor.

That sounds like the behaviour I remember from the old version. Maybe things will improve when that is pushed live.

I don’t understand your point here. With the current editor, the workflow is to open the editor, then close it to see what effect the html changes have made, then open it again if more changes are made.

I have to remember to press ctrl-shift-x to close the editor. If I pres esc, I’m dropped out of both the html editor and the note editor. Even if I don’t need to re-open the html editor, I might need to make other changes to the note.

To me, it is infinitely better to press esc to close the html editor and then subsequently close the note editor when I’m finished editing the note.

The whole experience is just unpleasant. I’m finding it difficult to remember how the old editor was now, but I know I much preferred it. I have large notes and as soon as I go into the html editor my whole screen becomes one large black html editor. I don’t recall it working that way previously. But, mainly it’s the issue with the key-presses.

Which version are you on exactly? It sounds to me like you downgraded Anki at some point.

I think the true solution to this problem would not to chose either side and make it the same for everyone, but instead letting keybindings customization. This has been proposed in the Brainstorming for modern UI [Anki 3.0] thread, so it’s maybe going to be a feature soon.

Version ⁨2.1.49 (dc80804a)⁩

I agree, and I suggested this above.

That would be great, but I was under the impression that that thread is talking about a medium-longterm change. If it’s going to be implemented soon, that would be great.

Well, if you need something ASAP, you could try this add-on.

Thanks, maybe I’ll look into that. It has editor html edit": Edit the card's HTML which I guess will work for both opening and closing the editor.

Yes, indeed (I personally have overwritten the Ctrl+Shift+X shortcut using this add-on, even though it does not allow to simply use Esc as a way to quit the HTML editor).

1 Like