mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-12-01 18:13:20 -08:00
parameterize string eval commit path by whether or not the surrounding ui expects the string to be manually escaped or not by the user (it is not in the case of things like the meta-entity views)
This commit is contained in:
1 parent
a202999655
commit
7adf08cc7b
4 files changed
+17
-13
No files matched your search
@@ -2748,7 +2748,7 @@ rd_whole_range_from_eval_space(E_Space space)
|
||||
//- rjf: writing values back to child processes
|
||||
|
||||
internal B32
|
||||
rd_commit_eval_value_string(E_Eval dst_eval, String8 string)
|
||||
rd_commit_eval_value_string(E_Eval dst_eval, String8 string, B32 string_needs_unescaping)
|
||||
{
|
||||
B32 result = 0;
|
||||
if(dst_eval.mode == E_Mode_Offset)
|
||||
@@ -2776,14 +2776,17 @@ rd_commit_eval_value_string(E_Eval dst_eval, String8 string)
|
||||
e_type_kind_is_integer(direct_type_kind))
|
||||
{
|
||||
B32 is_quoted = 0;
|
||||
if(string.size >= 1 && string.str[0] == '"')
|
||||
if(string_needs_unescaping)
|
||||
{
|
||||
string = str8_skip(string, 1);
|
||||
is_quoted = 1;
|
||||
}
|
||||
if(string.size >= 1 && string.str[string.size-1] == '"')
|
||||
{
|
||||
string = str8_chop(string, 1);
|
||||
if(string.size >= 1 && string.str[0] == '"')
|
||||
{
|
||||
string = str8_skip(string, 1);
|
||||
is_quoted = 1;
|
||||
}
|
||||
if(string.size >= 1 && string.str[string.size-1] == '"')
|
||||
{
|
||||
string = str8_chop(string, 1);
|
||||
}
|
||||
}
|
||||
if(is_quoted)
|
||||
{
|
||||
@@ -6850,7 +6853,7 @@ rd_window_frame(RD_Window *ws)
|
||||
if(ui_committed(sig))
|
||||
{
|
||||
String8 commit_string = str8(ws->hover_eval_txt_buffer, ws->hover_eval_txt_size);
|
||||
B32 success = rd_commit_eval_value_string(row_eval, commit_string);
|
||||
B32 success = rd_commit_eval_value_string(row_eval, commit_string, 1);
|
||||
if(success == 0)
|
||||
{
|
||||
log_user_error(str8_lit("Could not commit value successfully."));
|
||||
|
||||
Reference in new issue
Block a user