diff --git a/4ed.cpp b/4ed.cpp index d890e813..231a95ad 100644 --- a/4ed.cpp +++ b/4ed.cpp @@ -4312,13 +4312,12 @@ App_Step_Sig(app_step){ // TODO(allen): Paramter checking in each DACT case. switch (act->type){ +#if 0 case DACT_TOUCH_FILE: { - if (file){ - touch_file(working_set, file); - } + }break; - +#endif #if 0 case DACT_OPEN: case DACT_OPEN_BACKGROUND: @@ -4326,7 +4325,7 @@ App_Step_Sig(app_step){ }break; #endif - + case DACT_SET_LINE: { // TODO(allen): deduplicate diff --git a/4ed_delay.cpp b/4ed_delay.cpp index 6964aa2b..11812a4a 100644 --- a/4ed_delay.cpp +++ b/4ed_delay.cpp @@ -2,7 +2,6 @@ enum Action_Type{ DACT_SET_LINE, DACT_SWITCH, DACT_TRY_KILL, - DACT_TOUCH_FILE, DACT_CLOSE, }; @@ -124,5 +123,4 @@ delayed_action_repush(Delay *delay, Delayed_Action *act){ #define delayed_set_line(delay, ...) delayed_action_(delay, DACT_SET_LINE, ##__VA_ARGS__) #define delayed_switch(delay, ...) delayed_action_(delay, DACT_SWITCH, ##__VA_ARGS__) #define delayed_try_kill(delay, ...) delayed_action_(delay, DACT_TRY_KILL, ##__VA_ARGS__) -#define delayed_touch_file(delay, ...) delayed_action_(delay, DACT_TOUCH_FILE, ##__VA_ARGS__) #define delayed_close(delay, ...) delayed_action_(delay, DACT_CLOSE, ##__VA_ARGS__) diff --git a/4ed_file.cpp b/4ed_file.cpp index 123ca46d..61e63c6e 100644 --- a/4ed_file.cpp +++ b/4ed_file.cpp @@ -488,9 +488,11 @@ working_set_lookup_file(Working_Set *working_set, String string){ internal void touch_file(Working_Set *working_set, Editing_File *file){ - Assert(!file->state.is_dummy); - dll_remove(&file->node); - dll_insert(&working_set->used_sentinel, &file->node); + if (file){ + Assert(!file->state.is_dummy); + dll_remove(&file->node); + dll_insert(&working_set->used_sentinel, &file->node); + } } // Hot Directory diff --git a/4ed_file_view.cpp b/4ed_file_view.cpp index 56c5b527..2f25d74c 100644 --- a/4ed_file_view.cpp +++ b/4ed_file_view.cpp @@ -3178,7 +3178,7 @@ interactive_view_complete(System_Functions *system, View *view, String dest, i32 switch (view->action){ case IAct_Open: view_open_file(system, models, view, dest); - delayed_touch_file(&models->delay1, old_file); + touch_file(&models->working_set, old_file); break; case IAct_Save_As: @@ -3194,7 +3194,7 @@ interactive_view_complete(System_Functions *system, View *view, String dest, i32 case IAct_Switch: delayed_switch(&models->delay1, dest, panel); - delayed_touch_file(&models->delay1, old_file); + touch_file(&models->working_set, old_file); break; case IAct_Kill: diff --git a/4ed_metagen.cpp b/4ed_metagen.cpp index 93f707ec..88107e8b 100644 --- a/4ed_metagen.cpp +++ b/4ed_metagen.cpp @@ -160,8 +160,8 @@ char *daction_enum[] = { "TRY_KILL", #if 0 "KILL", -#endif "TOUCH_FILE", +#endif "CLOSE", };