Skip to content

Commit 116dc1c

Browse files
committed
🌿 fix escape
1 parent b2cd780 commit 116dc1c

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

tests/denops/testdata/dummy_dispatcher_plugin.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ export const main: Entrypoint = (denops) => {
66
test: async (...args) => {
77
await delay(100);
88
await denops.cmd(
9-
`execute 'doautocmd <nomodeline> User' fnameescape('DummyDispatcherPlugin:TestCalled:${
10-
JSON.stringify(args)
11-
}')`,
9+
`doautocmd <nomodeline> User DummyDispatcherPlugin:TestCalled:${
10+
JSON.stringify(args).replaceAll(/[ \\"]/g, "\\$&")
11+
}`,
1212
);
1313
return { result: "OK", args };
1414
},

tests/denops/testdata/dummy_interrupt_plugin.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ export const main: Entrypoint = (denops) => {
77
signal?.addEventListener("abort", async () => {
88
await delay(100);
99
await denops.cmd(
10-
`doautocmd <nomodeline> User DummyInterruptPlugin:Interrupted:${signal.reason}`,
10+
`doautocmd <nomodeline> User DummyInterruptPlugin:Interrupted:${
11+
String(signal.reason).replaceAll(/[ \\"]/g, "\\$&")
12+
}`,
1113
);
1214
}, { once: true });
1315
}

0 commit comments

Comments
 (0)