add :w command

This commit is contained in:
2024-07-15 01:03:20 +01:00
parent 9ca9a5c9e7
commit 5238e13983
2 changed files with 10 additions and 0 deletions

View File

@@ -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);

View File

@@ -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();
}
});
</script>