diff --git a/4ed.cpp b/4ed.cpp index 231a95ad..6a709795 100644 --- a/4ed.cpp +++ b/4ed.cpp @@ -4359,25 +4359,14 @@ App_Step_Sig(app_step){ }break; #endif - + +#if 0 case DACT_SWITCH: { - if (!file && string.str){ - file = working_set_lookup_file(working_set, string); - if (!file){ - file = working_set_contains(system, working_set, string); - } - } - if (file){ - View *view = panel->view; - - view_set_file(view, file, models); - view_show_file(view); - view->map = get_map(models, file->settings.base_map_id); - } }break; - +#endif + #if 0 case DACT_KILL: { diff --git a/4ed_delay.cpp b/4ed_delay.cpp index 11812a4a..73a00831 100644 --- a/4ed_delay.cpp +++ b/4ed_delay.cpp @@ -1,6 +1,5 @@ enum Action_Type{ DACT_SET_LINE, - DACT_SWITCH, DACT_TRY_KILL, DACT_CLOSE, }; @@ -121,6 +120,5 @@ 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_close(delay, ...) delayed_action_(delay, DACT_CLOSE, ##__VA_ARGS__) diff --git a/4ed_file_view.cpp b/4ed_file_view.cpp index 2f25d74c..c4ea7d47 100644 --- a/4ed_file_view.cpp +++ b/4ed_file_view.cpp @@ -3172,7 +3172,6 @@ kill_file(System_Functions *system, Models *models, internal void interactive_view_complete(System_Functions *system, View *view, String dest, i32 user_action){ Models *models = view->persistent.models; - Panel *panel = view->panel; Editing_File *old_file = view->file_data.file; switch (view->action){ @@ -3193,8 +3192,20 @@ interactive_view_complete(System_Functions *system, View *view, String dest, i32 }break; case IAct_Switch: - delayed_switch(&models->delay1, dest, panel); - touch_file(&models->working_set, old_file); + { + touch_file(&models->working_set, old_file); + + Editing_File *file = 0; + String string = dest; + + file = working_set_lookup_file(&models->working_set, string); + if (!file){ + file = working_set_contains(system, &models->working_set, string); + } + if (file){ + view_set_file(view, file, models); + } + } break; case IAct_Kill: diff --git a/4ed_metagen.cpp b/4ed_metagen.cpp index 88107e8b..4b3295e9 100644 --- a/4ed_metagen.cpp +++ b/4ed_metagen.cpp @@ -155,8 +155,8 @@ char *daction_enum[] = { "SAVE_AS", "SAVE", "NEW", -#endif "SWITCH", +#endif "TRY_KILL", #if 0 "KILL",