Fixed
- Vim
pwith non-text clipboard content silently does nothing — whenclipboard=unnamedorclipboard=unnamedplusis set, pressingp(or]p,[p,:put) with an image on the system clipboard did nothing. The fork'spasteaction callednavigator.clipboard.readText()which returns""for image-only clipboard content, andcontinuePaste()bailed on the empty string with no error handling. Fixed by adding a.catch()handler to thereadText()promise and afallbackToNativePaste()method that callsdocument.execCommand('paste')when the text clipboard is empty orreadText()rejects. This triggers Obsidian's native paste pipeline, which creates an attachment and inserts![[Pasted image …]]. AprogrammaticPasteflag suppresses the fork'sgetOnPasteFnlistener during the fallback to prevent spurious insert-mode entry. The editor stays in normal mode after the fallback. Coversp,]p,[p,:put, and explicit"+pregister paste.P/gp/gPare overridden by the host plugin'spasteFromRegister()and are not affected (separate issue).- Fork:
~/Repos/codemirror-vim/src/vim.js(programmaticPasteflag,getOnPasteFnguard,pasteaction rewrite with.catch(),fallbackToNativePastemethod) - Fork:
~/Repos/codemirror-vim/src/types.ts(fallbackToNativePastetype signature invimActions)
- Fork:
Tests
- 3 e2e spike tests in
test/specs/spikes/spike-execcommand-paste.e2e.ts:execCommand('paste')with image clipboard triggers native image paste,execCommand('paste')with text clipboard inserts text (control), vimpwith image clipboard andclipboard=unnamedinserts image via native fallback
Documentation
CHANGELOG.mdKNOWN_LIMITATIONS.md: Added clipboard non-text paste fallback fix to yank-ring sectionAGENTS.md: Updated codemirror-vim fork description withfallbackToNativePasteandprogrammaticPasteflagdocs/configuration/settings.md: Added note about non-text clipboard fallback to clipboard setting description
Full Changelog: 0.101.0...0.102.0