summaryrefslogtreecommitdiff
path: root/src/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/command.c')
-rw-r--r--src/command.c14
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: ");