You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 16, 2021. It is now read-only.
There seems to be one common undo/redo buffer shared between all tabs of the REPL. To make matters worse, switching between tabs is something that the editor apparently sees as an update to the text in it - so if you switch from tab A to tab B and then press ctrl-z/cmd-z/whatever, you will end up with the contents of tab A in tab B.
The text was updated successfully, but these errors were encountered:
The document object in CodeMirror does provide doc.getHistory(), doc.setHistory(), and doc.clearHistory() methods which will be useful here. When we switch away from a tab, we should call getHistory and save the history somewhere specific to the tab. When we switch to a tab, we should check whether we'd previously saved any history for it and call setHistory or clearHistory as appropriate.
The simplest solution would probably be to initiate a CodeMirror instance for each tab. More expensive, but worth it I feel, since all state is preserved.
There seems to be one common undo/redo buffer shared between all tabs of the REPL. To make matters worse, switching between tabs is something that the editor apparently sees as an update to the text in it - so if you switch from tab A to tab B and then press ctrl-z/cmd-z/whatever, you will end up with the contents of tab A in tab B.
The text was updated successfully, but these errors were encountered: