Skip to content

Commit

Permalink
🐛 Fix windows autocmd-pattern.
Browse files Browse the repository at this point in the history
  • Loading branch information
yukimemi committed Jan 8, 2024
1 parent a5c1282 commit 030234e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions denops/futago/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// =============================================================================
// File : main.ts
// Author : yukimemi
// Last Change : 2024/01/08 22:30:51.
// Last Change : 2024/01/08 23:12:25.
// =============================================================================

import * as batch from "https://deno.land/x/[email protected]/batch/mod.ts";
Expand Down Expand Up @@ -316,16 +316,18 @@ export async function main(denops: Denops): Promise<void> {
`,
);

const chatCachePattern = `${chatCacheDir.replace(/\\/g, "/")}/*.md`;

await autocmd.group(denops, "futago_chat_buffer", (helper) => {
helper.remove("*");
helper.define(
"BufWriteCmd",
["futago://chat/*", `${chatCacheDir}/*.md`],
["futago://chat/*", chatCachePattern],
`call denops#notify("${denops.name}", "sendChatMessage", [bufnr()])`,
);
helper.define(
"BufRead",
`${chatCacheDir}/*.md`,
chatCachePattern,
`call denops#notify("${denops.name}", "loadChat", [bufnr()])`,
);
});
Expand Down

0 comments on commit 030234e

Please sign in to comment.