Skip to content

Commit 47d6207

Browse files
committed
do not display ENOENT errors when opening a non-existent file
the intent of 6e85f17 was to show errors like `EPERM`. it's a common practice to start the editor with a filename that doesn't exist yet, in which case you get `ENOENT`. so let's just not display an error in that case.
1 parent 5d00b52 commit 47d6207

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bview.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ static buffer_t *_bview_open_buffer(bview_t *self, char *opt_path, int opt_path_
791791
if (!buffer) {
792792
buffer = buffer_new();
793793
if (has_path) buffer->path = strndup(opt_path, opt_path_len);
794-
if (buffer_errno != 0) {
794+
if (buffer_errno != 0 && buffer_errno != ENOENT) {
795795
MLE_SET_ERR(self->editor, "_bview_open_buffer: %s", strerror(buffer_errno));
796796
}
797797
}

0 commit comments

Comments
 (0)