From 72518cf5e890a478d64be849889cc93f7d571a2c Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Mon, 30 Jan 2017 12:02:05 -0500 Subject: [PATCH] 4.0.15 ready to ship --- 4coder_default_framework.h | 49 +++++++++++++++++++++++++++++------- 4coder_default_hooks.cpp | 3 ++- 4coder_project_commands.cpp | 6 +++-- 4ed_site.ctm | Bin 932 -> 948 bytes 4 files changed, 46 insertions(+), 12 deletions(-) diff --git a/4coder_default_framework.h b/4coder_default_framework.h index 0ead6276..0405aa7c 100644 --- a/4coder_default_framework.h +++ b/4coder_default_framework.h @@ -486,7 +486,8 @@ config_var(Config_Item item, char *var_name, int32_t *subscript, uint32_t token_ case CPP_TOKEN_STRING_CONSTANT: { - *(String*)var_out = make_string(item.mem + item.line.val_token.start + 1,item.line.val_token.size - 2); + String str = make_string(item.mem + item.line.val_token.start + 1,item.line.val_token.size - 2); + copy((String*)var_out, str); }break; case CPP_TOKEN_BRACE_OPEN: @@ -584,16 +585,20 @@ static int32_t default_wrap_width = 672; static int32_t default_min_base_width = 550; static bool32 automatically_indent_text_on_save = 1; -static String default_theme_name = make_lit_string("4coder"); -static String default_font_name = make_lit_string("Liberation Sans"); +static char default_theme_name_space[256] = {0}; +static String default_theme_name = make_fixed_width_string(default_theme_name_space); -static String user_name = {0}; +static char default_font_name_space[256] = {0}; +static String default_font_name = make_fixed_width_string(default_font_name_space); + +static char user_name_space[256] = {0}; +static String user_name = make_fixed_width_string(user_name_space); static bool32 get_current_name(char **name_out, int32_t *len_out){ bool32 result = false; *name_out = 0; - if (user_name.str != 0){ + if (user_name.str[0] != 0){ *name_out = user_name.str; *len_out = user_name.size; result = true; @@ -601,6 +606,24 @@ get_current_name(char **name_out, int32_t *len_out){ return(result); } +static String +get_default_theme_name(){ + String str = default_theme_name; + if (str.size == 0){ + str = make_lit_string("4coder"); + } + return(str); +} + +static String +get_default_font_name(){ + String str = default_font_name; + if (str.size == 0){ + str = make_lit_string("Liberation Mono"); + } + return(str); +} + // TODO(allen): Stop handling files this way! My own API should be able to do this!!?!?!?!!?!?!!!!? #include @@ -712,8 +735,12 @@ static void default_4coder_initialize(Application_Links *app){ init_memory(app); process_config_file(app); - change_theme(app, default_theme_name.str, default_theme_name.size); - change_font(app, default_font_name.str, default_font_name.size, 1); + + String theme = get_default_theme_name(); + String font = get_default_font_name(); + + change_theme(app, theme.str, theme.size); + change_font(app, font.str, font.size, 1); } static void @@ -730,8 +757,12 @@ default_4coder_one_panel(Application_Links *app){ } static void -default_4coder_full_width_bottom_side_by_side_panels(Application_Links){ - // TODO(allen): +default_4coder_full_width_bottom_side_by_side_panels(Application_Links *app){ + open_special_note_view(app); + exec_command(app, open_panel_vsplit); + exec_command(app, hide_scrollbar); + exec_command(app, change_active_panel); + exec_command(app, hide_scrollbar); } #endif diff --git a/4coder_default_hooks.cpp b/4coder_default_hooks.cpp index 7ae0efd4..5722ab28 100644 --- a/4coder_default_hooks.cpp +++ b/4coder_default_hooks.cpp @@ -14,7 +14,8 @@ TYPE: 'internal-for-default-system' HOOK_SIG(default_start){ default_4coder_initialize(app); - default_4coder_side_by_side_panels(app); + //default_4coder_side_by_side_panels(app); + default_4coder_full_width_bottom_side_by_side_panels(app); // no meaning for return return(0); diff --git a/4coder_project_commands.cpp b/4coder_project_commands.cpp index 4b17e100..7491b139 100644 --- a/4coder_project_commands.cpp +++ b/4coder_project_commands.cpp @@ -217,7 +217,8 @@ CUSTOM_COMMAND_SIG(load_project){ Config_Item item = get_config_item(config_line, mem, array); { - String str = {0}; + char str_space[512]; + String str = make_fixed_width_string(str_space); if (config_string_var(item, "extensions", 0, &str)){ if (str.size < sizeof(current_project.extension_space)){ set_project_extensions(¤t_project, str); @@ -300,7 +301,8 @@ CUSTOM_COMMAND_SIG(load_project){ dest_str[0] = 0; } - String str = {0}; + char str_space[512]; + String str = make_fixed_width_string(str_space); if (config_string_var(array_item, 0, 0, &str)){ if (str.size < dest_str_size){ interpret_escaped_string(dest_str, str); diff --git a/4ed_site.ctm b/4ed_site.ctm index d6332672b99d088e1612a5184bbc5cfd640f321b..bf940c13e94d2e4b27c01c92bc3df6e5821117fe 100644 GIT binary patch delta 24 fcmZ3&zJ-0m5@vz@y%N3>)t4BV85kJkxEL4!WEKVx delta 7 OcmdnOzJz_l5@rAk$O66q