mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-11-15 18:50:20 -08:00
adjust lister acceptance rule when picking paths for things that might not exist - do not always use the first item in such cases
This commit is contained in:
1 parent
dc917cc82c
commit
91e1b1fda2
5 files changed
+19
-18
No files matched your search
+1
-1
@@ -16,7 +16,7 @@ target:
|
||||
target:
|
||||
{
|
||||
executable: "build/mule_main.exe"
|
||||
working_directory: "build/"
|
||||
working_directory: build
|
||||
output_label: output_a
|
||||
enabled: 1
|
||||
}
|
||||
|
||||
@@ -467,7 +467,7 @@ RD_NameSchemaInfo rd_name_schema_info_table[39] =
|
||||
{str8_lit_comp("color"), 1, str8_lit_comp("@inherit(tab) x:\n{\n @display_name(\"Value\") @description(\"An expression to describe the value or location of the color.\")\n 'expression': expr_string,\n}\n")},
|
||||
{str8_lit_comp("geo3d"), 1, str8_lit_comp("@inherit(tab) x:\n{\n @display_name(\"Expression\") @description(\"An expression to describe the base address of the index buffer.\")\n 'expression': expr_string,\n 'count': expr_string,\n 'vtx': expr_string,\n 'vtx_size': expr_string,\n 'yaw': @range[0, 1] f32,\n 'pitch': @range[-0.5, 0] f32,\n 'zoom': @range[0, 100] f32,\n}\n")},
|
||||
{str8_lit_comp("getting_started"), 0, str8_lit_comp("@inherit(tab) x:\n{\n}\n")},
|
||||
{str8_lit_comp("target"), 0, str8_lit_comp("@row_commands(@cmd_line save_cfg_to_project, enable_cfg, launch_and_run, launch_and_step_into, duplicate_cfg, remove_cfg)\n@collection_commands(add_target)\nx:\n{\n 'label': code_string,\n 'executable': path,\n 'arguments': string,\n 'working_directory': @folder path,\n 'entry_point': expr_string,\n @default(\"output\") 'output_label': code_string,\n 'stdout_path': @no_relativize path,\n 'stderr_path': @no_relativize path,\n 'stdin_path': @no_relativize path,\n 'environment': set,\n 'debug_subprocesses': bool,\n @no_revert @no_expand @default(0) 'enabled': bool,\n}\n")},
|
||||
{str8_lit_comp("target"), 0, str8_lit_comp("@row_commands(@cmd_line save_cfg_to_project, enable_cfg, launch_and_run, launch_and_step_into, duplicate_cfg, remove_cfg)\n@collection_commands(add_target)\nx:\n{\n 'label': code_string,\n 'executable': path,\n 'arguments': string,\n 'working_directory': @folder path,\n 'entry_point': expr_string,\n @default(\"output\") 'output_label': code_string,\n 'stdout_path': @can_not_exist @no_relativize path,\n 'stderr_path': @can_not_exist @no_relativize path,\n 'stdin_path': @can_not_exist @no_relativize path,\n 'environment': set,\n 'debug_subprocesses': bool,\n @no_revert @no_expand @default(0) 'enabled': bool,\n}\n")},
|
||||
{str8_lit_comp("breakpoint"), 0, str8_lit_comp("@row_commands(enable_cfg, duplicate_cfg, remove_cfg)\n@collection_commands(toggle_breakpoint, add_breakpoint, add_address_breakpoint, add_function_breakpoint, clear_breakpoints)\nx:\n{\n 'label': code_string,\n 'condition': expr_string,\n 'source_location': path_pt,\n 'address_location': expr_string,\n 'hit_count': u64,\n 'address_range_size': @or(0, 1, 2, 4, 8) u64,\n 'break_on_write': bool,\n 'break_on_read': bool,\n 'break_on_execute': bool,\n @no_revert @no_expand @default(1) 'enabled': bool,\n}\n")},
|
||||
{str8_lit_comp("watch_pin"), 0, str8_lit_comp("@row_commands(duplicate_cfg, remove_cfg)\n@collection_commands(add_watch_pin, toggle_watch_pin)\nx:\n{\n 'expression': expr_string,\n 'source_location': path_pt,\n 'address_location': expr_string,\n}\n")},
|
||||
{str8_lit_comp("debug_info"), 0, str8_lit_comp("@row_commands(enable_cfg, duplicate_cfg, remove_cfg)\n@collection_commands(load_debug_info)\nx:\n{\n 'path': @no_relativize path,\n @no_revert @no_expand @default(1) 'enabled': bool,\n @query 'guid': string,\n}\n")},
|
||||
@@ -533,7 +533,7 @@ str8_lit_comp("activate_with_single_click"),
|
||||
str8_lit_comp("disable_addresses"),
|
||||
str8_lit_comp("small_size"),
|
||||
str8_lit_comp("auto_unwind"),
|
||||
str8_lit_comp("pick_folder"),
|
||||
str8_lit_comp("create_new"),
|
||||
str8_lit_comp("dir2"),
|
||||
str8_lit_comp("string"),
|
||||
str8_lit_comp("cmd_name"),
|
||||
@@ -593,7 +593,7 @@ Rng1U64 rd_reg_slot_range_table[56] =
|
||||
{OffsetOf(RD_Regs, disable_addresses), OffsetOf(RD_Regs, disable_addresses) + sizeof(B32)},
|
||||
{OffsetOf(RD_Regs, small_size), OffsetOf(RD_Regs, small_size) + sizeof(B32)},
|
||||
{OffsetOf(RD_Regs, auto_unwind), OffsetOf(RD_Regs, auto_unwind) + sizeof(B32)},
|
||||
{OffsetOf(RD_Regs, pick_folder), OffsetOf(RD_Regs, pick_folder) + sizeof(B32)},
|
||||
{OffsetOf(RD_Regs, create_new), OffsetOf(RD_Regs, create_new) + sizeof(B32)},
|
||||
{OffsetOf(RD_Regs, dir2), OffsetOf(RD_Regs, dir2) + sizeof(Dir2)},
|
||||
{OffsetOf(RD_Regs, string), OffsetOf(RD_Regs, string) + sizeof(String8)},
|
||||
{OffsetOf(RD_Regs, cmd_name), OffsetOf(RD_Regs, cmd_name) + sizeof(String8)},
|
||||
|
||||
@@ -59,7 +59,7 @@ RD_RegSlot_ActivateWithSingleClick,
|
||||
RD_RegSlot_DisableAddresses,
|
||||
RD_RegSlot_SmallSize,
|
||||
RD_RegSlot_AutoUnwind,
|
||||
RD_RegSlot_PickFolder,
|
||||
RD_RegSlot_CreateNew,
|
||||
RD_RegSlot_Dir2,
|
||||
RD_RegSlot_String,
|
||||
RD_RegSlot_CmdName,
|
||||
@@ -517,7 +517,7 @@ B32 activate_with_single_click;
|
||||
B32 disable_addresses;
|
||||
B32 small_size;
|
||||
B32 auto_unwind;
|
||||
B32 pick_folder;
|
||||
B32 create_new;
|
||||
Dir2 dir2;
|
||||
String8 string;
|
||||
String8 cmd_name;
|
||||
@@ -622,7 +622,7 @@ Z(getting_started)\
|
||||
.disable_addresses = rd_regs()->disable_addresses,\
|
||||
.small_size = rd_regs()->small_size,\
|
||||
.auto_unwind = rd_regs()->auto_unwind,\
|
||||
.pick_folder = rd_regs()->pick_folder,\
|
||||
.create_new = rd_regs()->create_new,\
|
||||
.dir2 = rd_regs()->dir2,\
|
||||
.string = rd_regs()->string,\
|
||||
.cmd_name = rd_regs()->cmd_name,\
|
||||
|
||||
@@ -725,9 +725,9 @@ RD_VocabTable:
|
||||
'working_directory': @folder path,
|
||||
'entry_point': expr_string,
|
||||
@default("output") 'output_label': code_string,
|
||||
'stdout_path': @no_relativize path,
|
||||
'stderr_path': @no_relativize path,
|
||||
'stdin_path': @no_relativize path,
|
||||
'stdout_path': @can_not_exist @no_relativize path,
|
||||
'stderr_path': @can_not_exist @no_relativize path,
|
||||
'stdin_path': @can_not_exist @no_relativize path,
|
||||
'environment': set,
|
||||
'debug_subprocesses': bool,
|
||||
@no_revert @no_expand @default(0) 'enabled': bool,
|
||||
@@ -913,7 +913,7 @@ RD_RegTable:
|
||||
{B32 disable_addresses DisableAddresses }
|
||||
{B32 small_size SmallSize }
|
||||
{B32 auto_unwind AutoUnwind }
|
||||
{B32 pick_folder PickFolder }
|
||||
{B32 create_new CreateNew }
|
||||
{Dir2 dir2 Dir2 }
|
||||
{String8 string String }
|
||||
{String8 cmd_name CmdName }
|
||||
|
||||
@@ -2376,8 +2376,8 @@ rd_view_ui(Rng2F32 rect)
|
||||
row = ev_row_from_num(scratch.arena, eval_view, &block_ranges, selection_tbl.min.y);
|
||||
}
|
||||
|
||||
// rjf: default selection, and we're picking folder? -> pick currently browsed folder
|
||||
if(cfg_node_child_from_string(view, s("pick_folder")) != &cfg_nil_node && default_selection)
|
||||
// rjf: default selection, and we're making new item? -> pick currently browsed string
|
||||
if(cfg_node_child_from_string(view, s("create_new")) != &cfg_nil_node && default_selection)
|
||||
{
|
||||
rd_cmd(RD_CmdKind_CompleteQuery, .file_path = current_input);
|
||||
}
|
||||
@@ -4016,6 +4016,7 @@ rd_view_ui(Rng2F32 rect)
|
||||
B32 revert_cell = 0;
|
||||
B32 browse_cell = 0;
|
||||
B32 browse_folder = 0;
|
||||
B32 path_can_not_exist = 0;
|
||||
UI_Signal sig = {0};
|
||||
ProfScope("build cell contents")
|
||||
UI_Parent(cell_box)
|
||||
@@ -4212,7 +4213,7 @@ rd_view_ui(Rng2F32 rect)
|
||||
{
|
||||
cell_params.flags |= RD_CellFlag_BrowseButton;
|
||||
cell_params.browse_out = &browse_cell;
|
||||
browse_folder = md_node_has_tag(schema_child->first, s("folder"), 0);
|
||||
path_can_not_exist = (md_node_has_tag(schema_child->first, s("folder"), 0) || md_node_has_tag(schema_child->first, s("can_not_exist"), 0));
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -4619,7 +4620,7 @@ rd_view_ui(Rng2F32 rect)
|
||||
{
|
||||
rd_cmd(RD_CmdKind_SetCurrentPath, .file_path = str8_chop_last_slash(current_path));
|
||||
}
|
||||
rd_cmd(RD_CmdKind_RunCommand, .cmd_name = rd_cmd_kind_info_table[RD_CmdKind_PickFilePath].string, .pick_folder = browse_folder);
|
||||
rd_cmd(RD_CmdKind_RunCommand, .cmd_name = rd_cmd_kind_info_table[RD_CmdKind_PickFilePath].string, .create_new = path_can_not_exist);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16579,13 +16580,13 @@ rd_frame(void)
|
||||
{
|
||||
cfg_node_child_from_string_or_alloc(rd_state->cfg, view, s("prefer_new_tab"));
|
||||
}
|
||||
if(!rd_regs()->pick_folder)
|
||||
if(!rd_regs()->create_new)
|
||||
{
|
||||
cfg_node_release(rd_state->cfg, cfg_node_child_from_string(view, s("pick_folder")));
|
||||
cfg_node_release(rd_state->cfg, cfg_node_child_from_string(view, s("create_new")));
|
||||
}
|
||||
else
|
||||
{
|
||||
cfg_node_child_from_string_or_alloc(rd_state->cfg, view, s("pick_folder"));
|
||||
cfg_node_child_from_string_or_alloc(rd_state->cfg, view, s("create_new"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user