summaryrefslogtreecommitdiff
path: root/src/command.c
diff options
context:
space:
mode:
authorAlbert Cervin <albert@acervin.com>2023-02-11 23:03:39 +0100
committerAlbert Cervin <albert@acervin.com>2023-02-15 23:41:35 +0100
commite45499816eab8abadbdd5bb6dd79b526a4ed6648 (patch)
tree3cdcb0238aaae8ed1b3578e4ad71883f0702de3c /src/command.c
parentc2976cea9bbca465712534b7e523783e2ccc6c6e (diff)
downloaddged-e45499816eab8abadbdd5bb6dd79b526a4ed6648.tar.gz
dged-e45499816eab8abadbdd5bb6dd79b526a4ed6648.tar.xz
dged-e45499816eab8abadbdd5bb6dd79b526a4ed6648.zip
Implement undo
This also fixes a bunch of valgrind errors
Diffstat (limited to 'src/command.c')
-rw-r--r--src/command.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/command.c b/src/command.c
index cccbd2c..be021fe 100644
--- a/src/command.c
+++ b/src/command.c
@@ -100,7 +100,7 @@ int32_t find_file(struct command_ctx ctx, int argc, const char *argv[]) {
return 1;
}
- if (S_ISDIR(sb.st_mode)) {
+ if (S_ISDIR(sb.st_mode) && errno != ENOENT) {
minibuffer_echo("TODO: implement dired!");
return 1;
}
@@ -109,6 +109,7 @@ int32_t find_file(struct command_ctx ctx, int argc, const char *argv[]) {
buffers_add(ctx.buffers, buffer_from_file((char *)pth)));
minibuffer_echo_timeout(4, "buffer \"%s\" loaded",
ctx.active_window->buffer->name);
+
} else {
minibuffer_prompt(ctx, "find file: ");
}