From 20d7d6a42665902e44a2f1a38949961ec52bc722 Mon Sep 17 00:00:00 2001 From: mattwparas Date: Mon, 21 Aug 2023 18:30:34 -0700 Subject: [PATCH] update instructions --- STEEL.md | 20 +++++++++++++++++++- helix-term/src/commands/typed.rs | 8 +++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/STEEL.md b/STEEL.md index 480ead18f..0b124743d 100644 --- a/STEEL.md +++ b/STEEL.md @@ -57,7 +57,7 @@ to be used as typed commands. For example: (require-builtin helix/core/static as helix.static.) (require-builtin helix/core/keybindings as helix.keybindings.) -(provide shell git-add) +(provide shell git-add open-helix-scm open-init-scm reload-helix-scm) ;;@doc ;; Specialized shell implementation, where % is a wildcard for the current file @@ -85,6 +85,24 @@ to be used as typed commands. For example: (if document (Document-path document) #f))) + +;;@doc +;; Reload the helix.scm file +(define (reload-helix-scm cx) + (helix.static.run-in-engine! cx + (string-append "(require \"" (helix.static.get-helix-scm-path) "\")"))) + +;;@doc +;; Open the helix.scm file +(define (open-helix-scm cx) + (helix.open cx (list (helix.static.get-helix-scm-path)) helix.PromptEvent::Validate)) + +;;@doc +;; Opens the init.scm file +(define (open-init-scm cx) + (helix.open cx (list (helix.static.get-init-scm-path)) helix.PromptEvent::Validate)) + + ``` diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs index da47171c4..703fabd52 100644 --- a/helix-term/src/commands/typed.rs +++ b/helix-term/src/commands/typed.rs @@ -675,7 +675,13 @@ pub fn write_all_impl( if !doc.is_modified() { return None; } - if doc.path().is_none() { + + // This is a named buffer. We'll skip it in the saves for now + if doc.name.is_some() { + return None; + } + + if doc.path().is_none() && doc.name.is_none() { if write_scratch { errors.push("cannot write a buffer without a filename\n"); }