SublimeANSI icon indicating copy to clipboard operation
SublimeANSI copied to clipboard

ANSI undo command deleting user changes

Open matt1003 opened this issue 8 years ago • 2 comments

Description: When executing the undo ansi command on an non-ansi file there is a potential for the user's previous changes to be delete. This occurs because the ansi plugin blindly uses the sublime text undo command to restore deleted escape codes; however if no escape codes have been deleted this will result in the user's previous changes being deleted.

Reproduce Issue:

  1. Open a new file.
  2. Insert text to the file.
  3. Set the syntax to "ANSI" via the sublime text menu.
  4. Set the syntax back to "Plain Text" via the sublime text menu. (note: the inserted text will be deleted)

Potential Solution: We should probably double check view.command_history() before invoking the sublime text undo command to ensure that we are undoing what we think we are undoing.

matt1003 avatar Apr 18 '16 06:04 matt1003

Well, I couldn't reproduce it now. Is it still an issue?

jakkubu avatar Apr 20 '16 19:04 jakkubu

I'm am still able to reproduce the issue with the same steps; just tested it with commit 143a6f8.

matt1003 avatar Apr 21 '16 23:04 matt1003