webpackbin icon indicating copy to clipboard operation
webpackbin copied to clipboard

Undo not working correctly

Open k15a opened this issue 7 years ago • 1 comments

When switching the tab and undoing you get the code of the previous tab.

k15a avatar Apr 03 '17 16:04 k15a

This is caused by CodeEditor's .setModeAndLinter being asynchronous.

If modes.set's promise is returned, then the clearHistory can be done after that.

this.setModeAndLinter().then(() => {
  this.codemirror.getDoc().clearHistory()
  this.focusLastCursorPosition()
})

I'll try to get a PR up for this.

jamesopti avatar Apr 08 '17 17:04 jamesopti