diff --git a/src/components/CommandLine.astro b/src/components/CommandLine.astro index 27603bc..33bfa27 100644 --- a/src/components/CommandLine.astro +++ b/src/components/CommandLine.astro @@ -20,6 +20,10 @@ const cmdEvent = new CustomEvent("closebuffer"); window.dispatchEvent(cmdEvent); }, + w: () => { + const cmdEvent = new CustomEvent("savebuffer"); + window.dispatchEvent(cmdEvent); + }, help: () => { const cmdEvent = new CustomEvent("openhelp"); window.dispatchEvent(cmdEvent); diff --git a/src/components/LuaLine.astro b/src/components/LuaLine.astro index 61793e3..b851224 100644 --- a/src/components/LuaLine.astro +++ b/src/components/LuaLine.astro @@ -57,4 +57,10 @@ import CommandLine from "./CommandLine.astro"; window.addEventListener("openiccf", () => { window.location.href = "https://vimhelp.org/uganda.txt.html#iccf"; }); + + window.addEventListener("savebuffer", () => { + if (window.showSaveFilePicker) { + window.showSaveFilePicker(); + } + });