SublimeANSI
SublimeANSI copied to clipboard
ANSI undo command deleting user changes
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:
- Open a new file.
- Insert text to the file.
- Set the syntax to "ANSI" via the sublime text menu.
- 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.
Well, I couldn't reproduce it now. Is it still an issue?
I'm am still able to reproduce the issue with the same steps; just tested it with commit 143a6f8.