From 124ce3f526beafc60fe69b0ed0eaf7dcaa2b38fe Mon Sep 17 00:00:00 2001 From: Davis Chan Date: Thu, 12 Jun 2025 23:28:32 +0800 Subject: [PATCH] fix: prevent widget decoration beyond document end for vim keybindings --- src/copy-inline-code-view-plugin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/copy-inline-code-view-plugin.ts b/src/copy-inline-code-view-plugin.ts index f89dd0c..8d68978 100644 --- a/src/copy-inline-code-view-plugin.ts +++ b/src/copy-inline-code-view-plugin.ts @@ -57,7 +57,7 @@ class CopyInlineCodeViewPlugin implements PluginValue { node.from, node.to ); - if (shouldExclude(codeText, filters)) { + if (shouldExclude(codeText, filters) || node.to + 1 > view.state.doc.length) { return; } builder.add(