`pasteinto` is called by `surroundFunc` which a string into whitespace
delimited arguments. Surrounding whitespace in the link to be copied
thus errors due to an unhandled number of arguments.
The now fixed error can be recreated by using `yy` to yank a line and
then using <A-p> to paste the link over a word. Similarly, `yW` will
reproduce the error if the link has a trailing whitespace.
`pasteinto` will still error if the link contains internal whitespace,
but this is more reasonable behavior. Fixing this will require tweaking
the regex `surroundFunc` uses to split up arguments.
When opening a vault with multiple windows, non-active windows could miss the timing to register yank events. Added a mechanism to manage windows that have registered yank events to ensure proper event handling across all windows.
In obsidian (>=v1.7.2?) the codemirror instance is often not unitialized
at times, triggering some uncaught exceptions. This is particularly
noticable when:
- (w/ "Vim chord display" enabled) opening the vault w/o a note opened
- closing all tabs and opening a note
Add some null guards to avoid these errors
* fix: jumpToHeading should not jump to "headings" within codeblocks
jumpToPattern now accepts an optional filterMatch param to make this
happen
* jumpToLink can now jump to standalone hyperlinks
* Adjust/clarify docstring for `jumpToNextLink`
* feat: define and expose obsidian-specific vim commands
jumpToNextHeading: g]
jumpToPreviousHeading: g[
* Implement jumpToPreviousLink motion
* Refactoring and implementing jumpToNextLink
* refactor: new jumpToPattern function that can be used for motions
* refactor: renamed file and removed unneeded exports
* fix: return last found index even if fewer than n instances found, instead of undefined
* feat: implement moveUpSkipFold and moveDownSkipFold
* refactor: extract out helper functions for defining obsidian vim actions
* refactor: split vimApi.ts into two files
* refactor: add comment
* refactor: update names, types, etc
* feat: followLinkUnderCursor action
* feat: jumpToLink now jumps to both markdown and wiki links
* refactor: rename fns
* refactor: add docstrings / change var names
* feat: implement looping around
* refactor: cleaner implementation of jumpToPattern
* Change mappings for next/prev heading to [[ and ]]
* Tiny fixes
* docs: update docs now that some more motions are provided by default
---------
Co-authored-by: Erez Shermer <erezshermer@gmail.com>