From f17880d5ec783d600a3f74dff3d30acfc7d1e06c Mon Sep 17 00:00:00 2001 From: Albert Cervin Date: Thu, 2 Feb 2023 00:13:53 +0100 Subject: Add kill-ring pasting M-y can cycle through earlier cut/copies. Also fix minibuffer tokenization error and error when deleting text. Vertical scrolling also works as it should now. --- src/command.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/command.c') diff --git a/src/command.c b/src/command.c index c958a1b..cccbd2c 100644 --- a/src/command.c +++ b/src/command.c @@ -95,7 +95,7 @@ int32_t find_file(struct command_ctx ctx, int argc, const char *argv[]) { if (argc == 1) { pth = argv[0]; struct stat sb; - if (stat(pth, &sb) < 0) { + if (stat(pth, &sb) < 0 && errno != ENOENT) { minibuffer_echo("stat on %s failed: %s", pth, strerror(errno)); return 1; } @@ -116,6 +116,18 @@ int32_t find_file(struct command_ctx ctx, int argc, const char *argv[]) { return 0; } +int32_t write_file(struct command_ctx ctx, int argc, const char *argv[]) { + const char *pth = NULL; + if (argc == 1) { + pth = argv[0]; + buffer_write_to(ctx.active_window->buffer, pth); + } else { + minibuffer_prompt(ctx, "write to file: "); + } + + return 0; +} + int32_t run_interactive(struct command_ctx ctx, int argc, const char *argv[]) { if (argc == 0) { minibuffer_prompt(ctx, "execute: "); -- cgit v1.2.3