Fixed a race condition in yank & paste

This commit is contained in:
Erez Shermer 2021-01-21 10:22:41 +02:00
parent 5819c69532
commit 760953695e
4 changed files with 7 additions and 3 deletions

View file

@ -67,6 +67,10 @@ Things I'd love to add:
## Changelog
### 0.2.4
Fixed a race condition with yank & paste: https://github.com/esm7/obsidian-vimrc-support/issues/11
### 0.2.3
Added the `noremap` command, thanks @nadavspi!

View file

@ -93,7 +93,7 @@ export default class VimrcPlugin extends Plugin {
if (currentBuffer != this.lastYankBuffer) {
if (this.lastYankBuffer.length > 0 && currentBuffer.length > 0 && currentBuffer[0]) {
navigator.clipboard.writeText(currentBuffer[0]);
this.lastSystemClipboard = currentBuffer[0];
navigator.clipboard.readText().then((value) => { this.lastSystemClipboard = value; });
}
this.lastYankBuffer = currentBuffer;
return;

View file

@ -1,7 +1,7 @@
{
"id": "obsidian-vimrc-support",
"name": "Obsidian Vimrc Support",
"version": "0.2.3",
"version": "0.2.4",
"description": "Auto-load a startup file with Obsidian Vim commands.",
"author": "esm",
"authorUrl": "",

View file

@ -1,6 +1,6 @@
{
"name": "obsidian-vimrc-support",
"version": "0.2.3",
"version": "0.2.4",
"description": "Auto-load a startup file with Obsidian Vim commands.",
"main": "main.js",
"scripts": {