diff --git a/README.md b/README.md index 40423fb..7f07f2b 100644 --- a/README.md +++ b/README.md @@ -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! diff --git a/main.ts b/main.ts index f852435..bbc9224 100644 --- a/main.ts +++ b/main.ts @@ -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; diff --git a/manifest.json b/manifest.json index ba57f4f..5876362 100644 --- a/manifest.json +++ b/manifest.json @@ -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": "", diff --git a/package.json b/package.json index 692a226..53dac13 100644 --- a/package.json +++ b/package.json @@ -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": {