@monaco-neovim-wasm/lib 0.1.12 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/monaco-neovim-wasm.es.js +25 -15
- package/dist/monacoNeovim.d.ts +1 -0
- package/package.json +1 -1
|
@@ -971,6 +971,7 @@ class ce {
|
|
|
971
971
|
recentNormalKeys = "";
|
|
972
972
|
lastDelegatedInsertPrefix = null;
|
|
973
973
|
lastDelegatedDotRepeat = null;
|
|
974
|
+
lastClipboardText = null;
|
|
974
975
|
ignoreInsertExitCursor = null;
|
|
975
976
|
ignoreMonacoCursorSyncToNvimUntil = 0;
|
|
976
977
|
ignoreTextKeydownUntil = 0;
|
|
@@ -1572,7 +1573,9 @@ end)(unpack(_A))`;
|
|
|
1572
1573
|
}
|
|
1573
1574
|
handleClipboardCopy(t) {
|
|
1574
1575
|
const e = (t ?? []).join(`
|
|
1575
|
-
`)
|
|
1576
|
+
`);
|
|
1577
|
+
this.lastClipboardText = e;
|
|
1578
|
+
const i = this.opts.clipboard;
|
|
1576
1579
|
if (i !== null) {
|
|
1577
1580
|
if (i?.writeText) {
|
|
1578
1581
|
i.writeText(e).catch(() => {
|
|
@@ -3234,29 +3237,36 @@ vim.rpcnotify(chan, "monaco_buf_enter", {
|
|
|
3234
3237
|
return this.session ? this.session.call(t, e) : Promise.reject(new Error("session not started"));
|
|
3235
3238
|
}
|
|
3236
3239
|
doClipboardPaste(t) {
|
|
3237
|
-
const e = (
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3240
|
+
const e = (n) => {
|
|
3241
|
+
this.lastClipboardText = n == null ? "" : String(n);
|
|
3242
|
+
const r = (n || "").split(/\r?\n/);
|
|
3243
|
+
this.sendRpcResponse(t, null, [r, "v"]);
|
|
3244
|
+
}, i = () => {
|
|
3245
|
+
try {
|
|
3246
|
+
return typeof navigator < "u" && navigator?.webdriver || typeof window > "u" || typeof window.prompt != "function" ? null : window.prompt("Paste text");
|
|
3247
|
+
} catch {
|
|
3248
|
+
return null;
|
|
3249
|
+
}
|
|
3250
|
+
}, s = this.opts.clipboard;
|
|
3251
|
+
if (s === null) {
|
|
3242
3252
|
e("");
|
|
3243
3253
|
return;
|
|
3244
3254
|
}
|
|
3245
|
-
if (
|
|
3246
|
-
|
|
3247
|
-
const
|
|
3248
|
-
e(
|
|
3255
|
+
if (s?.readText) {
|
|
3256
|
+
s.readText().then((n) => e(n || "")).catch(() => {
|
|
3257
|
+
const n = i();
|
|
3258
|
+
e(n ?? this.lastClipboardText ?? "");
|
|
3249
3259
|
});
|
|
3250
3260
|
return;
|
|
3251
3261
|
}
|
|
3252
3262
|
if (!navigator.clipboard?.readText) {
|
|
3253
|
-
const
|
|
3254
|
-
e(
|
|
3263
|
+
const n = i();
|
|
3264
|
+
e(n ?? this.lastClipboardText ?? "");
|
|
3255
3265
|
return;
|
|
3256
3266
|
}
|
|
3257
|
-
navigator.clipboard.readText().then((
|
|
3258
|
-
const
|
|
3259
|
-
e(
|
|
3267
|
+
navigator.clipboard.readText().then((n) => e(n || "")).catch(() => {
|
|
3268
|
+
const n = i();
|
|
3269
|
+
e(n ?? this.lastClipboardText ?? "");
|
|
3260
3270
|
});
|
|
3261
3271
|
}
|
|
3262
3272
|
updateCursor(t, e) {
|
package/dist/monacoNeovim.d.ts
CHANGED
|
@@ -181,6 +181,7 @@ export declare class MonacoNeovimClient {
|
|
|
181
181
|
private recentNormalKeys;
|
|
182
182
|
private lastDelegatedInsertPrefix;
|
|
183
183
|
private lastDelegatedDotRepeat;
|
|
184
|
+
private lastClipboardText;
|
|
184
185
|
private ignoreInsertExitCursor;
|
|
185
186
|
private ignoreMonacoCursorSyncToNvimUntil;
|
|
186
187
|
private ignoreTextKeydownUntil;
|