# Add better undo support when inserting formatted text

**URL:** https://meta.discourse.org/t/add-better-undo-support-when-inserting-formatted-text/214821
**Category:** Feature
**Created:** [January 14, 2022, 4:16am UTC](https://meta.discourse.org/t/add-better-undo-support-when-inserting-formatted-text/214821 "2022-01-14T04:16:44Z")
**Posts on this page:** 1
**Page:** 2

<div class="post-metadata">

### Author: ![seanblue](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@seanblue](https://meta.discourse.org/u/seanblue)
#### Post date: [June 11, 2022, 1:01am UTC](https://meta.discourse.org/t/add-better-undo-support-when-inserting-formatted-text/214821/23 "2022-06-11T01:01:43Z")

</div>

Thanks! Here’s what I noticed don’t handle undo now:

From the composer buttons:

- Blockquote
- Bulleted list
- Numbered list

Other operations (no surprises here):

- Uploading images via paste
- `@user`, `#category/tag`, `:emoji:`

Everything else I tried was able to be undone, including basic operations like bold, pasting formatted text, and pasting links on top of text to linkify them.

That said, I did notice some issues when you combine operations that can be undone with those that can’t be.

* * *

Bug 1:

- Open the editor (starting fresh is important)
- Type `hello`
- Delete all text in the editor
- Hit the Blockquote button (not undoable)
  - Editor now shows `> Blockquote`

- Hit Ctrl+Z
  - Editor now shows `> Blockquotehello`

* * *

Bug 2:

- Open the editor (starting fresh is important)
- Type `hello`
- Hit the Blockquote button (not undoable)
  - Editor now shows `hello (newlines) > Blockquote`

- Hit Ctrl+Z five times (notice the cursor move on the fifth time)
- Hit Ctrl+Y  
Editor now shows `hello (newlines) > Blockquotehhello`
- Keep hitting Ctrl+Y
  - Editor now shows `hello (newlines) > Blockquotehellohello`

The number of times you have to hit undo before this activates depends on how many letters you typed originally (`hello` in my example).

Note that this can also happen for things like mentions instead of hitting the blockquote button, but it’s even weirder since you have to _type_ to get suggestions for mentions. So when you “redo”, that text partially appears. For example:

- Type “`hello @dav`” and select your username from the suggestion list (not undoable)
- Hit Ctrl+Z until the cursor moves to the beginning of the editor like in the previous example
- Hit Ctrl+Y
  - Editor now shows `hello @david hhello @dav`

- Keep hitting Ctrl+Y
  - Editor now shows `hello @david hello @davhello @dav`

[Previous page](https://meta.discourse.org/t/add-better-undo-support-when-inserting-formatted-text/214821.md?page=1)
