obsidian-vimrc-support
obsidian-vimrc-support copied to clipboard
Several fixes to CodeMirror event registration
Fixed problem with the chord display only keeping track of one CodeMirror instance. Previously, chords would only be tracked in one CodeMirror instance.
Fixed problem with surround command surrounding text in incorrect locations (related: #39). Previously, selections wouldn't update in any other instance than the main CodeMirror instance, causing the surround excommand to surround incorrect text. Now the selections are updated across multiple CodeMirror instances.
Both fixes applied by wrapping the CodeMirror event registers in registerCodeMirror()
so that all future CodeMirror instances will be registered to the events (cursorActivity, vim-mode-change, vim-keypress, and vim-command-done when applicable).