Fixed
- Escape exit from textarea vim overlay leaks to parent scope — pressing Escape twice (insert → normal → exit) in the textarea vim editor caused the Escape keydown event to propagate to the parent modal's DOM, closing it or switching the active leaf. Root cause:
handleEscapeAndRedispatch()calledteardownActive()synchronously inside the ObsidianScope.registerhandler, which destroyed the editor and popped the keymap scope mid-handler. TheisolateKeyEventsstopPropagation()handler was removed with the editor, so the DOM-level Escape continued propagating to parent elements. Fixed by deferring teardown viarequestAnimationFrame— the Scope handler returnstrue(consuming the event) while the editor's scope is still on the stack. Also added a_destroyingflag toembeddable-editor.tsto prevent the blur event listener from double-popping the keymap scope whendestroy()is already handling cleanup. (#112)- Plugin:
src/vim/textarea-vim-manager.ts(handleEscapeAndRedispatch— deferred teardown viarequestAnimationFrame) - Plugin:
src/editors/embeddable-editor.ts(_destroyingflag, blur handler guard)
- Plugin:
- Escape exit from table cell editor leaks to parent scope — same scope-pop-mid-handler vulnerability as the textarea vim overlay. The
onEscapecallback intable-nav-controller.tscalledexitCellEdit()→closeCellEditor()→editor.destroy()→popKeymapScope()synchronously inside the Scope handler. Fixed with the same deferred-teardown pattern. (#112)- Plugin:
src/vim/table-nav-controller.ts(onEscapecallback — deferredexitCellEditviarequestAnimationFrame)
- Plugin:
Tests
- 1 e2e test in
test/specs/textarea-vim.e2e.ts(issue #112): Escape exit does not leak Escape keydown to parent modal container DOM and does not change active leaf — verifies zero Escape events propagate tomodal.containerEl, modal stays open, leaf ID unchanged
Documentation
CHANGELOG.mdKNOWN_LIMITATIONS.md: Updated embedded editor Escape handler description with deferred teardown pattern,_destroyingguard, and scope-pop-mid-handler fixCONTRIBUTING.md: Updatedembeddable-editor.tsdescription with_destroyingguard; updatedtextarea-vim-manager.tsdescription with deferred teardown; updatedtable-nav-controller.tsdescription with deferredonEscapeAGENTS.md: Updated dual-vim architecture section with deferred teardown and_destroyingguard
Full Changelog: 0.100.0...0.101.0