Skip to content

Commit

Permalink
🌿 fix escape
Browse files Browse the repository at this point in the history
  • Loading branch information
Milly committed Sep 18, 2024
1 parent b2cd780 commit 116dc1c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions tests/denops/testdata/dummy_dispatcher_plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ export const main: Entrypoint = (denops) => {
test: async (...args) => {
await delay(100);
await denops.cmd(
`execute 'doautocmd <nomodeline> User' fnameescape('DummyDispatcherPlugin:TestCalled:${
JSON.stringify(args)
}')`,
`doautocmd <nomodeline> User DummyDispatcherPlugin:TestCalled:${
JSON.stringify(args).replaceAll(/[ \\"]/g, "\\$&")
}`,
);
return { result: "OK", args };
},
Expand Down
4 changes: 3 additions & 1 deletion tests/denops/testdata/dummy_interrupt_plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ export const main: Entrypoint = (denops) => {
signal?.addEventListener("abort", async () => {
await delay(100);
await denops.cmd(
`doautocmd <nomodeline> User DummyInterruptPlugin:Interrupted:${signal.reason}`,
`doautocmd <nomodeline> User DummyInterruptPlugin:Interrupted:${
String(signal.reason).replaceAll(/[ \\"]/g, "\\$&")
}`,
);
}, { once: true });
}
Expand Down

0 comments on commit 116dc1c

Please sign in to comment.