mirror of
https://github.com/esm7/obsidian-vimrc-support.git
synced 2026-07-22 05:00:25 +00:00
Fix pasteinto error when clipboard text has surrounding whitespace. (#262)
`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.
This commit is contained in:
parent
47de579471
commit
4aa4ca31f1
1 changed files with 1 additions and 1 deletions
2
main.ts
2
main.ts
|
|
@ -521,7 +521,7 @@ export default class VimrcPlugin extends Plugin {
|
|||
// Using the register for when this.yankToSystemClipboard == false
|
||||
surroundFunc(
|
||||
['[',
|
||||
'](' + vimObject.getRegisterController().getRegister('yank').keyBuffer + ")"]);
|
||||
'](' + vimObject.getRegisterController().getRegister('yank').keyBuffer[0].trim() + ")"]);
|
||||
})
|
||||
|
||||
var editor = this.getActiveView().editor;
|
||||
|
|
|
|||
Loading…
Reference in a new issue