4.0.15 ready to ship

This commit is contained in:
Allen Webster 2017-01-30 12:02:05 -05:00
parent 1c327bdeaf
commit 72518cf5e8
4 changed files with 46 additions and 12 deletions

View File

@ -486,7 +486,8 @@ config_var(Config_Item item, char *var_name, int32_t *subscript, uint32_t token_
case CPP_TOKEN_STRING_CONSTANT: 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; }break;
case CPP_TOKEN_BRACE_OPEN: 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 int32_t default_min_base_width = 550;
static bool32 automatically_indent_text_on_save = 1; static bool32 automatically_indent_text_on_save = 1;
static String default_theme_name = make_lit_string("4coder"); static char default_theme_name_space[256] = {0};
static String default_font_name = make_lit_string("Liberation Sans"); 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 static bool32
get_current_name(char **name_out, int32_t *len_out){ get_current_name(char **name_out, int32_t *len_out){
bool32 result = false; bool32 result = false;
*name_out = 0; *name_out = 0;
if (user_name.str != 0){ if (user_name.str[0] != 0){
*name_out = user_name.str; *name_out = user_name.str;
*len_out = user_name.size; *len_out = user_name.size;
result = true; result = true;
@ -601,6 +606,24 @@ get_current_name(char **name_out, int32_t *len_out){
return(result); 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!!?!?!?!!?!?!!!!? // TODO(allen): Stop handling files this way! My own API should be able to do this!!?!?!?!!?!?!!!!?
#include <stdio.h> #include <stdio.h>
@ -712,8 +735,12 @@ static void
default_4coder_initialize(Application_Links *app){ default_4coder_initialize(Application_Links *app){
init_memory(app); init_memory(app);
process_config_file(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 static void
@ -730,8 +757,12 @@ default_4coder_one_panel(Application_Links *app){
} }
static void static void
default_4coder_full_width_bottom_side_by_side_panels(Application_Links){ default_4coder_full_width_bottom_side_by_side_panels(Application_Links *app){
// TODO(allen): 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 #endif

View File

@ -14,7 +14,8 @@ TYPE: 'internal-for-default-system'
HOOK_SIG(default_start){ HOOK_SIG(default_start){
default_4coder_initialize(app); 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 // no meaning for return
return(0); return(0);

View File

@ -217,7 +217,8 @@ CUSTOM_COMMAND_SIG(load_project){
Config_Item item = get_config_item(config_line, mem, array); 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 (config_string_var(item, "extensions", 0, &str)){
if (str.size < sizeof(current_project.extension_space)){ if (str.size < sizeof(current_project.extension_space)){
set_project_extensions(&current_project, str); set_project_extensions(&current_project, str);
@ -300,7 +301,8 @@ CUSTOM_COMMAND_SIG(load_project){
dest_str[0] = 0; 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 (config_string_var(array_item, 0, 0, &str)){
if (str.size < dest_str_size){ if (str.size < dest_str_size){
interpret_escaped_string(dest_str, str); interpret_escaped_string(dest_str, str);

Binary file not shown.