From 030234e4ff6fc926960ac046e1aac6229fc605d2 Mon Sep 17 00:00:00 2001 From: yukimemi Date: Mon, 8 Jan 2024 23:14:03 +0900 Subject: [PATCH] :bug: Fix windows autocmd-pattern. --- denops/futago/main.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/denops/futago/main.ts b/denops/futago/main.ts index a0d1b5f..f9c6064 100644 --- a/denops/futago/main.ts +++ b/denops/futago/main.ts @@ -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/denops_std@v5.2.0/batch/mod.ts"; @@ -316,16 +316,18 @@ export async function main(denops: Denops): Promise { `, ); + 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()])`, ); });