SimpleMarkdown icon indicating copy to clipboard operation
SimpleMarkdown copied to clipboard

Undo/Redo

Open johnkyle4 opened this issue 3 years ago • 2 comments

Would love to see an Undo function.

johnkyle4 avatar Mar 25 '21 09:03 johnkyle4

I would too actually. Unfortunately it's quite complicated as Android already has a built-in undo/redo system but it isn't accessible to devs as far as I can tell, which means I have a few options:

  1. Use some hidden APIs or other hacky methods of exposing the system-level undo/redo. This is probably not a great idea as it's likely to be a fragile implementation that doesn't work on all devices or even on the same devices on different versions of Android.
  2. Write my own implementation. This is tough because it adds complexity to the code for a feature that really should be handled by the system. I'd also have to override keyboard shortcuts and make sure there aren't any accessibility features that I'd need to override as well so that they all point to my implementation instead of the system one, because this could lead to unexpected results when my implementation and the system implementation get out of sync. Keeping the two in sync is likely impossible so I'd want to avoid any interactions with the system implementation.
  3. Use an alternative view for editing. The standard editing view might not be the best tool for the job, and I haven't really looked into other options or even just using a webview. Other options might introduce other problems though, so it would need a decent amount of testing. Then again, this may be the most feasible option to get it working at all

wbrawner avatar Mar 25 '21 18:03 wbrawner

There has got to be an open source lib that does this already?

Sleuth56 avatar Mar 26 '21 17:03 Sleuth56