Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undo stack support with multiple files #163

Open
coltonmercurio opened this issue Apr 30, 2016 · 1 comment
Open

Undo stack support with multiple files #163

coltonmercurio opened this issue Apr 30, 2016 · 1 comment

Comments

@coltonmercurio
Copy link
Contributor

Now that we can edit multiple files, we should retain a separate undo stack for each file that has been edited.

The Ace Editor EditSession provides methods to get and set the UndoManager

From this we could manage a mapping: file path --> current UndoManager within editor.js

When the current file is changed, save the current and load the new UndoManager into the EditSession
Whenever a file's contents are manipulated via the VM or deleted, simply remove its UndoManager from the dictionary.

@angrave
Copy link
Contributor

angrave commented Apr 30, 2016

On 4/30/16 12:24 AM, Colton Mercurio wrote:

Now that we can edit multiple files, we should retain a separate undo
stack for each file that has been edited.

The Ace Editor EditSession provides methods to get
https://urldefense.proofpoint.com/v2/url?u=https-3A__ace.c9.io_api_edit-5Fsession.html-23EditSession.getUndoManager&d=CwMCaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=DvT4PEagC1_uJoK7XYcVznCf9vBnV8AqDdM20MaTLvM&m=gSR9-bJGW_1_YlnNMRjF5T9K1667i2NtkJQf_X6_5JQ&s=LMz9kWXjqYfhTDNsTFyyCGC-noCuElKW7pmBqScbHzc&e=
and set
https://urldefense.proofpoint.com/v2/url?u=https-3A__ace.c9.io_api_edit-5Fsession.html-23EditSession.setUndoManager&d=CwMCaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=DvT4PEagC1_uJoK7XYcVznCf9vBnV8AqDdM20MaTLvM&m=gSR9-bJGW_1_YlnNMRjF5T9K1667i2NtkJQf_X6_5JQ&s=g_yN-6XGdItg4E5fnpY4uZtl3i8nAUDjX_v28ItJLO0&e=
the UndoManager
https://urldefense.proofpoint.com/v2/url?u=https-3A__ace.c9.io_api_undomanager.html&d=CwMCaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=DvT4PEagC1_uJoK7XYcVznCf9vBnV8AqDdM20MaTLvM&m=gSR9-bJGW_1_YlnNMRjF5T9K1667i2NtkJQf_X6_5JQ&s=ae8SGQTLg2ADbkr06R0Mg2dibUR3o_Ral3YhmmbujbM&e=

From this we could manage a mapping: file path --> current UndoManager
within editor.js

When the current file is changed, save the current and load the new
UndoManager into the EditSession
Whenever a file's contents are manipulated via the VM or deleted,
simply remove its UndoManager from the dictionary.

Some corner cases to consider-

And if a file is externally deleted?

And if a file is renamed to be the same as existing file (and then opened)

And if another file is renamed to be the one currently open in the editor

(there may be more - that's all that come to mind)


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_cs-2Deducation_sysbuild_issues_163&d=CwMCaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=DvT4PEagC1_uJoK7XYcVznCf9vBnV8AqDdM20MaTLvM&m=gSR9-bJGW_1_YlnNMRjF5T9K1667i2NtkJQf_X6_5JQ&s=SPUxZpS-Xpw8IJi0hodSVASMFhnFUTThzq3t-t_dOeE&e=

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants