summaryrefslogtreecommitdiff
path: root/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'command.c')
-rw-r--r--command.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/command.c b/command.c
index eb2d0bf..beb4d9d 100644
--- a/command.c
+++ b/command.c
@@ -101,7 +101,8 @@ void command_execute(Ted *ted, Command c, i64 argument) {
buffer_insert_char_at_cursor(buffer, '\t');
break;
case CMD_NEWLINE:
- if (buffer->is_line_buffer) {
+ if (!buffer) {
+ } else if (buffer->is_line_buffer) {
switch (ted->menu) {
case MENU_NONE:
assert(0);
@@ -192,9 +193,4 @@ void command_execute(Ted *ted, Command c, i64 argument) {
}
break;
}
-
- if (buffer && buffer_haserr(buffer)) {
- ted_seterr_to_buferr(ted, buffer);
- buffer_clearerr(buffer);
- }
}