Fixed
- Plugin fails to load when built-in Vim mode is enabled — three fork-only API methods were called unconditionally, but do not exist on Obsidian's built-in Vim API. When built-in Vim mode is enabled (or when another plugin pre-installs
window.CodeMirrorAdapter.Vimwith the built-in API),getVimApi()returns the built-in Vim object and the calls throwTypeError: … is not a function. Addedtypeofguards to all three call sites and marked the methods as optional in theVimApitype definition. (#29)vim.resetKeymap()inonload()— prevented the plugin from loading entirelyvimApi.clearInputState(cm, 'pane-switch')in theactive-leaf-changehandler — crashed on every tab switch when a partial key buffer was pendingthis.vim.removeMapCommand(reg.keys)inVimRegistration.removeRegistration()— crashed during plugin unload or feature toggle when cleaning upmapCommandregistrations
Full Changelog: 0.21.1...0.21.2