Open RaymondLim opened 10 years ago
git bisect points to this commit 8e8d1b7e8f79530d1.
@redmunds Looking at your changes in the commit, it doesn't seem like this is the real culprit. See you can locate the real one.
@RaymondLim The result in release 42 is a little different, but it doesn't really work either. Redo in 42 fails (does nothing), so it's hard to tell if the other problem is there or not. I'm seeing this exception in the console:
Uncaught Error: There is no line 203 in the document. codemirror.js:6537
The problem seems to be a painting error. If you click in editor or hit any key, then it paints. Sometimes in 42, the editor doesn't paint after undo.
The uncaught error
mentioned above still happens in Sprint 40. This bug does not happen in Sprint 38. Using this scenario, undo doesn't work in Sprint 39, so I'm not sure how to narrow it down after that.
@RaymondLim According to git bisect
, the uncaught error
during redo was introduced in commit https://github.com/adobe/brackets/commit/89065448414a4967c3c7c61c73433fe837b2e6b7. Hopefully fixing that also fixes original bug.
@redmunds Thanks for looking into this. You're right that this only works correctly in sprint 38, but not in any sprint or release after that. I looked into Beautify code and it is calling doc.batchOperation()
with that put doc.setText(formattedText)
, editor.setCursorPos(cursor)
and editor.setScrollPos(scroll.x, scroll.y)
. And I can see that cursor position and scroll position may not be exactly the same in the formatted text. So I'm not sure this is the extension issue or the underlying CM issue.
I'm not sure how much time we should put into this for Brackets 1.0, so adding Needs Review
.
Reviewed low priority for the Editor feature area.
Result: The editor window becomes blank. I can reproduce it in release 43, but not in release 42. So I don't think this is the extension issue.