summaryrefslogtreecommitdiff
path: root/command.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-03-01 15:02:40 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-03-01 15:02:40 -0500
commit12bb6e2cd377d3dfa2f7ec037c31463c3f9070d1 (patch)
treee3311ad77bd0fb768adcdce7582397cf97f40183 /command.c
parent2d327302b30bf67a87538dc5e005c0399c0b8f1a (diff)
restore session
Diffstat (limited to 'command.c')
-rw-r--r--command.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/command.c b/command.c
index 91819e4..274d8c8 100644
--- a/command.c
+++ b/command.c
@@ -155,12 +155,11 @@ void command_execute(Ted *ted, Command c, i64 argument) {
menu_open(ted, MENU_OPEN);
break;
case CMD_NEW:
- ted_new_file(ted);
+ ted_new_file(ted, NULL);
break;
case CMD_SAVE:
if (buffer) {
- if (buffer->filename && streq(buffer->filename, TED_UNTITLED)) {
- // don't worry, this won't catch files called "Untitled"; buffer->filename is the full path.
+ if (buffer_is_untitled(buffer)) {
command_execute(ted, CMD_SAVE_AS, 1);
return;
}