mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-06 22:08:41 +00:00
more tweaks of the previous
This commit is contained in:
+16
-18
@@ -4695,14 +4695,14 @@ rd_view_ui(Rng2F32 rect)
|
|||||||
////////////////////////////
|
////////////////////////////
|
||||||
//- rjf: catchall completion controls
|
//- rjf: catchall completion controls
|
||||||
//
|
//
|
||||||
UI_Focus(UI_FocusKind_On)
|
if(vs->query_is_selected) UI_Focus(UI_FocusKind_On)
|
||||||
{
|
{
|
||||||
if(rd_cfg_child_from_string(view, str8_lit("close_on_cancel")) == &rd_nil_cfg && ui_is_focus_active() && ui_slot_press(UI_EventActionSlot_Cancel))
|
if(ui_is_focus_active() && ui_slot_press(UI_EventActionSlot_Cancel))
|
||||||
{
|
{
|
||||||
vs->query_is_selected = 0;
|
vs->query_is_selected = 0;
|
||||||
vs->query_string_size = 0;
|
vs->query_string_size = 0;
|
||||||
}
|
}
|
||||||
if(vs->query_is_selected && ui_is_focus_active() && ui_slot_press(UI_EventActionSlot_Accept))
|
if(ui_is_focus_active() && ui_slot_press(UI_EventActionSlot_Accept))
|
||||||
{
|
{
|
||||||
String8 cmd_name = rd_view_query_cmd();
|
String8 cmd_name = rd_view_query_cmd();
|
||||||
String8 input = rd_view_query_input();
|
String8 input = rd_view_query_input();
|
||||||
@@ -6419,7 +6419,6 @@ rd_window_frame(void)
|
|||||||
RD_Cfg *root = rd_immediate_cfg_from_keyf("hover_eval_view");
|
RD_Cfg *root = rd_immediate_cfg_from_keyf("hover_eval_view");
|
||||||
RD_Cfg *view = rd_view_from_eval(root, hover_eval);
|
RD_Cfg *view = rd_view_from_eval(root, hover_eval);
|
||||||
rd_cfg_child_from_string_or_alloc(view, str8_lit("explicit_root"));
|
rd_cfg_child_from_string_or_alloc(view, str8_lit("explicit_root"));
|
||||||
rd_cfg_child_from_string_or_alloc(view, str8_lit("close_on_cancel"));
|
|
||||||
|
|
||||||
// rjf: determine size of hover evaluation container
|
// rjf: determine size of hover evaluation container
|
||||||
EV_BlockTree predicted_block_tree = {0};
|
EV_BlockTree predicted_block_tree = {0};
|
||||||
@@ -6769,11 +6768,13 @@ rd_window_frame(void)
|
|||||||
//- rjf: query interactions
|
//- rjf: query interactions
|
||||||
if(query_floating_view_task)
|
if(query_floating_view_task)
|
||||||
{
|
{
|
||||||
|
RD_Cfg *view = query_floating_view_task->view;
|
||||||
|
RD_ViewState *vs = rd_view_state_from_cfg(query_floating_view_task->view);
|
||||||
String8 cmd_name = ws->query_regs->cmd_name;
|
String8 cmd_name = ws->query_regs->cmd_name;
|
||||||
RD_CmdKindInfo *cmd_kind_info = rd_cmd_kind_info_from_string(cmd_name);
|
RD_CmdKindInfo *cmd_kind_info = rd_cmd_kind_info_from_string(cmd_name);
|
||||||
|
|
||||||
// rjf: close queries
|
// rjf: close queries
|
||||||
if(query_floating_view_task->pressed_outside || ui_slot_press(UI_EventActionSlot_Cancel))
|
if(query_floating_view_task->pressed_outside || (rd_cfg_child_from_string(view, str8_lit("lister")) != &rd_nil_cfg && !vs->query_is_selected) || ui_slot_press(UI_EventActionSlot_Cancel))
|
||||||
{
|
{
|
||||||
rd_cmd(RD_CmdKind_CancelQuery);
|
rd_cmd(RD_CmdKind_CancelQuery);
|
||||||
}
|
}
|
||||||
@@ -6781,7 +6782,6 @@ rd_window_frame(void)
|
|||||||
// rjf: any queries which take a file path mutate the debugger's "current path"
|
// rjf: any queries which take a file path mutate the debugger's "current path"
|
||||||
if(cmd_kind_info->query.slot == RD_RegSlot_FilePath)
|
if(cmd_kind_info->query.slot == RD_RegSlot_FilePath)
|
||||||
{
|
{
|
||||||
RD_Cfg *view = query_floating_view_task->view;
|
|
||||||
RD_Cfg *query = rd_cfg_child_from_string(view, str8_lit("query"));
|
RD_Cfg *query = rd_cfg_child_from_string(view, str8_lit("query"));
|
||||||
RD_Cfg *input = rd_cfg_child_from_string(query, str8_lit("input"));
|
RD_Cfg *input = rd_cfg_child_from_string(query, str8_lit("input"));
|
||||||
if(input != &rd_nil_cfg)
|
if(input != &rd_nil_cfg)
|
||||||
@@ -14701,7 +14701,6 @@ Z(getting_started)
|
|||||||
RD_Cfg *window_query = rd_immediate_cfg_from_keyf("window_query_%p", window);
|
RD_Cfg *window_query = rd_immediate_cfg_from_keyf("window_query_%p", window);
|
||||||
rd_cfg_release_all_children(window_query);
|
rd_cfg_release_all_children(window_query);
|
||||||
view = rd_cfg_child_from_string_or_alloc(window_query, str8_lit("watch"));
|
view = rd_cfg_child_from_string_or_alloc(window_query, str8_lit("watch"));
|
||||||
rd_cfg_new(view, str8_lit("close_on_cancel"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// rjf: non-floating -> embed in tab parameter
|
// rjf: non-floating -> embed in tab parameter
|
||||||
@@ -14710,6 +14709,12 @@ Z(getting_started)
|
|||||||
view = rd_cfg_from_id(rd_regs()->view);
|
view = rd_cfg_from_id(rd_regs()->view);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// rjf: determine if the target view is a lister (and thus already has a command)
|
||||||
|
B32 view_is_lister = (rd_cfg_child_from_string(view, str8_lit("lister")) != &rd_nil_cfg);
|
||||||
|
|
||||||
|
// rjf: target view is a lister -> do not do anything - cannot replace the command
|
||||||
|
if(!view_is_lister)
|
||||||
|
{
|
||||||
// rjf: unpack view's query info
|
// rjf: unpack view's query info
|
||||||
RD_Cfg *query = rd_cfg_child_from_string_or_alloc(view, str8_lit("query"));
|
RD_Cfg *query = rd_cfg_child_from_string_or_alloc(view, str8_lit("query"));
|
||||||
RD_Cfg *cmd = rd_cfg_child_from_string_or_alloc(query, str8_lit("cmd"));
|
RD_Cfg *cmd = rd_cfg_child_from_string_or_alloc(query, str8_lit("cmd"));
|
||||||
@@ -14790,6 +14795,7 @@ Z(getting_started)
|
|||||||
{
|
{
|
||||||
vs->query_is_selected = 1;
|
vs->query_is_selected = 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}break;
|
}break;
|
||||||
case RD_CmdKind_CompleteQuery:
|
case RD_CmdKind_CompleteQuery:
|
||||||
{
|
{
|
||||||
@@ -14801,19 +14807,11 @@ Z(getting_started)
|
|||||||
rd_push_cmd(cmd_name, rd_regs());
|
rd_push_cmd(cmd_name, rd_regs());
|
||||||
}
|
}
|
||||||
|
|
||||||
// rjf: find out if this view is floating
|
// rjf: find out if this view is a lister
|
||||||
B32 is_floating = 0;
|
B32 is_lister = (rd_cfg_child_from_string(view, str8_lit("lister")) != &rd_nil_cfg);
|
||||||
for(RD_Cfg *p = view; p != &rd_nil_cfg; p = p->parent)
|
|
||||||
{
|
|
||||||
if(str8_match(p->string, str8_lit("transient"), 0))
|
|
||||||
{
|
|
||||||
is_floating = 1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// rjf: complete query
|
// rjf: complete query
|
||||||
if(is_floating)
|
if(is_lister)
|
||||||
{
|
{
|
||||||
RD_Cfg *window = rd_cfg_from_id(rd_regs()->window);
|
RD_Cfg *window = rd_cfg_from_id(rd_regs()->window);
|
||||||
RD_WindowState *ws = rd_window_state_from_cfg(window);
|
RD_WindowState *ws = rd_window_state_from_cfg(window);
|
||||||
|
|||||||
Reference in New Issue
Block a user