diff options
| author | Albert Cervin <albert@acervin.com> | 2023-02-02 00:13:53 +0100 |
|---|---|---|
| committer | Albert Cervin <albert@acervin.com> | 2023-02-02 00:13:53 +0100 |
| commit | f17880d5ec783d600a3f74dff3d30acfc7d1e06c (patch) | |
| tree | 6ff9e80370e88dffdcd56334470e8f8f3388113f /src/command.c | |
| parent | 1cd66cac903151396a7513f8e009f6f654561daf (diff) | |
| download | dged-f17880d5ec783d600a3f74dff3d30acfc7d1e06c.tar.gz dged-f17880d5ec783d600a3f74dff3d30acfc7d1e06c.tar.xz dged-f17880d5ec783d600a3f74dff3d30acfc7d1e06c.zip | |
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.
Diffstat (limited to 'src/command.c')
| -rw-r--r-- | src/command.c | 14 |
1 files changed, 13 insertions, 1 deletions
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: "); |
