strip out old undo/redo scaffolding

This commit is contained in:
Ryan Fleury
2024-08-09 10:19:29 -07:00
parent a541ca50d9
commit e506d8389c
10 changed files with 212 additions and 272 deletions
+5 -8
View File
@@ -4013,8 +4013,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
{
if(df_entity_is_nil(condition))
{
df_state_delta_history_push_batch(df_state_delta_history(), 0);
condition = df_entity_alloc(df_state_delta_history(), entity, DF_EntityKind_Condition);
condition = df_entity_alloc(entity, DF_EntityKind_Condition);
}
DF_CmdParams params = df_cmd_params_from_window(ws);
params.entity = df_handle_from_entity(condition);
@@ -4042,8 +4041,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
{
if(df_entity_is_nil(exe))
{
df_state_delta_history_push_batch(df_state_delta_history(), 0);
exe = df_entity_alloc(df_state_delta_history(), entity, DF_EntityKind_Executable);
exe = df_entity_alloc(entity, DF_EntityKind_Executable);
}
DF_CmdParams params = df_cmd_params_from_window(ws);
params.entity = df_handle_from_entity(exe);
@@ -4071,8 +4069,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
{
if(df_entity_is_nil(args))
{
df_state_delta_history_push_batch(df_state_delta_history(), 0);
args = df_entity_alloc(df_state_delta_history(), entity, DF_EntityKind_Arguments);
args = df_entity_alloc(entity, DF_EntityKind_Arguments);
}
DF_CmdParams params = df_cmd_params_from_window(ws);
params.entity = df_handle_from_entity(args);
@@ -12034,7 +12031,7 @@ df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *m
{
if(!df_entity_is_nil(df_entity_from_handle(df_interact_regs()->file)))
{
df_entity_change_parent(0, dropped_entity, dropped_entity->parent, df_entity_from_handle(df_interact_regs()->file), &df_g_nil_entity);
df_entity_change_parent(dropped_entity, dropped_entity->parent, df_entity_from_handle(df_interact_regs()->file), &df_g_nil_entity);
df_entity_equip_txt_pt(dropped_entity, txt_pt(line_num, 1));
if(dropped_entity->flags & DF_EntityFlag_HasVAddr)
{
@@ -12043,7 +12040,7 @@ df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *m
}
else if(line_vaddr != 0)
{
df_entity_change_parent(0, dropped_entity, dropped_entity->parent, df_entity_root(), &df_g_nil_entity);
df_entity_change_parent(dropped_entity, dropped_entity->parent, df_entity_root(), &df_g_nil_entity);
df_entity_equip_vaddr(dropped_entity, line_vaddr);
}
}break;
+4 -4
View File
@@ -59,12 +59,12 @@ DF_DefaultBindingTable:
{ "focus_panel_down" Down ctrl 0 alt }
//- rjf: undo/redo
//{ "undo" Z ctrl 0 0 }
//{ "redo" Y ctrl 0 0 }
{ "undo" Z ctrl 0 0 }
{ "redo" Y ctrl 0 0 }
//- rjf: focus history
//{ "go_back" Left 0 0 alt }
//{ "go_forward" Right 0 0 alt }
{ "go_back" Left 0 0 alt }
{ "go_forward" Right 0 0 alt }
//- rjf: panel removal
{ "close_panel" P ctrl shift 0 }
+14 -15
View File
@@ -1273,9 +1273,9 @@ df_watch_view_cmds(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewSt
DF_Entity *existing_watch = df_entity_from_name_and_kind(cmd->params.string, DF_EntityKind_Watch);
if(df_entity_is_nil(existing_watch))
{
DF_Entity *watch = df_entity_alloc(0, df_entity_root(), DF_EntityKind_Watch);
DF_Entity *watch = df_entity_alloc(df_entity_root(), DF_EntityKind_Watch);
df_entity_equip_cfg_src(watch, DF_CfgSrc_Project);
df_entity_equip_name(0, watch, cmd->params.string);
df_entity_equip_name(watch, cmd->params.string);
}
else
{
@@ -1935,15 +1935,15 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS
DF_Entity *watch = df_entity_from_expand_key_and_kind(pt.key, DF_EntityKind_Watch);
if(!df_entity_is_nil(watch))
{
df_entity_equip_name(0, watch, new_string);
df_entity_equip_name(watch, new_string);
state_dirty = 1;
snap_to_cursor = 1;
}
else if(editing_complete && new_string.size != 0 && df_expand_key_match(pt.key, empty_row_key))
{
watch = df_entity_alloc(0, df_entity_root(), DF_EntityKind_Watch);
watch = df_entity_alloc(df_entity_root(), DF_EntityKind_Watch);
df_entity_equip_cfg_src(watch, DF_CfgSrc_Project);
df_entity_equip_name(0, watch, new_string);
df_entity_equip_name(watch, new_string);
DF_ExpandKey key = df_expand_key_from_entity(watch);
df_eval_view_set_key_rule(eval_view, key, str8_zero());
state_dirty = 1;
@@ -1980,7 +1980,7 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS
DF_Entity *view_rule = df_entity_child_from_kind(watch, DF_EntityKind_ViewRule);
if(new_string.size != 0 && df_entity_is_nil(view_rule))
{
view_rule = df_entity_alloc(0, watch, DF_EntityKind_ViewRule);
view_rule = df_entity_alloc(watch, DF_EntityKind_ViewRule);
}
else if(new_string.size == 0 && !df_entity_is_nil(view_rule))
{
@@ -1988,7 +1988,7 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS
}
if(new_string.size != 0)
{
df_entity_equip_name(0, view_rule, new_string);
df_entity_equip_name(view_rule, new_string);
}
state_dirty = 1;
snap_to_cursor = 1;
@@ -2209,13 +2209,13 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS
{
state_dirty = 1;
snap_to_cursor = 1;
df_entity_change_parent(0, reorder_group_prev, reorder_group_prev->parent, reorder_group_prev->parent, last_watch);
df_entity_change_parent(reorder_group_prev, reorder_group_prev->parent, reorder_group_prev->parent, last_watch);
}
if(evt->delta_2s32.y > 0 && !df_entity_is_nil(last_watch) && !df_entity_is_nil(reorder_group_next))
{
state_dirty = 1;
snap_to_cursor = 1;
df_entity_change_parent(0, reorder_group_next, reorder_group_next->parent, reorder_group_next->parent, reorder_group_prev);
df_entity_change_parent(reorder_group_next, reorder_group_next->parent, reorder_group_next->parent, reorder_group_prev);
}
}
@@ -4175,11 +4175,11 @@ DF_VIEW_CMD_FUNCTION_DEF(Target)
DF_Entity *child = df_entity_child_from_kind(entity, tv->pick_dst_kind);
if(df_entity_is_nil(child))
{
child = df_entity_alloc(0, entity, tv->pick_dst_kind);
child = df_entity_alloc(entity, tv->pick_dst_kind);
}
storage_entity = child;
}
df_entity_equip_name(0, storage_entity, pick_string);
df_entity_equip_name(storage_entity, pick_string);
}break;
}
}
@@ -4419,7 +4419,6 @@ DF_VIEW_UI_FUNCTION_DEF(Target)
if(edit_commit)
{
String8 new_string = str8(tv->input_buffer, tv->input_size);
df_state_delta_history_push_batch(df_state_delta_history(), 0);
switch(commit_storage_child_kind)
{
default:
@@ -4427,13 +4426,13 @@ DF_VIEW_UI_FUNCTION_DEF(Target)
DF_Entity *child = df_entity_child_from_kind(entity, commit_storage_child_kind);
if(df_entity_is_nil(child))
{
child = df_entity_alloc(df_state_delta_history(), entity, commit_storage_child_kind);
child = df_entity_alloc(entity, commit_storage_child_kind);
}
df_entity_equip_name(df_state_delta_history(), child, new_string);
df_entity_equip_name(child, new_string);
}break;
case DF_EntityKind_Nil:
{
df_entity_equip_name(df_state_delta_history(), entity, new_string);
df_entity_equip_name(entity, new_string);
}break;
}
}
+5 -1
View File
@@ -4,7 +4,7 @@
//- GENERATED CODE
C_LINKAGE_BEGIN
DF_StringBindingPair df_g_default_binding_table[106] =
DF_StringBindingPair df_g_default_binding_table[110] =
{
{str8_lit_comp("kill_all"), {OS_Key_F5, 0 |OS_EventFlag_Shift }},
{str8_lit_comp("step_into_inst"), {OS_Key_F11, 0 |OS_EventFlag_Alt}},
@@ -34,6 +34,10 @@ DF_StringBindingPair df_g_default_binding_table[106] =
{str8_lit_comp("focus_panel_left"), {OS_Key_Left, 0 |OS_EventFlag_Ctrl |OS_EventFlag_Alt}},
{str8_lit_comp("focus_panel_up"), {OS_Key_Up, 0 |OS_EventFlag_Ctrl |OS_EventFlag_Alt}},
{str8_lit_comp("focus_panel_down"), {OS_Key_Down, 0 |OS_EventFlag_Ctrl |OS_EventFlag_Alt}},
{str8_lit_comp("undo"), {OS_Key_Z, 0 |OS_EventFlag_Ctrl }},
{str8_lit_comp("redo"), {OS_Key_Y, 0 |OS_EventFlag_Ctrl }},
{str8_lit_comp("go_back"), {OS_Key_Left, 0 |OS_EventFlag_Alt}},
{str8_lit_comp("go_forward"), {OS_Key_Right, 0 |OS_EventFlag_Alt}},
{str8_lit_comp("close_panel"), {OS_Key_P, 0 |OS_EventFlag_Ctrl |OS_EventFlag_Shift }},
{str8_lit_comp("next_tab"), {OS_Key_PageDown, 0 |OS_EventFlag_Ctrl }},
{str8_lit_comp("prev_tab"), {OS_Key_PageUp, 0 |OS_EventFlag_Ctrl }},
+1 -1
View File
@@ -320,7 +320,7 @@ DF_VIEW_UI_FUNCTION_DEF(disasm);
DF_VIEW_UI_FUNCTION_DEF(bitmap);
DF_VIEW_UI_FUNCTION_DEF(geo);
C_LINKAGE_BEGIN
extern DF_StringBindingPair df_g_default_binding_table[106];
extern DF_StringBindingPair df_g_default_binding_table[110];
extern String8 df_g_binding_version_remap_old_name_table[5];
extern String8 df_g_binding_version_remap_new_name_table[5];
extern DF_ViewSpecInfo df_g_gfx_view_kind_spec_info_table[31];