monome / maiden

web based editor and repl for norns
GNU General Public License v3.0
47 stars 33 forks source link

Reset "Undo Buffer" When Switching Between Files in Browser #186

Closed tyleretters closed 11 months ago

tyleretters commented 3 years ago

Plain english: you can undo into previous files.

To reproduce:

ngwese commented 3 years ago

i just tried to reproduce this behavior and i can't get it to happen in either a release build or a debug build.

what browser / os are you using?

tyleretters commented 3 years ago

brave / macos big sur.

forgot to add that you need to click in the file:

ngwese commented 3 years ago

okay, i think i might have an idea as to what is going on. when switching files the editor itself is not getting torn down and recreated but the contents of the editors copy of the buffer is being changed. i suspected the editor (which is ace) is treating the change as if it is one continuous set of edits.

hopefully there is a way to at least truncate the undo stack. a longer term fix might be to create one instance of the editor per file...

tyleretters commented 3 years ago

it feels like the simplest solution would be to reinstantiate the editor for each file? i wonder if there are other side effects besides the undo stack...