Undo is not working properly jsx syntax is selected
Issue: When I type undo it always left a code snippet without undo. Usually is a ending tag(e.g. </div>.
How to reproduce:
- Edit a .js file
- Set the syntax to JSX
- Write down some html code
- Type undo
- Does not work properly
GIF:

It's a bit specific. When I'm editing html files it doesn't happen. But maybe it's happening with some other file types.
- Atom version 1.16.0
- vim-mode-plus version: 0.91.0
- Your OS: macOS Sierra 10.12.4
- You disabled vim-mode? Yes
- What the language-plugin for JavaScript (JSX). There are several packages.
- Do you need some snippet expansion to reproduce issue?
- Issue is 100% reproducable?
- When you could reproduce issue, can you correctly undo the change by normal
core:undo(cmd-z) ?
To reproduce issue in my side, I need precise package name you are using for JSX, complete procedure including keystroke.
Thanks.
OK I think I could repro.
- Install
reactpackage. Grammar Selector: Show, then selectJavaScript( JSX ).- type
i<div>thenescape. At this point, text is<div></div>Since when I type>, closing tag is auto inserted. uto undo. now tex is</div>, It should be empty.ushould revert to the text state BEFORE enteringinsert-mode.
My impression for this issue is maybe React plugin do something special, I'll investigate but not sure fixable by vmp-side.
Hi, found the cause.
This line of atom-react package.
editor.insertText('</' + tagName + '>', {undo: 'skip'})
https://github.com/orktes/atom-react/blame/master/lib/atom-react.coffee#L247
Inserting text with the options {undo: 'skip'}, means, "skip this insertion when undoing, in other word don't maintain buffer change history for this time mutation".
~~I 'm not sure why they explicitly setting this option.~~ (understood "why" after investigated atom-react)
I disabled in locally and confirmed the u(undo) works as expected.
If some mutation skips undo history, nothing I can do by my vmp side. I'll open issue on ato-react, but I'm not atom-react user.
If you need, pls add follow-up commment on that issue.
sent PR. Nothing I can do after all.
Thank you! I really appreciate that! I'll follow the issue that you opened on atom. 👍