diff --git a/4coder_base_commands.cpp b/4coder_base_commands.cpp index 5047b984..bdb0087d 100644 --- a/4coder_base_commands.cpp +++ b/4coder_base_commands.cpp @@ -1387,8 +1387,24 @@ CUSTOM_DOC("Set the other non-active panel to view the buffer that the active pa if (view1.view_id != view2.view_id){ int32_t buffer_id1 = view1.buffer_id; int32_t buffer_id2 = view2.buffer_id; - view_set_buffer(app, &view1, buffer_id2, 0); - view_set_buffer(app, &view2, buffer_id1, 0); + if (buffer_id1 != buffer_id2){ + view_set_buffer(app, &view1, buffer_id2, 0); + view_set_buffer(app, &view2, buffer_id1, 0); + } + else{ + Full_Cursor v1_c = view1.cursor; + Full_Cursor v1_m = view1.mark; + GUI_Scroll_Vars v1_r = view1.scroll_vars; + Full_Cursor v2_c = view2.cursor; + Full_Cursor v2_m = view2.mark; + GUI_Scroll_Vars v2_r = view2.scroll_vars; + view_set_cursor(app, &view1, seek_pos(v2_c.pos), true); + view_set_mark (app, &view1, seek_pos(v2_m.pos)); + view_set_scroll(app, &view1, v2_r); + view_set_cursor(app, &view2, seek_pos(v1_c.pos), true); + view_set_mark (app, &view2, seek_pos(v1_m.pos)); + view_set_scroll(app, &view2, v1_r); + } } } diff --git a/4coder_casey.cpp b/4coder_casey.cpp index 38c4e487..9a88169f 100644 --- a/4coder_casey.cpp +++ b/4coder_casey.cpp @@ -123,6 +123,8 @@ static char *GlobalCompilationBufferName = "*compilation*"; // TODO(casey): If 4coder gets variables at some point, this would go in a variable. static char BuildDirectory[4096] = "./"; +#define ZeroStruct(a) memset(&(a), 0, sizeof(a)) + enum token_type { Token_Unknown, @@ -336,6 +338,14 @@ IsINL(String extension) return(Result); } +inline bool +IsJavascript(String extension) +{ + bool Result = (match(extension, make_lit_string("js")) != 0); + + return(Result); +} + inline bool IsBAT(String extension) { @@ -376,10 +386,18 @@ IsOutline(String extension) return(Result); } +inline bool +IsMollyWebMarkup(String extension) +{ + bool Result = (match(extension, make_lit_string("mwm")) != 0); + + return(Result); +} + inline bool IsCode(String extension) { - bool Result = (IsBee(extension) || IsH(extension) || IsCPP(extension) || IsINL(extension) || IsBAT(extension) || IsCMirror(extension) || IsShader(extension) || IsMTD(extension)); + bool Result = (IsJavascript(extension) || IsBee(extension) || IsH(extension) || IsCPP(extension) || IsINL(extension) || IsBAT(extension) || IsCMirror(extension) || IsShader(extension) || IsMTD(extension)); return(Result); } @@ -387,7 +405,7 @@ IsCode(String extension) inline bool IsDoc(String extension) { - bool Result = (IsTXT(extension)); + bool Result = (IsTXT(extension) || IsOutline(extension) || IsMollyWebMarkup(extension)); return(Result); } @@ -715,6 +733,7 @@ CUSTOM_COMMAND_SIG(casey_save_and_make_without_asking) { exec_command(app, change_active_panel); +#if 0 Buffer_Summary buffer = {}; unsigned int access = AccessAll; @@ -724,6 +743,8 @@ CUSTOM_COMMAND_SIG(casey_save_and_make_without_asking) { save_buffer(app, &buffer, buffer.file_name, buffer.file_name_len, 0); } +#endif + save_all_dirty_buffers(app); // NOTE(allen): The parameter pushing made it a little easier // to deal with this particular pattern where two similar strings @@ -760,7 +781,7 @@ CUSTOM_COMMAND_SIG(casey_save_and_make_without_asking) } exec_command(app, change_active_panel); - prev_location = null_location; + ZeroStruct(prev_location); } #if 1 @@ -910,6 +931,8 @@ ParseConstant(tokenizer *Tokenizer) return(Result); } +#pragma warning(disable:4456) + internal calc_node * ParseMultiplyExpression(tokenizer *Tokenizer) { @@ -975,7 +998,7 @@ CUSTOM_COMMAND_SIG(casey_quick_calc) unsigned int access = AccessOpen; View_Summary view = get_active_view(app, access); - Range range = get_range(&view); + Range range = get_view_range(&view); size_t Size = range.max - range.min; char *Stuff = (char *)malloc(Size + 1); @@ -1074,7 +1097,7 @@ OpenProject(Application_Links *app, char *Contents) { String filename = make_string(info->filename, info->filename_len); String extension = file_extension(filename); - if (IsCode(extension)) + if (IsCode(extension) || IsDoc(extension)) { // NOTE(allen): There's no way in the 4coder API to use relative // paths at the moment, so everything should be full paths. Which is @@ -1806,7 +1829,7 @@ START_HOOK_SIG(casey_start) exec_command(app, change_active_panel); change_theme(app, literal("Handmade Hero")); - change_font(app, literal("Droid Sans Mono"), true); + set_global_face_by_name(app, literal("Droid Sans Mono"), true); UpdateModalIndicator(app); return(0); diff --git a/4coder_config.cpp b/4coder_config.cpp index b80825a6..00902f11 100644 --- a/4coder_config.cpp +++ b/4coder_config.cpp @@ -680,166 +680,181 @@ typed_array_reference_list(Partition *arena, Config *parsed, Config_Compound *co static bool32 config_has_var(Config *config, String var_name, int32_t subscript){ Config_Get_Result result = config_var(config, var_name, subscript); - return(result.success); + bool32 success = result.success && result.type == ConfigRValueType_NoType; + return(success); } static bool32 config_has_var(Config *config, char *var_name, int32_t subscript){ String var_name_str = make_string_slowly(var_name); Config_Get_Result result = config_var(config, var_name_str, subscript); - return(result.success); + bool32 success = result.success && result.type == ConfigRValueType_NoType; + return(success); } static bool32 config_bool_var(Config *config, String var_name, int32_t subscript, bool32* var_out){ Config_Get_Result result = config_var(config, var_name, subscript); - if (result.success){ + bool32 success = result.success && result.type == ConfigRValueType_Boolean; + if (success){ *var_out = result.boolean; } - return(result.success); + return(success); } static bool32 config_bool_var(Config *config, char *var_name, int32_t subscript, bool32* var_out){ String var_name_str = make_string_slowly(var_name); Config_Get_Result result = config_var(config, var_name_str, subscript); - if (result.success){ + bool32 success = result.success && result.type == ConfigRValueType_Boolean; + if (success){ *var_out = result.boolean; } - return(result.success); + return(success); } static bool32 config_int_var(Config *config, String var_name, int32_t subscript, int32_t* var_out){ Config_Get_Result result = config_var(config, var_name, subscript); - if (result.success){ + bool32 success = result.success && result.type == ConfigRValueType_Integer; + if (success){ *var_out = result.integer; } - return(result.success); + return(success); } static bool32 config_int_var(Config *config, char *var_name, int32_t subscript, int32_t* var_out){ String var_name_str = make_string_slowly(var_name); Config_Get_Result result = config_var(config, var_name_str, subscript); - if (result.success){ + bool32 success = result.success && result.type == ConfigRValueType_Integer; + if (success){ *var_out = result.integer; } - return(result.success); + return(success); } static bool32 config_uint_var(Config *config, String var_name, int32_t subscript, uint32_t* var_out){ Config_Get_Result result = config_var(config, var_name, subscript); - if (result.success){ + bool32 success = result.success && result.type == ConfigRValueType_Integer; + if (success){ *var_out = result.uinteger; } - return(result.success); + return(success); } static bool32 config_uint_var(Config *config, char *var_name, int32_t subscript, uint32_t* var_out){ String var_name_str = make_string_slowly(var_name); Config_Get_Result result = config_var(config, var_name_str, subscript); - if (result.success){ + bool32 success = result.success && result.type == ConfigRValueType_Integer; + if (success){ *var_out = result.uinteger; } - return(result.success); + return(success); } static bool32 config_string_var(Config *config, String var_name, int32_t subscript, String* var_out){ Config_Get_Result result = config_var(config, var_name, subscript); - if (result.success){ + bool32 success = result.success && result.type == ConfigRValueType_String; + if (success){ *var_out = result.string; } - return(result.success); + return(success); } static bool32 config_string_var(Config *config, char *var_name, int32_t subscript, String* var_out){ String var_name_str = make_string_slowly(var_name); Config_Get_Result result = config_var(config, var_name_str, subscript); - if (result.success){ + bool32 success = result.success && result.type == ConfigRValueType_String; + if (success){ *var_out = result.string; } - return(result.success); + return(success); } static bool32 config_placed_string_var(Config *config, String var_name, int32_t subscript, String* var_out, char *space, int32_t space_size){ Config_Get_Result result = config_var(config, var_name, subscript); - if (result.success){ + bool32 success = result.success && result.type == ConfigRValueType_String; + if (success){ *var_out = result.string; } - bool32 success = result.success; if (success){ String str = *var_out; *var_out = make_string_cap(space, 0, space_size); copy(var_out, str); } - return(result.success); + return(success); } static bool32 config_placed_string_var(Config *config, char *var_name, int32_t subscript, String* var_out, char *space, int32_t space_size){ String var_name_str = make_string_slowly(var_name); Config_Get_Result result = config_var(config, var_name_str, subscript); - if (result.success){ + bool32 success = result.success && result.type == ConfigRValueType_String; + if (success){ *var_out = result.string; } - bool32 success = result.success; if (success){ String str = *var_out; *var_out = make_string_cap(space, 0, space_size); copy(var_out, str); } - return(result.success); + return(success); } static bool32 config_char_var(Config *config, String var_name, int32_t subscript, char* var_out){ Config_Get_Result result = config_var(config, var_name, subscript); - if (result.success){ + bool32 success = result.success && result.type == ConfigRValueType_Character; + if (success){ *var_out = result.character; } - return(result.success); + return(success); } static bool32 config_char_var(Config *config, char *var_name, int32_t subscript, char* var_out){ String var_name_str = make_string_slowly(var_name); Config_Get_Result result = config_var(config, var_name_str, subscript); - if (result.success){ + bool32 success = result.success && result.type == ConfigRValueType_Character; + if (success){ *var_out = result.character; } - return(result.success); + return(success); } static bool32 config_compound_var(Config *config, String var_name, int32_t subscript, Config_Compound** var_out){ Config_Get_Result result = config_var(config, var_name, subscript); - if (result.success){ + bool32 success = result.success && result.type == ConfigRValueType_Compound; + if (success){ *var_out = result.compound; } - return(result.success); + return(success); } static bool32 config_compound_var(Config *config, char *var_name, int32_t subscript, Config_Compound** var_out){ String var_name_str = make_string_slowly(var_name); Config_Get_Result result = config_var(config, var_name_str, subscript); - if (result.success){ + bool32 success = result.success && result.type == ConfigRValueType_Compound; + if (success){ *var_out = result.compound; } - return(result.success); + return(success); } static bool32 config_compound_has_member(Config *config, Config_Compound *compound, String var_name, int32_t index){ Config_Get_Result result = config_compound_member(config, compound, var_name, index); - return(result.success); + bool32 success = result.success && result.type == ConfigRValueType_NoType; + return(success); } static bool32 @@ -847,17 +862,19 @@ config_compound_has_member(Config *config, Config_Compound *compound, char *var_name, int32_t index){ String var_name_str = make_string_slowly(var_name); Config_Get_Result result = config_compound_member(config, compound, var_name_str, index); - return(result.success); + bool32 success = result.success && result.type == ConfigRValueType_NoType; + return(success); } static bool32 config_compound_bool_member(Config *config, Config_Compound *compound, String var_name, int32_t index, bool32* var_out){ Config_Get_Result result = config_compound_member(config, compound, var_name, index); - if (result.success){ + bool32 success = result.success && result.type == ConfigRValueType_Boolean; + if (success){ *var_out = result.boolean; } - return(result.success); + return(success); } static bool32 @@ -865,20 +882,22 @@ config_compound_bool_member(Config *config, Config_Compound *compound, char *var_name, int32_t index, bool32* var_out){ String var_name_str = make_string_slowly(var_name); Config_Get_Result result = config_compound_member(config, compound, var_name_str, index); - if (result.success){ + bool32 success = result.success && result.type == ConfigRValueType_Boolean; + if (success){ *var_out = result.boolean; } - return(result.success); + return(success); } static bool32 config_compound_int_member(Config *config, Config_Compound *compound, String var_name, int32_t index, int32_t* var_out){ Config_Get_Result result = config_compound_member(config, compound, var_name, index); - if (result.success){ + bool32 success = result.success && result.type == ConfigRValueType_Integer; + if (success){ *var_out = result.integer; } - return(result.success); + return(success); } static bool32 @@ -886,20 +905,22 @@ config_compound_int_member(Config *config, Config_Compound *compound, char *var_name, int32_t index, int32_t* var_out){ String var_name_str = make_string_slowly(var_name); Config_Get_Result result = config_compound_member(config, compound, var_name_str, index); - if (result.success){ + bool32 success = result.success && result.type == ConfigRValueType_Integer; + if (success){ *var_out = result.integer; } - return(result.success); + return(success); } static bool32 config_compound_uint_member(Config *config, Config_Compound *compound, String var_name, int32_t index, uint32_t* var_out){ Config_Get_Result result = config_compound_member(config, compound, var_name, index); - if (result.success){ + bool32 success = result.success && result.type == ConfigRValueType_Integer; + if (success){ *var_out = result.uinteger; } - return(result.success); + return(success); } static bool32 @@ -907,20 +928,22 @@ config_compound_uint_member(Config *config, Config_Compound *compound, char *var_name, int32_t index, uint32_t* var_out){ String var_name_str = make_string_slowly(var_name); Config_Get_Result result = config_compound_member(config, compound, var_name_str, index); - if (result.success){ + bool32 success = result.success && result.type == ConfigRValueType_Integer; + if (success){ *var_out = result.uinteger; } - return(result.success); + return(success); } static bool32 config_compound_string_member(Config *config, Config_Compound *compound, String var_name, int32_t index, String* var_out){ Config_Get_Result result = config_compound_member(config, compound, var_name, index); - if (result.success){ + bool32 success = result.success && result.type == ConfigRValueType_String; + if (success){ *var_out = result.string; } - return(result.success); + return(success); } static bool32 @@ -928,26 +951,27 @@ config_compound_string_member(Config *config, Config_Compound *compound, char *var_name, int32_t index, String* var_out){ String var_name_str = make_string_slowly(var_name); Config_Get_Result result = config_compound_member(config, compound, var_name_str, index); - if (result.success){ + bool32 success = result.success && result.type == ConfigRValueType_String; + if (success){ *var_out = result.string; } - return(result.success); + return(success); } static bool32 config_compound_placed_string_member(Config *config, Config_Compound *compound, String var_name, int32_t index, String* var_out, char *space, int32_t space_size){ Config_Get_Result result = config_compound_member(config, compound, var_name, index); - if (result.success){ + bool32 success = result.success && result.type == ConfigRValueType_String; + if (success){ *var_out = result.string; } - bool32 success = result.success; if (success){ String str = *var_out; *var_out = make_string_cap(space, 0, space_size); copy(var_out, str); } - return(result.success); + return(success); } static bool32 @@ -955,26 +979,27 @@ config_compound_placed_string_member(Config *config, Config_Compound *compound, char *var_name, int32_t index, String* var_out, char *space, int32_t space_size){ String var_name_str = make_string_slowly(var_name); Config_Get_Result result = config_compound_member(config, compound, var_name_str, index); - if (result.success){ + bool32 success = result.success && result.type == ConfigRValueType_String; + if (success){ *var_out = result.string; } - bool32 success = result.success; if (success){ String str = *var_out; *var_out = make_string_cap(space, 0, space_size); copy(var_out, str); } - return(result.success); + return(success); } static bool32 config_compound_char_member(Config *config, Config_Compound *compound, String var_name, int32_t index, char* var_out){ Config_Get_Result result = config_compound_member(config, compound, var_name, index); - if (result.success){ + bool32 success = result.success && result.type == ConfigRValueType_Character; + if (success){ *var_out = result.character; } - return(result.success); + return(success); } static bool32 @@ -982,20 +1007,22 @@ config_compound_char_member(Config *config, Config_Compound *compound, char *var_name, int32_t index, char* var_out){ String var_name_str = make_string_slowly(var_name); Config_Get_Result result = config_compound_member(config, compound, var_name_str, index); - if (result.success){ + bool32 success = result.success && result.type == ConfigRValueType_Character; + if (success){ *var_out = result.character; } - return(result.success); + return(success); } static bool32 config_compound_compound_member(Config *config, Config_Compound *compound, String var_name, int32_t index, Config_Compound** var_out){ Config_Get_Result result = config_compound_member(config, compound, var_name, index); - if (result.success){ + bool32 success = result.success && result.type == ConfigRValueType_Compound; + if (success){ *var_out = result.compound; } - return(result.success); + return(success); } static bool32 @@ -1003,10 +1030,11 @@ config_compound_compound_member(Config *config, Config_Compound *compound, char *var_name, int32_t index, Config_Compound** var_out){ String var_name_str = make_string_slowly(var_name); Config_Get_Result result = config_compound_member(config, compound, var_name_str, index); - if (result.success){ + bool32 success = result.success && result.type == ConfigRValueType_Compound; + if (success){ *var_out = result.compound; } - return(result.success); + return(success); } static Iteration_Step_Result @@ -1302,6 +1330,7 @@ config_init_default(Config_Data *config){ config->use_scroll_bars = false; config->use_file_bars = true; + config->enable_virtual_whitespace = true; config->enable_code_wrapping = true; config->automatically_adjust_wrapping = true; config->automatically_indent_text_on_save = true; @@ -1360,6 +1389,7 @@ config_parse__data(Partition *arena, String file_name, String data, Config_Data config_bool_var(parsed, "use_scroll_bars", 0, &config->use_scroll_bars); config_bool_var(parsed, "use_file_bars", 0, &config->use_file_bars); + config_bool_var(parsed, "enable_virtual_whitespace", 0, &config->enable_virtual_whitespace); config_bool_var(parsed, "enable_code_wrapping", 0, &config->enable_code_wrapping); config_bool_var(parsed, "automatically_adjust_wrapping", 0, &config->automatically_adjust_wrapping); config_bool_var(parsed, "automatically_indent_text_on_save", 0, &config->automatically_indent_text_on_save); @@ -1569,6 +1599,7 @@ load_config_and_apply(Application_Links *app, Partition *scratch, Config_Data *c config_feedback_bool(&space, "use_scroll_bars", config->use_scroll_bars); config_feedback_bool(&space, "use_file_bars", config->use_file_bars); + config_feedback_bool(&space, "enable_virtual_whitespace", config->enable_virtual_whitespace); config_feedback_bool(&space, "enable_code_wrapping", config->enable_code_wrapping); config_feedback_bool(&space, "automatically_indent_text_on_save", config->automatically_indent_text_on_save); config_feedback_bool(&space, "automatically_save_changes_on_build", config->automatically_save_changes_on_build); diff --git a/4coder_config.h b/4coder_config.h index abfa5209..e8df2664 100644 --- a/4coder_config.h +++ b/4coder_config.h @@ -201,6 +201,7 @@ struct Config_Data{ bool32 use_scroll_bars; bool32 use_file_bars; + bool32 enable_virtual_whitespace; bool32 enable_code_wrapping; bool32 automatically_indent_text_on_save; bool32 automatically_save_changes_on_build; diff --git a/4coder_default_framework.cpp b/4coder_default_framework.cpp index 218764da..0e9427b7 100644 --- a/4coder_default_framework.cpp +++ b/4coder_default_framework.cpp @@ -8,37 +8,6 @@ static Partition global_part; static General_Memory global_general; - -#if !defined(AUTO_CENTER_AFTER_JUMPS) -#define AUTO_CENTER_AFTER_JUMPS true -#endif -static bool32 auto_center_after_jumps = AUTO_CENTER_AFTER_JUMPS; -static char locked_buffer_space[256]; -static String locked_buffer = make_fixed_width_string(locked_buffer_space); - - -static View_ID special_note_view_id = 0; - - -View_Paste_Index view_paste_index_[16]; -View_Paste_Index *view_paste_index = view_paste_index_ - 1; - - -static char out_buffer_space[1024]; -static char command_space[1024]; -static char hot_directory_space[1024]; - - -static bool32 suppressing_mouse = false; - - -static ID_Based_Jump_Location prev_location = {0}; - - -static Config_Data global_config = {0}; - -//////////////////////////////// - static void unlock_jump_buffer(void){ locked_buffer.size = 0; @@ -230,7 +199,7 @@ CUSTOM_DOC("Switch to a named key binding map.") //////////////////////////////// static void -init_memory(Application_Links *app){ +default_4coder_initialize(Application_Links *app, int32_t override_font_size, bool32 override_hinting){ int32_t part_size = (32 << 20); int32_t general_size = (4 << 20); @@ -239,11 +208,6 @@ init_memory(Application_Links *app){ void *general_mem = memory_allocate(app, general_size); general_memory_open(&global_general, general_mem, general_size); -} - -static void -default_4coder_initialize(Application_Links *app, int32_t override_font_size, bool32 override_hinting){ - init_memory(app); static const char message[] = "" "Welcome to " VERSION "\n" @@ -260,11 +224,9 @@ default_4coder_initialize(Application_Links *app, int32_t override_font_size, bo } static void -default_4coder_initialize(Application_Links *app, int32_t override_font_size, bool32 override_hinting, - bool32 use_scroll_bars, bool32 use_file_bars){ - default_4coder_initialize(app, override_font_size, override_hinting); - global_config.use_scroll_bars = use_scroll_bars; - global_config.use_file_bars = use_file_bars; +default_4coder_initialize(Application_Links *app){ + Face_Description command_line_description = get_face_description(app, 0); + default_4coder_initialize(app, command_line_description.pt_size, command_line_description.hinting); } static void diff --git a/4coder_default_framework_variables.cpp b/4coder_default_framework_variables.cpp index 9ea829e9..44d544d4 100644 --- a/4coder_default_framework_variables.cpp +++ b/4coder_default_framework_variables.cpp @@ -17,4 +17,32 @@ static char *default_extensions[] = { "cs", }; +#if !defined(AUTO_CENTER_AFTER_JUMPS) +#define AUTO_CENTER_AFTER_JUMPS true +#endif +static bool32 auto_center_after_jumps = AUTO_CENTER_AFTER_JUMPS; +static char locked_buffer_space[256]; +static String locked_buffer = make_fixed_width_string(locked_buffer_space); + + +static View_ID special_note_view_id = 0; + + +View_Paste_Index view_paste_index_[16]; +View_Paste_Index *view_paste_index = view_paste_index_ - 1; + + +static char out_buffer_space[1024]; +static char command_space[1024]; +static char hot_directory_space[1024]; + + +static bool32 suppressing_mouse = false; + + +static ID_Based_Jump_Location prev_location = {0}; + + +static Config_Data global_config = {0}; + // BOTTOM \ No newline at end of file diff --git a/4coder_default_hooks.cpp b/4coder_default_hooks.cpp index defca9be..82af7d2e 100644 --- a/4coder_default_hooks.cpp +++ b/4coder_default_hooks.cpp @@ -23,8 +23,7 @@ START_HOOK_SIG(default_start){ named_maps = named_maps_values; named_map_count = ArrayCount(named_maps_values); - Face_Description command_line_description = get_face_description(app, 0); - default_4coder_initialize(app, command_line_description.pt_size, command_line_description.hinting); + default_4coder_initialize(app); default_4coder_side_by_side_panels(app, files, file_count); if (global_config.automatically_load_project){ @@ -274,10 +273,8 @@ OPEN_FILE_HOOK_SIG(default_file_settings){ int32_t map_id = (treat_as_code)?((int32_t)default_code_map):((int32_t)mapid_file); - buffer_set_setting(app, &buffer, BufferSetting_WrapPosition, - global_config.default_wrap_width); - buffer_set_setting(app, &buffer, BufferSetting_MinimumBaseWrapPosition, - global_config.default_min_base_width); + buffer_set_setting(app, &buffer, BufferSetting_WrapPosition, global_config.default_wrap_width); + buffer_set_setting(app, &buffer, BufferSetting_MinimumBaseWrapPosition, global_config.default_min_base_width); buffer_set_setting(app, &buffer, BufferSetting_MapID, map_id); buffer_set_setting(app, &buffer, BufferSetting_ParserContext, parse_context_id); @@ -286,18 +283,29 @@ OPEN_FILE_HOOK_SIG(default_file_settings){ buffer_set_setting(app, &buffer, BufferSetting_LexWithoutStrings, true); buffer_set_setting(app, &buffer, BufferSetting_VirtualWhitespace, true); } - else if (treat_as_code && global_config.enable_code_wrapping && buffer.size < (128 << 10)){ - // NOTE(allen|a4.0.12): There is a little bit of grossness going on here. - // If we set BufferSetting_Lex to true, it will launch a lexing job. - // If a lexing job is active when we set BufferSetting_VirtualWhitespace, the call can fail. - // Unfortunantely without tokens virtual whitespace doesn't really make sense. - // So for now I have it automatically turning on lexing when virtual whitespace is turned on. - // Cleaning some of that up is a goal for future versions. - if (lex_without_strings){ - buffer_set_setting(app, &buffer, BufferSetting_LexWithoutStrings, true); + else if (treat_as_code && buffer.size < (128 << 10)){ + if (global_config.enable_virtual_whitespace){ + // NOTE(allen|a4.0.12): There is a little bit of grossness going on here. + // If we set BufferSetting_Lex to true, it will launch a lexing job. + // If a lexing job is active when we set BufferSetting_VirtualWhitespace, the call can fail. + // Unfortunantely without tokens virtual whitespace doesn't really make sense. + // So for now I have it automatically turning on lexing when virtual whitespace is turned on. + // Cleaning some of that up is a goal for future versions. + if (lex_without_strings){ + buffer_set_setting(app, &buffer, BufferSetting_LexWithoutStrings, true); + } + if (global_config.enable_code_wrapping){ + buffer_set_setting(app, &buffer, BufferSetting_WrapLine, true); + } + buffer_set_setting(app, &buffer, BufferSetting_VirtualWhitespace, true); + } + else if (global_config.enable_code_wrapping){ + if (lex_without_strings){ + buffer_set_setting(app, &buffer, BufferSetting_LexWithoutStrings, true); + } + buffer_set_setting(app, &buffer, BufferSetting_Lex, true); + buffer_set_setting(app, &buffer, BufferSetting_WrapLine, true); } - buffer_set_setting(app, &buffer, BufferSetting_WrapLine, true); - buffer_set_setting(app, &buffer, BufferSetting_VirtualWhitespace, true); } else{ buffer_set_setting(app, &buffer, BufferSetting_WrapLine, wrap_lines); @@ -459,11 +467,7 @@ set_all_default_hooks(Bind_Helper *context){ set_new_file_hook(context, default_new_file); set_save_file_hook(context, default_file_save); -#if defined(FCODER_STICKY_JUMP) set_end_file_hook(context, end_file_close_jump_list); -#else - set_end_file_hook(context, default_end_file); -#endif set_command_caller(context, default_command_caller); set_input_filter(context, default_suppress_mouse_filter); diff --git a/4coder_experiments.cpp b/4coder_experiments.cpp index 45b821b7..80b20d4b 100644 --- a/4coder_experiments.cpp +++ b/4coder_experiments.cpp @@ -792,31 +792,6 @@ CUSTOM_DOC("Queries the user for two strings, and replaces all occurrences of th replace_all_occurrences_parameters(app, &global_general, &global_part, r, w); } -// -// Self training to stop typing Ctrl+S -// - -CUSTOM_COMMAND_SIG(punishment){ - Theme_Color colors[4]; - colors[0].tag = Stag_Back; - colors[1].tag = Stag_Margin; - colors[2].tag = Stag_Margin_Hover; - colors[3].tag = Stag_Margin_Active; - get_theme_colors(app, colors, 4); - - for (uint32_t i = 0; i < 4; ++i){ - int_color color = colors[i].color; - uint8_t *c = (uint8_t*)(&color); - c[0] = 0xFF - c[0]; - c[1] = 0xFF - c[1]; - c[2] = 0xFF - c[2]; - c[3] = 0xFF - c[3]; - colors[i].color = color; - } - - set_theme_colors(app, colors, 4); -} - extern "C" int32_t get_bindings(void *data, int32_t size){ Bind_Helper context_ = begin_bind_helper(data, size); @@ -844,9 +819,6 @@ get_bindings(void *data, int32_t size){ // begin_map to clear everything that was in the map and // bind new things instead. begin_map(context, mapid_file); - bind(context, 's', MDFR_CTRL, punishment); - bind(context, 's', MDFR_ALT, save); - bind(context, 'k', MDFR_ALT, kill_rect); bind(context, ' ', MDFR_ALT | MDFR_CTRL, multi_line_edit); @@ -858,7 +830,6 @@ get_bindings(void *data, int32_t size){ bind(context, 'b', MDFR_CTRL, multi_paste_interactive_quick); bind(context, 'A', MDFR_CTRL, replace_all_occurrences); - end_map(context); begin_map(context, default_code_map); diff --git a/4coder_generated/command_metadata.h b/4coder_generated/command_metadata.h deleted file mode 100644 index c79f766a..00000000 --- a/4coder_generated/command_metadata.h +++ /dev/null @@ -1,611 +0,0 @@ -#define command_id(c) (fcoder_metacmd_ID_##c) -#define command_metadata(c) (&fcoder_metacmd_table[command_id(c)]) -#define command_metadata_by_id(id) (&fcoder_metacmd_table[id]) -#define command_one_past_last_id 196 -#if defined(CUSTOM_COMMAND_SIG) -#define PROC_LINKS(x,y) x -#else -#define PROC_LINKS(x,y) y -#endif -#if defined(CUSTOM_COMMAND_SIG) -CUSTOM_COMMAND_SIG(allow_mouse); -CUSTOM_COMMAND_SIG(auto_tab_line_at_cursor); -CUSTOM_COMMAND_SIG(auto_tab_range); -CUSTOM_COMMAND_SIG(auto_tab_whole_file); -CUSTOM_COMMAND_SIG(backspace_char); -CUSTOM_COMMAND_SIG(backspace_word); -CUSTOM_COMMAND_SIG(basic_change_active_panel); -CUSTOM_COMMAND_SIG(build_in_build_panel); -CUSTOM_COMMAND_SIG(build_search); -CUSTOM_COMMAND_SIG(center_view); -CUSTOM_COMMAND_SIG(change_active_panel); -CUSTOM_COMMAND_SIG(change_active_panel_backwards); -CUSTOM_COMMAND_SIG(change_to_build_panel); -CUSTOM_COMMAND_SIG(clean_all_lines); -CUSTOM_COMMAND_SIG(click_set_cursor); -CUSTOM_COMMAND_SIG(click_set_mark); -CUSTOM_COMMAND_SIG(close_all_code); -CUSTOM_COMMAND_SIG(close_build_panel); -CUSTOM_COMMAND_SIG(close_panel); -CUSTOM_COMMAND_SIG(copy); -CUSTOM_COMMAND_SIG(cursor_mark_swap); -CUSTOM_COMMAND_SIG(cut); -CUSTOM_COMMAND_SIG(decrease_face_size); -CUSTOM_COMMAND_SIG(decrease_line_wrap); -CUSTOM_COMMAND_SIG(delete_char); -CUSTOM_COMMAND_SIG(delete_current_scope); -CUSTOM_COMMAND_SIG(delete_file_query); -CUSTOM_COMMAND_SIG(delete_line); -CUSTOM_COMMAND_SIG(delete_range); -CUSTOM_COMMAND_SIG(delete_word); -CUSTOM_COMMAND_SIG(duplicate_line); -CUSTOM_COMMAND_SIG(eol_dosify); -CUSTOM_COMMAND_SIG(eol_nixify); -CUSTOM_COMMAND_SIG(execute_any_cli); -CUSTOM_COMMAND_SIG(execute_arbitrary_command); -CUSTOM_COMMAND_SIG(execute_previous_cli); -CUSTOM_COMMAND_SIG(exit_4coder); -CUSTOM_COMMAND_SIG(goto_beginning_of_file); -CUSTOM_COMMAND_SIG(goto_end_of_file); -CUSTOM_COMMAND_SIG(goto_first_jump_direct); -CUSTOM_COMMAND_SIG(goto_first_jump_same_panel_sticky); -CUSTOM_COMMAND_SIG(goto_first_jump_sticky); -CUSTOM_COMMAND_SIG(goto_jump_at_cursor_direct); -CUSTOM_COMMAND_SIG(goto_jump_at_cursor_same_panel_direct); -CUSTOM_COMMAND_SIG(goto_jump_at_cursor_same_panel_sticky); -CUSTOM_COMMAND_SIG(goto_jump_at_cursor_sticky); -CUSTOM_COMMAND_SIG(goto_line); -CUSTOM_COMMAND_SIG(goto_next_jump_direct); -CUSTOM_COMMAND_SIG(goto_next_jump_no_skips_direct); -CUSTOM_COMMAND_SIG(goto_next_jump_no_skips_sticky); -CUSTOM_COMMAND_SIG(goto_next_jump_sticky); -CUSTOM_COMMAND_SIG(goto_prev_jump_direct); -CUSTOM_COMMAND_SIG(goto_prev_jump_no_skips_direct); -CUSTOM_COMMAND_SIG(goto_prev_jump_no_skips_sticky); -CUSTOM_COMMAND_SIG(goto_prev_jump_sticky); -CUSTOM_COMMAND_SIG(hide_filebar); -CUSTOM_COMMAND_SIG(hide_scrollbar); -CUSTOM_COMMAND_SIG(highlight_next_scope_absolute); -CUSTOM_COMMAND_SIG(highlight_prev_scope_absolute); -CUSTOM_COMMAND_SIG(highlight_surrounding_scope); -CUSTOM_COMMAND_SIG(if0_off); -CUSTOM_COMMAND_SIG(increase_face_size); -CUSTOM_COMMAND_SIG(increase_line_wrap); -CUSTOM_COMMAND_SIG(interactive_kill_buffer); -CUSTOM_COMMAND_SIG(interactive_new); -CUSTOM_COMMAND_SIG(interactive_open); -CUSTOM_COMMAND_SIG(interactive_open_or_new); -CUSTOM_COMMAND_SIG(interactive_switch_buffer); -CUSTOM_COMMAND_SIG(kill_buffer); -CUSTOM_COMMAND_SIG(kill_rect); -CUSTOM_COMMAND_SIG(left_adjust_view); -CUSTOM_COMMAND_SIG(list_all_functions_current_buffer); -CUSTOM_COMMAND_SIG(list_all_locations); -CUSTOM_COMMAND_SIG(list_all_locations_case_insensitive); -CUSTOM_COMMAND_SIG(list_all_locations_of_identifier); -CUSTOM_COMMAND_SIG(list_all_locations_of_identifier_case_insensitive); -CUSTOM_COMMAND_SIG(list_all_locations_of_selection); -CUSTOM_COMMAND_SIG(list_all_locations_of_selection_case_insensitive); -CUSTOM_COMMAND_SIG(list_all_locations_of_type_definition); -CUSTOM_COMMAND_SIG(list_all_locations_of_type_definition_of_identifier); -CUSTOM_COMMAND_SIG(list_all_substring_locations); -CUSTOM_COMMAND_SIG(list_all_substring_locations_case_insensitive); -CUSTOM_COMMAND_SIG(load_project); -CUSTOM_COMMAND_SIG(make_directory_query); -CUSTOM_COMMAND_SIG(miblo_decrement_basic); -CUSTOM_COMMAND_SIG(miblo_decrement_time_stamp); -CUSTOM_COMMAND_SIG(miblo_decrement_time_stamp_minute); -CUSTOM_COMMAND_SIG(miblo_increment_basic); -CUSTOM_COMMAND_SIG(miblo_increment_time_stamp); -CUSTOM_COMMAND_SIG(miblo_increment_time_stamp_minute); -CUSTOM_COMMAND_SIG(move_down); -CUSTOM_COMMAND_SIG(move_down_10); -CUSTOM_COMMAND_SIG(move_down_textual); -CUSTOM_COMMAND_SIG(move_left); -CUSTOM_COMMAND_SIG(move_line_down); -CUSTOM_COMMAND_SIG(move_line_up); -CUSTOM_COMMAND_SIG(move_right); -CUSTOM_COMMAND_SIG(move_up); -CUSTOM_COMMAND_SIG(move_up_10); -CUSTOM_COMMAND_SIG(multi_line_edit); -CUSTOM_COMMAND_SIG(newline_or_goto_position_direct); -CUSTOM_COMMAND_SIG(newline_or_goto_position_same_panel_direct); -CUSTOM_COMMAND_SIG(newline_or_goto_position_same_panel_sticky); -CUSTOM_COMMAND_SIG(newline_or_goto_position_sticky); -CUSTOM_COMMAND_SIG(open_all_code); -CUSTOM_COMMAND_SIG(open_all_code_recursive); -CUSTOM_COMMAND_SIG(open_color_tweaker); -CUSTOM_COMMAND_SIG(open_file_in_quotes); -CUSTOM_COMMAND_SIG(open_in_other); -CUSTOM_COMMAND_SIG(open_long_braces); -CUSTOM_COMMAND_SIG(open_long_braces_break); -CUSTOM_COMMAND_SIG(open_long_braces_semicolon); -CUSTOM_COMMAND_SIG(open_matching_file_cpp); -CUSTOM_COMMAND_SIG(open_panel_hsplit); -CUSTOM_COMMAND_SIG(open_panel_vsplit); -CUSTOM_COMMAND_SIG(page_down); -CUSTOM_COMMAND_SIG(page_up); -CUSTOM_COMMAND_SIG(paste); -CUSTOM_COMMAND_SIG(paste_and_indent); -CUSTOM_COMMAND_SIG(paste_next); -CUSTOM_COMMAND_SIG(paste_next_and_indent); -CUSTOM_COMMAND_SIG(place_in_scope); -CUSTOM_COMMAND_SIG(project_fkey_command); -CUSTOM_COMMAND_SIG(project_go_to_root_directory); -CUSTOM_COMMAND_SIG(query_replace); -CUSTOM_COMMAND_SIG(query_replace_identifier); -CUSTOM_COMMAND_SIG(query_replace_selection); -CUSTOM_COMMAND_SIG(redo); -CUSTOM_COMMAND_SIG(remap_interactive); -CUSTOM_COMMAND_SIG(rename_file_query); -CUSTOM_COMMAND_SIG(rename_parameter); -CUSTOM_COMMAND_SIG(reopen); -CUSTOM_COMMAND_SIG(replace_all_occurrences); -CUSTOM_COMMAND_SIG(replace_in_range); -CUSTOM_COMMAND_SIG(reverse_search); -CUSTOM_COMMAND_SIG(reverse_search_identifier); -CUSTOM_COMMAND_SIG(save); -CUSTOM_COMMAND_SIG(save_all_dirty_buffers); -CUSTOM_COMMAND_SIG(save_to_query); -CUSTOM_COMMAND_SIG(scope_absorb_down); -CUSTOM_COMMAND_SIG(search); -CUSTOM_COMMAND_SIG(search_identifier); -CUSTOM_COMMAND_SIG(seek_alphanumeric_left); -CUSTOM_COMMAND_SIG(seek_alphanumeric_or_camel_left); -CUSTOM_COMMAND_SIG(seek_alphanumeric_or_camel_right); -CUSTOM_COMMAND_SIG(seek_alphanumeric_right); -CUSTOM_COMMAND_SIG(seek_beginning_of_line); -CUSTOM_COMMAND_SIG(seek_beginning_of_textual_line); -CUSTOM_COMMAND_SIG(seek_end_of_line); -CUSTOM_COMMAND_SIG(seek_end_of_textual_line); -CUSTOM_COMMAND_SIG(seek_token_left); -CUSTOM_COMMAND_SIG(seek_token_right); -CUSTOM_COMMAND_SIG(seek_white_or_token_left); -CUSTOM_COMMAND_SIG(seek_white_or_token_right); -CUSTOM_COMMAND_SIG(seek_whitespace_down); -CUSTOM_COMMAND_SIG(seek_whitespace_down_end_line); -CUSTOM_COMMAND_SIG(seek_whitespace_left); -CUSTOM_COMMAND_SIG(seek_whitespace_right); -CUSTOM_COMMAND_SIG(seek_whitespace_up); -CUSTOM_COMMAND_SIG(seek_whitespace_up_end_line); -CUSTOM_COMMAND_SIG(select_all); -CUSTOM_COMMAND_SIG(set_bindings_choose); -CUSTOM_COMMAND_SIG(set_bindings_default); -CUSTOM_COMMAND_SIG(set_bindings_mac_default); -CUSTOM_COMMAND_SIG(set_mark); -CUSTOM_COMMAND_SIG(setup_build_bat); -CUSTOM_COMMAND_SIG(setup_build_bat_and_sh); -CUSTOM_COMMAND_SIG(setup_build_sh); -CUSTOM_COMMAND_SIG(setup_new_project); -CUSTOM_COMMAND_SIG(show_filebar); -CUSTOM_COMMAND_SIG(show_scrollbar); -CUSTOM_COMMAND_SIG(snipe_token_or_word); -CUSTOM_COMMAND_SIG(snipe_token_or_word_right); -CUSTOM_COMMAND_SIG(suppress_mouse); -CUSTOM_COMMAND_SIG(swap_buffers_between_panels); -CUSTOM_COMMAND_SIG(to_lowercase); -CUSTOM_COMMAND_SIG(to_uppercase); -CUSTOM_COMMAND_SIG(toggle_filebar); -CUSTOM_COMMAND_SIG(toggle_fullscreen); -CUSTOM_COMMAND_SIG(toggle_line_wrap); -CUSTOM_COMMAND_SIG(toggle_mouse); -CUSTOM_COMMAND_SIG(toggle_show_whitespace); -CUSTOM_COMMAND_SIG(toggle_virtual_whitespace); -CUSTOM_COMMAND_SIG(undo); -CUSTOM_COMMAND_SIG(view_buffer_other_panel); -CUSTOM_COMMAND_SIG(word_complete); -CUSTOM_COMMAND_SIG(write_and_auto_tab); -CUSTOM_COMMAND_SIG(write_block); -CUSTOM_COMMAND_SIG(write_character); -CUSTOM_COMMAND_SIG(write_explicit_enum_flags); -CUSTOM_COMMAND_SIG(write_explicit_enum_values); -CUSTOM_COMMAND_SIG(write_hack); -CUSTOM_COMMAND_SIG(write_note); -CUSTOM_COMMAND_SIG(write_todo); -CUSTOM_COMMAND_SIG(write_underscore); -CUSTOM_COMMAND_SIG(write_zero_struct); -#endif -struct Command_Metadata{ -PROC_LINKS(Custom_Command_Function, void) *proc; -char *name; -int32_t name_len; -char *description; -int32_t description_len; -char *source_name; -int32_t source_name_len; -int32_t line_number; -}; -static Command_Metadata fcoder_metacmd_table[196] = { -{ PROC_LINKS(allow_mouse, 0), "allow_mouse", 11, "Shows the mouse and causes all mouse input to be processed normally.", 68, "/Users/allenwebster/4ed/code/4coder_default_framework.cpp", 57, 199 }, -{ PROC_LINKS(auto_tab_line_at_cursor, 0), "auto_tab_line_at_cursor", 23, "Auto-indents the line on which the cursor sits.", 47, "/Users/allenwebster/4ed/code/4coder_auto_indent.cpp", 51, 722 }, -{ PROC_LINKS(auto_tab_range, 0), "auto_tab_range", 14, "Auto-indents the range between the cursor and the mark.", 55, "/Users/allenwebster/4ed/code/4coder_auto_indent.cpp", 51, 733 }, -{ PROC_LINKS(auto_tab_whole_file, 0), "auto_tab_whole_file", 19, "Audo-indents the entire current buffer.", 39, "/Users/allenwebster/4ed/code/4coder_auto_indent.cpp", 51, 712 }, -{ PROC_LINKS(backspace_char, 0), "backspace_char", 14, "Deletes the character to the left of the cursor.", 48, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 67 }, -{ PROC_LINKS(backspace_word, 0), "backspace_word", 14, "Delete characters between the cursor position and the first alphanumeric boundary to the left.", 94, "/Users/allenwebster/4ed/code/4coder_seek.cpp", 44, 1247 }, -{ PROC_LINKS(basic_change_active_panel, 0), "basic_change_active_panel", 25, "Change the currently active panel, moving to the panel with the next highest view_id. Will not skipe the build panel if it is open.", 132, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 433 }, -{ PROC_LINKS(build_in_build_panel, 0), "build_in_build_panel", 20, "Looks for a build.bat, build.sh, or makefile in the current and parent directories. Runs the first that it finds and prints the output to *compilation*. Puts the *compilation* buffer in a panel at the footer of the current view.", 230, "/Users/allenwebster/4ed/code/4coder_build_commands.cpp", 54, 189 }, -{ PROC_LINKS(build_search, 0), "build_search", 12, "Looks for a build.bat, build.sh, or makefile in the current and parent directories. Runs the first that it finds and prints the output to *compilation*.", 153, "/Users/allenwebster/4ed/code/4coder_build_commands.cpp", 54, 155 }, -{ PROC_LINKS(center_view, 0), "center_view", 11, "Centers the view vertically on the line on which the cursor sits.", 65, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 120 }, -{ PROC_LINKS(change_active_panel, 0), "change_active_panel", 19, "Change the currently active panel, moving to the panel with the next highest view_id.", 85, "/Users/allenwebster/4ed/code/4coder_default_framework.cpp", 57, 141 }, -{ PROC_LINKS(change_active_panel_backwards, 0), "change_active_panel_backwards", 29, "Change the currently active panel, moving to the panel with the next lowest view_id.", 84, "/Users/allenwebster/4ed/code/4coder_default_framework.cpp", 57, 151 }, -{ PROC_LINKS(change_to_build_panel, 0), "change_to_build_panel", 21, "If the special build panel is open, makes the build panel the active panel.", 75, "/Users/allenwebster/4ed/code/4coder_build_commands.cpp", 54, 211 }, -{ PROC_LINKS(clean_all_lines, 0), "clean_all_lines", 15, "Removes trailing whitespace from all lines in the current buffer.", 65, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 368 }, -{ PROC_LINKS(click_set_cursor, 0), "click_set_cursor", 16, "Sets the cursor position to the mouse position.", 47, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 174 }, -{ PROC_LINKS(click_set_mark, 0), "click_set_mark", 14, "Sets the mark position to the mouse position.", 45, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 187 }, -{ PROC_LINKS(close_all_code, 0), "close_all_code", 14, "Closes any buffer with a filename ending with an extension configured to be recognized as a code file type.", 107, "/Users/allenwebster/4ed/code/4coder_project_commands.cpp", 56, 1003 }, -{ PROC_LINKS(close_build_panel, 0), "close_build_panel", 17, "If the special build panel is open, closes it.", 46, "/Users/allenwebster/4ed/code/4coder_build_commands.cpp", 54, 205 }, -{ PROC_LINKS(close_panel, 0), "close_panel", 11, "Closes the currently active panel if it is not the only panel open.", 67, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 441 }, -{ PROC_LINKS(copy, 0), "copy", 4, "Copy the text in the range from the cursor to the mark onto the clipboard.", 74, "/Users/allenwebster/4ed/code/4coder_clipboard.cpp", 49, 26 }, -{ PROC_LINKS(cursor_mark_swap, 0), "cursor_mark_swap", 16, "Swaps the position of the cursor and the mark.", 46, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 95 }, -{ PROC_LINKS(cut, 0), "cut", 3, "Cut the text in the range from the cursor to the mark onto the clipboard.", 73, "/Users/allenwebster/4ed/code/4coder_clipboard.cpp", 49, 35 }, -{ PROC_LINKS(decrease_face_size, 0), "decrease_face_size", 18, "Decrease the size of the face used by the current buffer.", 57, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 531 }, -{ PROC_LINKS(decrease_line_wrap, 0), "decrease_line_wrap", 18, "Decrases the current buffer's width for line wrapping.", 54, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 508 }, -{ PROC_LINKS(delete_char, 0), "delete_char", 11, "Deletes the character to the right of the cursor.", 49, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 49 }, -{ PROC_LINKS(delete_current_scope, 0), "delete_current_scope", 20, "Deletes the braces surrounding the currently selected scope. Leaves the contents within the scope.", 99, "/Users/allenwebster/4ed/code/4coder_scope_commands.cpp", 54, 487 }, -{ PROC_LINKS(delete_file_query, 0), "delete_file_query", 17, "Deletes the file of the current buffer if 4coder has the appropriate access rights. Will ask the user for confirmation first.", 125, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 993 }, -{ PROC_LINKS(delete_line, 0), "delete_line", 11, "Delete the line the on which the cursor sits.", 45, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 1243 }, -{ PROC_LINKS(delete_range, 0), "delete_range", 12, "Deletes the text in the range between the cursor and the mark.", 62, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 107 }, -{ PROC_LINKS(delete_word, 0), "delete_word", 11, "Delete characters between the cursor position and the first alphanumeric boundary to the right.", 95, "/Users/allenwebster/4ed/code/4coder_seek.cpp", 44, 1253 }, -{ PROC_LINKS(duplicate_line, 0), "duplicate_line", 14, "Create a copy of the line on which the cursor sits.", 51, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 1221 }, -{ PROC_LINKS(eol_dosify, 0), "eol_dosify", 10, "Puts the buffer in DOS line ending mode.", 40, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 561 }, -{ PROC_LINKS(eol_nixify, 0), "eol_nixify", 10, "Puts the buffer in NIX line ending mode.", 40, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 569 }, -{ PROC_LINKS(execute_any_cli, 0), "execute_any_cli", 15, "Queries for an output buffer name and system command, runs the system command as a CLI and prints the output to the specified buffer.", 133, "/Users/allenwebster/4ed/code/4coder_system_command.cpp", 54, 23 }, -{ PROC_LINKS(execute_arbitrary_command, 0), "execute_arbitrary_command", 25, "Execute a 'long form' command.", 30, "/Users/allenwebster/4ed/code/4coder_long_command_switch.cpp", 59, 8 }, -{ PROC_LINKS(execute_previous_cli, 0), "execute_previous_cli", 20, "If the command execute_any_cli has already been used, this will execute a CLI reusing the most recent buffer name and command.", 126, "/Users/allenwebster/4ed/code/4coder_system_command.cpp", 54, 7 }, -{ PROC_LINKS(exit_4coder, 0), "exit_4coder", 11, "Attempts to close 4coder.", 25, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 577 }, -{ PROC_LINKS(goto_beginning_of_file, 0), "goto_beginning_of_file", 22, "Sets the cursor to the beginning of the file.", 45, "/Users/allenwebster/4ed/code/4coder_seek.cpp", 44, 1168 }, -{ PROC_LINKS(goto_end_of_file, 0), "goto_end_of_file", 16, "Sets the cursor to the end of the file.", 39, "/Users/allenwebster/4ed/code/4coder_seek.cpp", 44, 1175 }, -{ PROC_LINKS(goto_first_jump_direct, 0), "goto_first_jump_direct", 22, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer.", 95, "/Users/allenwebster/4ed/code/4coder_jump_direct.cpp", 51, 84 }, -{ PROC_LINKS(goto_first_jump_same_panel_sticky, 0), "goto_first_jump_same_panel_sticky", 33, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer and views the buffer in the panel where the jump list was.", 153, "/Users/allenwebster/4ed/code/4coder_jump_sticky.cpp", 51, 533 }, -{ PROC_LINKS(goto_first_jump_sticky, 0), "goto_first_jump_sticky", 22, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer.", 95, "/Users/allenwebster/4ed/code/4coder_jump_sticky.cpp", 51, 515 }, -{ PROC_LINKS(goto_jump_at_cursor_direct, 0), "goto_jump_at_cursor_direct", 26, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in another view and changes the active panel to the view containing the jump.", 187, "/Users/allenwebster/4ed/code/4coder_jump_direct.cpp", 51, 8 }, -{ PROC_LINKS(goto_jump_at_cursor_same_panel_direct, 0), "goto_jump_at_cursor_same_panel_direct", 37, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in this view, losing the compilation output or jump list..", 168, "/Users/allenwebster/4ed/code/4coder_jump_direct.cpp", 51, 29 }, -{ PROC_LINKS(goto_jump_at_cursor_same_panel_sticky, 0), "goto_jump_at_cursor_same_panel_sticky", 37, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in this view, losing the compilation output or jump list.", 167, "/Users/allenwebster/4ed/code/4coder_jump_sticky.cpp", 51, 365 }, -{ PROC_LINKS(goto_jump_at_cursor_sticky, 0), "goto_jump_at_cursor_sticky", 26, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in another view and changes the active panel to the view containing the jump.", 187, "/Users/allenwebster/4ed/code/4coder_jump_sticky.cpp", 51, 337 }, -{ PROC_LINKS(goto_line, 0), "goto_line", 9, "Queries the user for a number, and jumps the cursor to the corresponding line.", 78, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 585 }, -{ PROC_LINKS(goto_next_jump_direct, 0), "goto_next_jump_direct", 21, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, skipping sub jump locations.", 123, "/Users/allenwebster/4ed/code/4coder_jump_direct.cpp", 51, 48 }, -{ PROC_LINKS(goto_next_jump_no_skips_direct, 0), "goto_next_jump_no_skips_direct", 30, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, and does not skip sub jump locations.", 132, "/Users/allenwebster/4ed/code/4coder_jump_direct.cpp", 51, 66 }, -{ PROC_LINKS(goto_next_jump_no_skips_sticky, 0), "goto_next_jump_no_skips_sticky", 30, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, and does not skip sub jump locations.", 132, "/Users/allenwebster/4ed/code/4coder_jump_sticky.cpp", 51, 484 }, -{ PROC_LINKS(goto_next_jump_sticky, 0), "goto_next_jump_sticky", 21, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, skipping sub jump locations.", 123, "/Users/allenwebster/4ed/code/4coder_jump_sticky.cpp", 51, 454 }, -{ PROC_LINKS(goto_prev_jump_direct, 0), "goto_prev_jump_direct", 21, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, skipping sub jump locations.", 127, "/Users/allenwebster/4ed/code/4coder_jump_direct.cpp", 51, 57 }, -{ PROC_LINKS(goto_prev_jump_no_skips_direct, 0), "goto_prev_jump_no_skips_direct", 30, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, and does not skip sub jump locations.", 136, "/Users/allenwebster/4ed/code/4coder_jump_direct.cpp", 51, 75 }, -{ PROC_LINKS(goto_prev_jump_no_skips_sticky, 0), "goto_prev_jump_no_skips_sticky", 30, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, and does not skip sub jump locations.", 136, "/Users/allenwebster/4ed/code/4coder_jump_sticky.cpp", 51, 500 }, -{ PROC_LINKS(goto_prev_jump_sticky, 0), "goto_prev_jump_sticky", 21, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, skipping sub jump locations.", 127, "/Users/allenwebster/4ed/code/4coder_jump_sticky.cpp", 51, 470 }, -{ PROC_LINKS(hide_filebar, 0), "hide_filebar", 12, "Sets the current view to hide it's filebar.", 43, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 471 }, -{ PROC_LINKS(hide_scrollbar, 0), "hide_scrollbar", 14, "Sets the current view to hide it's scrollbar.", 45, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 457 }, -{ PROC_LINKS(highlight_next_scope_absolute, 0), "highlight_next_scope_absolute", 29, "Finds the first scope started by '{' after the cursor and puts the cursor and mark on the '{' and '}'.", 102, "/Users/allenwebster/4ed/code/4coder_scope_commands.cpp", 54, 363 }, -{ PROC_LINKS(highlight_prev_scope_absolute, 0), "highlight_prev_scope_absolute", 29, "Finds the first scope started by '{' before the cursor and puts the cursor and mark on the '{' and '}'.", 103, "/Users/allenwebster/4ed/code/4coder_scope_commands.cpp", 54, 382 }, -{ PROC_LINKS(highlight_surrounding_scope, 0), "highlight_surrounding_scope", 27, "Finds the scope enclosed by '{' '}' surrounding the cursor and puts the cursor and mark on the '{' and '}'.", 107, "/Users/allenwebster/4ed/code/4coder_scope_commands.cpp", 54, 341 }, -{ PROC_LINKS(if0_off, 0), "if0_off", 7, "Surround the range between the cursor and mark with an '#if 0' and an '#endif'", 78, "/Users/allenwebster/4ed/code/4coder_combined_write_commands.cpp", 63, 82 }, -{ PROC_LINKS(increase_face_size, 0), "increase_face_size", 18, "Increase the size of the face used by the current buffer.", 57, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 519 }, -{ PROC_LINKS(increase_line_wrap, 0), "increase_line_wrap", 18, "Increases the current buffer's width for line wrapping.", 55, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 497 }, -{ PROC_LINKS(interactive_kill_buffer, 0), "interactive_kill_buffer", 23, "Interactively kill an open buffer.", 34, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 1433 }, -{ PROC_LINKS(interactive_new, 0), "interactive_new", 15, "Interactively creates a new file.", 33, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 1409 }, -{ PROC_LINKS(interactive_open, 0), "interactive_open", 16, "Interactively opens a file.", 27, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 1415 }, -{ PROC_LINKS(interactive_open_or_new, 0), "interactive_open_or_new", 23, "Interactively opens or creates a new file.", 42, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 1421 }, -{ PROC_LINKS(interactive_switch_buffer, 0), "interactive_switch_buffer", 25, "Interactively switch to an open buffer.", 39, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 1427 }, -{ PROC_LINKS(kill_buffer, 0), "kill_buffer", 11, "Kills the current buffer.", 25, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 1451 }, -{ PROC_LINKS(kill_rect, 0), "kill_rect", 9, "Delete characters in a rectangular region. Range testing is done by unwrapped-xy coordinates.", 93, "/Users/allenwebster/4ed/code/4coder_experiments.cpp", 51, 29 }, -{ PROC_LINKS(left_adjust_view, 0), "left_adjust_view", 16, "Sets the left size of the view near the x position of the cursor.", 65, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 135 }, -{ PROC_LINKS(list_all_functions_current_buffer, 0), "list_all_functions_current_buffer", 33, "Creates a jump list of lines of the current buffer that appear to define or declare functions.", 94, "/Users/allenwebster/4ed/code/4coder_function_list.cpp", 53, 318 }, -{ PROC_LINKS(list_all_locations, 0), "list_all_locations", 18, "Queries the user for a string and lists all exact case-sensitive matches found in all open buffers.", 99, "/Users/allenwebster/4ed/code/4coder_search.cpp", 46, 741 }, -{ PROC_LINKS(list_all_locations_case_insensitive, 0), "list_all_locations_case_insensitive", 35, "Queries the user for a string and lists all exact case-insensitive matches found in all open buffers.", 101, "/Users/allenwebster/4ed/code/4coder_search.cpp", 46, 753 }, -{ PROC_LINKS(list_all_locations_of_identifier, 0), "list_all_locations_of_identifier", 32, "Reads a token or word under the cursor and lists all exact case-sensitive mathces in all open buffers.", 102, "/Users/allenwebster/4ed/code/4coder_search.cpp", 46, 765 }, -{ PROC_LINKS(list_all_locations_of_identifier_case_insensitive, 0), "list_all_locations_of_identifier_case_insensitive", 49, "Reads a token or word under the cursor and lists all exact case-insensitive mathces in all open buffers.", 104, "/Users/allenwebster/4ed/code/4coder_search.cpp", 46, 771 }, -{ PROC_LINKS(list_all_locations_of_selection, 0), "list_all_locations_of_selection", 31, "Reads the string in the selected range and lists all exact case-sensitive mathces in all open buffers.", 102, "/Users/allenwebster/4ed/code/4coder_search.cpp", 46, 777 }, -{ PROC_LINKS(list_all_locations_of_selection_case_insensitive, 0), "list_all_locations_of_selection_case_insensitive", 48, "Reads the string in the selected range and lists all exact case-insensitive mathces in all open buffers.", 104, "/Users/allenwebster/4ed/code/4coder_search.cpp", 46, 783 }, -{ PROC_LINKS(list_all_locations_of_type_definition, 0), "list_all_locations_of_type_definition", 37, "Queries user for string, lists all locations of strings that appear to define a type whose name matches the input string.", 121, "/Users/allenwebster/4ed/code/4coder_search.cpp", 46, 789 }, -{ PROC_LINKS(list_all_locations_of_type_definition_of_identifier, 0), "list_all_locations_of_type_definition_of_identifier", 51, "Reads a token or word under the cursor and lists all locations of strings that appear to define a type whose name matches it.", 125, "/Users/allenwebster/4ed/code/4coder_search.cpp", 46, 800 }, -{ PROC_LINKS(list_all_substring_locations, 0), "list_all_substring_locations", 28, "Queries the user for a string and lists all case-sensitive substring matches found in all open buffers.", 103, "/Users/allenwebster/4ed/code/4coder_search.cpp", 46, 747 }, -{ PROC_LINKS(list_all_substring_locations_case_insensitive, 0), "list_all_substring_locations_case_insensitive", 45, "Queries the user for a string and lists all case-insensitive substring matches found in all open buffers.", 105, "/Users/allenwebster/4ed/code/4coder_search.cpp", 46, 759 }, -{ PROC_LINKS(load_project, 0), "load_project", 12, "Looks for a project.4coder file in the current directory and tries to load it. Looks in parent directories until a project file is found or there are no more parents.", 167, "/Users/allenwebster/4ed/code/4coder_project_commands.cpp", 56, 1026 }, -{ PROC_LINKS(make_directory_query, 0), "make_directory_query", 20, "Queries the user for a name and creates a new directory with the given name.", 76, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 1101 }, -{ PROC_LINKS(miblo_decrement_basic, 0), "miblo_decrement_basic", 21, "Decrement an integer under the cursor by one.", 45, "/Users/allenwebster/4ed/code/4coder_miblo_numbers.cpp", 53, 110 }, -{ PROC_LINKS(miblo_decrement_time_stamp, 0), "miblo_decrement_time_stamp", 26, "Decrement a time stamp under the cursor by one second. (format [m]m:ss or h:mm:ss", 81, "/Users/allenwebster/4ed/code/4coder_miblo_numbers.cpp", 53, 383 }, -{ PROC_LINKS(miblo_decrement_time_stamp_minute, 0), "miblo_decrement_time_stamp_minute", 33, "Decrement a time stamp under the cursor by one minute. (format [m]m:ss or h:mm:ss", 81, "/Users/allenwebster/4ed/code/4coder_miblo_numbers.cpp", 53, 395 }, -{ PROC_LINKS(miblo_increment_basic, 0), "miblo_increment_basic", 21, "Increment an integer under the cursor by one.", 45, "/Users/allenwebster/4ed/code/4coder_miblo_numbers.cpp", 53, 94 }, -{ PROC_LINKS(miblo_increment_time_stamp, 0), "miblo_increment_time_stamp", 26, "Increment a time stamp under the cursor by one second. (format [m]m:ss or h:mm:ss", 81, "/Users/allenwebster/4ed/code/4coder_miblo_numbers.cpp", 53, 377 }, -{ PROC_LINKS(miblo_increment_time_stamp_minute, 0), "miblo_increment_time_stamp_minute", 33, "Increment a time stamp under the cursor by one minute. (format [m]m:ss or h:mm:ss", 81, "/Users/allenwebster/4ed/code/4coder_miblo_numbers.cpp", 53, 389 }, -{ PROC_LINKS(move_down, 0), "move_down", 9, "Moves the cursor down one line.", 31, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 250 }, -{ PROC_LINKS(move_down_10, 0), "move_down_10", 12, "Moves the cursor down ten lines.", 32, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 262 }, -{ PROC_LINKS(move_down_textual, 0), "move_down_textual", 17, "Moves down to the next line of actual text, regardless of line wrapping.", 72, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 268 }, -{ PROC_LINKS(move_left, 0), "move_left", 9, "Moves the cursor one character to the left.", 43, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 299 }, -{ PROC_LINKS(move_line_down, 0), "move_line_down", 14, "Swaps the line under the cursor with the line below it, and moves the cursor down with it.", 90, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 1198 }, -{ PROC_LINKS(move_line_up, 0), "move_line_up", 12, "Swaps the line under the cursor with the line above it, and moves the cursor up with it.", 88, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 1134 }, -{ PROC_LINKS(move_right, 0), "move_right", 10, "Moves the cursor one character to the right.", 44, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 308 }, -{ PROC_LINKS(move_up, 0), "move_up", 7, "Moves the cursor up one line.", 29, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 244 }, -{ PROC_LINKS(move_up_10, 0), "move_up_10", 10, "Moves the cursor up ten lines.", 30, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 256 }, -{ PROC_LINKS(multi_line_edit, 0), "multi_line_edit", 15, "Begin multi-line mode. In multi-line mode characters are inserted at every line between the mark and cursor. All characters are inserted at the same character offset into the line. This mode uses line_char coordinates.", 221, "/Users/allenwebster/4ed/code/4coder_experiments.cpp", 51, 120 }, -{ PROC_LINKS(newline_or_goto_position_direct, 0), "newline_or_goto_position_direct", 31, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor.", 106, "/Users/allenwebster/4ed/code/4coder_jump_direct.cpp", 51, 101 }, -{ PROC_LINKS(newline_or_goto_position_same_panel_direct, 0), "newline_or_goto_position_same_panel_direct", 42, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor_same_panel.", 117, "/Users/allenwebster/4ed/code/4coder_jump_direct.cpp", 51, 116 }, -{ PROC_LINKS(newline_or_goto_position_same_panel_sticky, 0), "newline_or_goto_position_same_panel_sticky", 42, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor_same_panel.", 117, "/Users/allenwebster/4ed/code/4coder_jump_sticky.cpp", 51, 571 }, -{ PROC_LINKS(newline_or_goto_position_sticky, 0), "newline_or_goto_position_sticky", 31, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor.", 106, "/Users/allenwebster/4ed/code/4coder_jump_sticky.cpp", 51, 556 }, -{ PROC_LINKS(open_all_code, 0), "open_all_code", 13, "Open all code in the current directory. File types are determined by extensions. An extension is considered code based on the extensions specified in 4coder.config.", 164, "/Users/allenwebster/4ed/code/4coder_project_commands.cpp", 56, 1010 }, -{ PROC_LINKS(open_all_code_recursive, 0), "open_all_code_recursive", 23, "Works as open_all_code but also runs in all subdirectories.", 59, "/Users/allenwebster/4ed/code/4coder_project_commands.cpp", 56, 1017 }, -{ PROC_LINKS(open_color_tweaker, 0), "open_color_tweaker", 18, "Opens the 4coder colors and fonts selector menu.", 48, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 1457 }, -{ PROC_LINKS(open_file_in_quotes, 0), "open_file_in_quotes", 19, "Reads a filename from surrounding '\"' characters and attempts to open the corresponding file.", 94, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 1320 }, -{ PROC_LINKS(open_in_other, 0), "open_in_other", 13, "Interactively opens a file in the other panel.", 46, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 1465 }, -{ PROC_LINKS(open_long_braces, 0), "open_long_braces", 16, "At the cursor, insert a '{' and '}' separated by a blank line.", 62, "/Users/allenwebster/4ed/code/4coder_combined_write_commands.cpp", 63, 58 }, -{ PROC_LINKS(open_long_braces_break, 0), "open_long_braces_break", 22, "At the cursor, insert a '{' and '}break;' separated by a blank line.", 68, "/Users/allenwebster/4ed/code/4coder_combined_write_commands.cpp", 63, 74 }, -{ PROC_LINKS(open_long_braces_semicolon, 0), "open_long_braces_semicolon", 26, "At the cursor, insert a '{' and '};' separated by a blank line.", 63, "/Users/allenwebster/4ed/code/4coder_combined_write_commands.cpp", 63, 66 }, -{ PROC_LINKS(open_matching_file_cpp, 0), "open_matching_file_cpp", 22, "If the current file is a *.cpp or *.h, attempts to open the corresponding *.h or *.cpp file in the other view.", 110, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 1356 }, -{ PROC_LINKS(open_panel_hsplit, 0), "open_panel_hsplit", 17, "Create a new panel by horizontally splitting the active panel.", 62, "/Users/allenwebster/4ed/code/4coder_default_framework.cpp", 57, 170 }, -{ PROC_LINKS(open_panel_vsplit, 0), "open_panel_vsplit", 17, "Create a new panel by vertically splitting the active panel.", 60, "/Users/allenwebster/4ed/code/4coder_default_framework.cpp", 57, 161 }, -{ PROC_LINKS(page_down, 0), "page_down", 9, "Scrolls the view down one view height and moves the cursor down one view height.", 80, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 288 }, -{ PROC_LINKS(page_up, 0), "page_up", 7, "Scrolls the view up one view height and moves the cursor up one view height.", 76, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 279 }, -{ PROC_LINKS(paste, 0), "paste", 5, "At the cursor, insert the text at the top of the clipboard.", 59, "/Users/allenwebster/4ed/code/4coder_clipboard.cpp", 49, 46 }, -{ PROC_LINKS(paste_and_indent, 0), "paste_and_indent", 16, "Paste from the top of clipboard and run auto-indent on the newly pasted text.", 77, "/Users/allenwebster/4ed/code/4coder_clipboard.cpp", 49, 128 }, -{ PROC_LINKS(paste_next, 0), "paste_next", 10, "If the previous command was paste or paste_next, replaces the paste range with the next text down on the clipboard, otherwise operates as the paste command.", 156, "/Users/allenwebster/4ed/code/4coder_clipboard.cpp", 49, 84 }, -{ PROC_LINKS(paste_next_and_indent, 0), "paste_next_and_indent", 21, "Paste the next item on the clipboard and run auto-indent on the newly pasted text.", 82, "/Users/allenwebster/4ed/code/4coder_clipboard.cpp", 49, 135 }, -{ PROC_LINKS(place_in_scope, 0), "place_in_scope", 14, "Wraps the code contained in the range between cursor and mark with a new curly brace scope.", 91, "/Users/allenwebster/4ed/code/4coder_scope_commands.cpp", 54, 481 }, -{ PROC_LINKS(project_fkey_command, 0), "project_fkey_command", 20, "Run an 'fkey command' configured in a project.4coder file. Determines the index of the 'fkey command' by which function key or numeric key was pressed to trigger the command.", 175, "/Users/allenwebster/4ed/code/4coder_project_commands.cpp", 56, 1033 }, -{ PROC_LINKS(project_go_to_root_directory, 0), "project_go_to_root_directory", 28, "Changes 4coder's hot directory to the root directory of the currently loaded project. With no loaded project nothing hapepns.", 125, "/Users/allenwebster/4ed/code/4coder_project_commands.cpp", 56, 1058 }, -{ PROC_LINKS(query_replace, 0), "query_replace", 13, "Queries the user for two strings, and incrementally replaces every occurence of the first string with the second string.", 120, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 893 }, -{ PROC_LINKS(query_replace_identifier, 0), "query_replace_identifier", 24, "Queries the user for a string, and incrementally replace every occurence of the word or token found at the cursor with the specified string.", 140, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 913 }, -{ PROC_LINKS(query_replace_selection, 0), "query_replace_selection", 23, "Queries the user for a string, and incrementally replace every occurence of the string found in the selected range with the specified string.", 141, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 931 }, -{ PROC_LINKS(redo, 0), "redo", 4, "Advances forewards through the undo history.", 44, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 1403 }, -{ PROC_LINKS(remap_interactive, 0), "remap_interactive", 17, "Switch to a named key binding map.", 34, "/Users/allenwebster/4ed/code/4coder_default_framework.cpp", 57, 219 }, -{ PROC_LINKS(rename_file_query, 0), "rename_file_query", 17, "Queries the user for a new name and renames the file of the current buffer, altering the buffer's name too.", 107, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 1059 }, -{ PROC_LINKS(rename_parameter, 0), "rename_parameter", 16, "If the cursor is found to be on the name of a function parameter in the signature of a function definition, all occurences within the scope of the function will be replaced with a new provided string.", 200, "/Users/allenwebster/4ed/code/4coder_experiments.cpp", 51, 385 }, -{ PROC_LINKS(reopen, 0), "reopen", 6, "Reopen the current buffer from the hard drive.", 46, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 1439 }, -{ PROC_LINKS(replace_all_occurrences, 0), "replace_all_occurrences", 23, "Queries the user for two strings, and replaces all occurrences of the first string with the second string in all open buffers.", 126, "/Users/allenwebster/4ed/code/4coder_experiments.cpp", 51, 771 }, -{ PROC_LINKS(replace_in_range, 0), "replace_in_range", 16, "Queries the user for two strings, and replaces all occurences of the first string in the range between the cursor and the mark with the second string.", 150, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 791 }, -{ PROC_LINKS(reverse_search, 0), "reverse_search", 14, "Begins an incremental search up through the current buffer for a user specified string.", 87, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 762 }, -{ PROC_LINKS(reverse_search_identifier, 0), "reverse_search_identifier", 25, "Begins an incremental search up through the current buffer for the word or token under the cursor.", 98, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 780 }, -{ PROC_LINKS(save, 0), "save", 4, "Saves the current buffer.", 25, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 1445 }, -{ PROC_LINKS(save_all_dirty_buffers, 0), "save_all_dirty_buffers", 22, "Saves all buffers marked dirty (showing the '*' indicator).", 59, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 958 }, -{ PROC_LINKS(save_to_query, 0), "save_to_query", 13, "Queries the user for a name and saves the contents of the current buffer, altering the buffer's name too.", 105, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 1019 }, -{ PROC_LINKS(scope_absorb_down, 0), "scope_absorb_down", 17, "If a scope is currently selected, and a statement or block statement is present below the current scope, the statement is moved into the scope.", 143, "/Users/allenwebster/4ed/code/4coder_scope_commands.cpp", 54, 738 }, -{ PROC_LINKS(search, 0), "search", 6, "Begins an incremental search down through the current buffer for a user specified string.", 89, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 755 }, -{ PROC_LINKS(search_identifier, 0), "search_identifier", 17, "Begins an incremental search down through the current buffer for the word or token under the cursor.", 100, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 769 }, -{ PROC_LINKS(seek_alphanumeric_left, 0), "seek_alphanumeric_left", 22, "Seek left for boundary between alphanumeric characters and non-alphanumeric characters.", 87, "/Users/allenwebster/4ed/code/4coder_seek.cpp", 44, 1227 }, -{ PROC_LINKS(seek_alphanumeric_or_camel_left, 0), "seek_alphanumeric_or_camel_left", 31, "Seek left for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 106, "/Users/allenwebster/4ed/code/4coder_seek.cpp", 44, 1239 }, -{ PROC_LINKS(seek_alphanumeric_or_camel_right, 0), "seek_alphanumeric_or_camel_right", 32, "Seek right for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 107, "/Users/allenwebster/4ed/code/4coder_seek.cpp", 44, 1233 }, -{ PROC_LINKS(seek_alphanumeric_right, 0), "seek_alphanumeric_right", 23, "Seek right for boundary between alphanumeric characters and non-alphanumeric characters.", 88, "/Users/allenwebster/4ed/code/4coder_seek.cpp", 44, 1221 }, -{ PROC_LINKS(seek_beginning_of_line, 0), "seek_beginning_of_line", 22, "Seeks the cursor to the beginning of the visual line.", 53, "/Users/allenwebster/4ed/code/4coder_seek.cpp", 44, 1126 }, -{ PROC_LINKS(seek_beginning_of_textual_line, 0), "seek_beginning_of_textual_line", 30, "Seeks the cursor to the beginning of the line across all text.", 62, "/Users/allenwebster/4ed/code/4coder_seek.cpp", 44, 1108 }, -{ PROC_LINKS(seek_end_of_line, 0), "seek_end_of_line", 16, "Seeks the cursor to the end of the visual line.", 47, "/Users/allenwebster/4ed/code/4coder_seek.cpp", 44, 1137 }, -{ PROC_LINKS(seek_end_of_textual_line, 0), "seek_end_of_textual_line", 24, "Seeks the cursor to the end of the line across all text.", 56, "/Users/allenwebster/4ed/code/4coder_seek.cpp", 44, 1117 }, -{ PROC_LINKS(seek_token_left, 0), "seek_token_left", 15, "Seek left for the next beginning of a token.", 44, "/Users/allenwebster/4ed/code/4coder_seek.cpp", 44, 1203 }, -{ PROC_LINKS(seek_token_right, 0), "seek_token_right", 16, "Seek right for the next end of a token.", 39, "/Users/allenwebster/4ed/code/4coder_seek.cpp", 44, 1197 }, -{ PROC_LINKS(seek_white_or_token_left, 0), "seek_white_or_token_left", 24, "Seek left for the next end of a token or boundary between whitespace and non-whitespace.", 88, "/Users/allenwebster/4ed/code/4coder_seek.cpp", 44, 1215 }, -{ PROC_LINKS(seek_white_or_token_right, 0), "seek_white_or_token_right", 25, "Seek right for the next end of a token or boundary between whitespace and non-whitespace.", 89, "/Users/allenwebster/4ed/code/4coder_seek.cpp", 44, 1209 }, -{ PROC_LINKS(seek_whitespace_down, 0), "seek_whitespace_down", 20, "Seeks the cursor down to the next blank line.", 45, "/Users/allenwebster/4ed/code/4coder_seek.cpp", 44, 1099 }, -{ PROC_LINKS(seek_whitespace_down_end_line, 0), "seek_whitespace_down_end_line", 29, "Seeks the cursor down to the next blank line and places it at the end of the line.", 82, "/Users/allenwebster/4ed/code/4coder_seek.cpp", 44, 1158 }, -{ PROC_LINKS(seek_whitespace_left, 0), "seek_whitespace_left", 20, "Seek left for the next boundary between whitespace and non-whitespace.", 70, "/Users/allenwebster/4ed/code/4coder_seek.cpp", 44, 1191 }, -{ PROC_LINKS(seek_whitespace_right, 0), "seek_whitespace_right", 21, "Seek right for the next boundary between whitespace and non-whitespace.", 71, "/Users/allenwebster/4ed/code/4coder_seek.cpp", 44, 1185 }, -{ PROC_LINKS(seek_whitespace_up, 0), "seek_whitespace_up", 18, "Seeks the cursor up to the next blank line.", 43, "/Users/allenwebster/4ed/code/4coder_seek.cpp", 44, 1090 }, -{ PROC_LINKS(seek_whitespace_up_end_line, 0), "seek_whitespace_up_end_line", 27, "Seeks the cursor up to the next blank line and places it at the end of the line.", 80, "/Users/allenwebster/4ed/code/4coder_seek.cpp", 44, 1148 }, -{ PROC_LINKS(select_all, 0), "select_all", 10, "Puts the cursor at the top of the file, and the mark at the bottom of the file.", 79, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 317 }, -{ PROC_LINKS(set_bindings_choose, 0), "set_bindings_choose", 19, "Remap keybindings using the 'choose' mapping rule.", 50, "/Users/allenwebster/4ed/code/4coder_remapping_commands.cpp", 58, 47 }, -{ PROC_LINKS(set_bindings_default, 0), "set_bindings_default", 20, "Remap keybindings using the 'default' mapping rule.", 51, "/Users/allenwebster/4ed/code/4coder_remapping_commands.cpp", 58, 61 }, -{ PROC_LINKS(set_bindings_mac_default, 0), "set_bindings_mac_default", 24, "Remap keybindings using the 'mac-default' mapping rule.", 55, "/Users/allenwebster/4ed/code/4coder_remapping_commands.cpp", 58, 75 }, -{ PROC_LINKS(set_mark, 0), "set_mark", 8, "Sets the mark to the current position of the cursor.", 52, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 86 }, -{ PROC_LINKS(setup_build_bat, 0), "setup_build_bat", 15, "Queries the user for several configuration options and initializes a new build batch script.", 92, "/Users/allenwebster/4ed/code/4coder_project_commands.cpp", 56, 1443 }, -{ PROC_LINKS(setup_build_bat_and_sh, 0), "setup_build_bat_and_sh", 22, "Queries the user for several configuration options and initializes a new build batch script.", 92, "/Users/allenwebster/4ed/code/4coder_project_commands.cpp", 56, 1455 }, -{ PROC_LINKS(setup_build_sh, 0), "setup_build_sh", 14, "Queries the user for several configuration options and initializes a new build shell script.", 92, "/Users/allenwebster/4ed/code/4coder_project_commands.cpp", 56, 1449 }, -{ PROC_LINKS(setup_new_project, 0), "setup_new_project", 17, "Queries the user for several configuration options and initializes a new 4coder project with build scripts for every OS.", 120, "/Users/allenwebster/4ed/code/4coder_project_commands.cpp", 56, 1436 }, -{ PROC_LINKS(show_filebar, 0), "show_filebar", 12, "Sets the current view to show it's filebar.", 43, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 464 }, -{ PROC_LINKS(show_scrollbar, 0), "show_scrollbar", 14, "Sets the current view to show it's scrollbar.", 45, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 450 }, -{ PROC_LINKS(snipe_token_or_word, 0), "snipe_token_or_word", 19, "Delete a single, whole token on or to the left of the cursor and post it to the clipboard.", 90, "/Users/allenwebster/4ed/code/4coder_seek.cpp", 44, 1259 }, -{ PROC_LINKS(snipe_token_or_word_right, 0), "snipe_token_or_word_right", 25, "Delete a single, whole token on or to the right of the cursor and post it to the clipboard.", 91, "/Users/allenwebster/4ed/code/4coder_seek.cpp", 44, 1265 }, -{ PROC_LINKS(suppress_mouse, 0), "suppress_mouse", 14, "Hides the mouse and causes all mosue input (clicks, position, wheel) to be ignored.", 83, "/Users/allenwebster/4ed/code/4coder_default_framework.cpp", 57, 193 }, -{ PROC_LINKS(swap_buffers_between_panels, 0), "swap_buffers_between_panels", 27, "Set the other non-active panel to view the buffer that the active panel views, and switch to that panel.", 104, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 1380 }, -{ PROC_LINKS(to_lowercase, 0), "to_lowercase", 12, "Converts all ascii text in the range between the cursor and the mark to lowercase.", 82, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 348 }, -{ PROC_LINKS(to_uppercase, 0), "to_uppercase", 12, "Converts all ascii text in the range between the cursor and the mark to uppercase.", 82, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 328 }, -{ PROC_LINKS(toggle_filebar, 0), "toggle_filebar", 14, "Toggles the visibility status of the current view's filebar.", 60, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 478 }, -{ PROC_LINKS(toggle_fullscreen, 0), "toggle_fullscreen", 17, "Toggle fullscreen mode on or off. The change(s) do not take effect until the next frame.", 89, "/Users/allenwebster/4ed/code/4coder_default_framework.cpp", 57, 211 }, -{ PROC_LINKS(toggle_line_wrap, 0), "toggle_line_wrap", 16, "Toggles the current buffer's line wrapping status.", 50, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 487 }, -{ PROC_LINKS(toggle_mouse, 0), "toggle_mouse", 12, "Toggles the mouse suppression mode, see suppress_mouse and allow_mouse.", 71, "/Users/allenwebster/4ed/code/4coder_default_framework.cpp", 57, 205 }, -{ PROC_LINKS(toggle_show_whitespace, 0), "toggle_show_whitespace", 22, "Toggles the current buffer's whitespace visibility status.", 58, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 554 }, -{ PROC_LINKS(toggle_virtual_whitespace, 0), "toggle_virtual_whitespace", 25, "Toggles the current buffer's virtual whitespace status.", 55, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 543 }, -{ PROC_LINKS(undo, 0), "undo", 4, "Advances backwards through the undo history.", 44, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 1397 }, -{ PROC_LINKS(view_buffer_other_panel, 0), "view_buffer_other_panel", 23, "Set the other non-active panel to view the buffer that the active panel views, and switch to that panel.", 104, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 1370 }, -{ PROC_LINKS(word_complete, 0), "word_complete", 13, "Iteratively tries completing the word to the left of the cursor with other words in open buffers that have the same prefix string.", 130, "/Users/allenwebster/4ed/code/4coder_search.cpp", 46, 820 }, -{ PROC_LINKS(write_and_auto_tab, 0), "write_and_auto_tab", 18, "Inserts a character and auto-indents the line on which the cursor sits.", 71, "/Users/allenwebster/4ed/code/4coder_auto_indent.cpp", 51, 745 }, -{ PROC_LINKS(write_block, 0), "write_block", 11, "At the cursor, insert a block comment.", 38, "/Users/allenwebster/4ed/code/4coder_combined_write_commands.cpp", 63, 106 }, -{ PROC_LINKS(write_character, 0), "write_character", 15, "Inserts whatever character was used to trigger this command.", 60, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 33 }, -{ PROC_LINKS(write_explicit_enum_flags, 0), "write_explicit_enum_flags", 25, "If the cursor is found to be on the '{' of an enum definition, the values of the enum will be filled in to give each a unique power of 2 value, starting from 1. Existing values are overwritten.", 194, "/Users/allenwebster/4ed/code/4coder_experiments.cpp", 51, 707 }, -{ PROC_LINKS(write_explicit_enum_values, 0), "write_explicit_enum_values", 26, "If the cursor is found to be on the '{' of an enum definition, the values of the enum will be filled in sequentially starting from zero. Existing values are overwritten.", 170, "/Users/allenwebster/4ed/code/4coder_experiments.cpp", 51, 701 }, -{ PROC_LINKS(write_hack, 0), "write_hack", 10, "At the cursor, insert a '// HACK' comment, includes user name if it was specified in config.4coder.", 99, "/Users/allenwebster/4ed/code/4coder_combined_write_commands.cpp", 63, 94 }, -{ PROC_LINKS(write_note, 0), "write_note", 10, "At the cursor, insert a '// NOTE' comment, includes user name if it was specified in config.4coder.", 99, "/Users/allenwebster/4ed/code/4coder_combined_write_commands.cpp", 63, 100 }, -{ PROC_LINKS(write_todo, 0), "write_todo", 10, "At the cursor, insert a '// TODO' comment, includes user name if it was specified in config.4coder.", 99, "/Users/allenwebster/4ed/code/4coder_combined_write_commands.cpp", 63, 88 }, -{ PROC_LINKS(write_underscore, 0), "write_underscore", 16, "Inserts an underscore.", 22, "/Users/allenwebster/4ed/code/4coder_base_commands.cpp", 53, 42 }, -{ PROC_LINKS(write_zero_struct, 0), "write_zero_struct", 17, "At the cursor, insert a ' = {0};'.", 34, "/Users/allenwebster/4ed/code/4coder_combined_write_commands.cpp", 63, 112 }, -}; -static int32_t fcoder_metacmd_ID_allow_mouse = 0; -static int32_t fcoder_metacmd_ID_auto_tab_line_at_cursor = 1; -static int32_t fcoder_metacmd_ID_auto_tab_range = 2; -static int32_t fcoder_metacmd_ID_auto_tab_whole_file = 3; -static int32_t fcoder_metacmd_ID_backspace_char = 4; -static int32_t fcoder_metacmd_ID_backspace_word = 5; -static int32_t fcoder_metacmd_ID_basic_change_active_panel = 6; -static int32_t fcoder_metacmd_ID_build_in_build_panel = 7; -static int32_t fcoder_metacmd_ID_build_search = 8; -static int32_t fcoder_metacmd_ID_center_view = 9; -static int32_t fcoder_metacmd_ID_change_active_panel = 10; -static int32_t fcoder_metacmd_ID_change_active_panel_backwards = 11; -static int32_t fcoder_metacmd_ID_change_to_build_panel = 12; -static int32_t fcoder_metacmd_ID_clean_all_lines = 13; -static int32_t fcoder_metacmd_ID_click_set_cursor = 14; -static int32_t fcoder_metacmd_ID_click_set_mark = 15; -static int32_t fcoder_metacmd_ID_close_all_code = 16; -static int32_t fcoder_metacmd_ID_close_build_panel = 17; -static int32_t fcoder_metacmd_ID_close_panel = 18; -static int32_t fcoder_metacmd_ID_copy = 19; -static int32_t fcoder_metacmd_ID_cursor_mark_swap = 20; -static int32_t fcoder_metacmd_ID_cut = 21; -static int32_t fcoder_metacmd_ID_decrease_face_size = 22; -static int32_t fcoder_metacmd_ID_decrease_line_wrap = 23; -static int32_t fcoder_metacmd_ID_delete_char = 24; -static int32_t fcoder_metacmd_ID_delete_current_scope = 25; -static int32_t fcoder_metacmd_ID_delete_file_query = 26; -static int32_t fcoder_metacmd_ID_delete_line = 27; -static int32_t fcoder_metacmd_ID_delete_range = 28; -static int32_t fcoder_metacmd_ID_delete_word = 29; -static int32_t fcoder_metacmd_ID_duplicate_line = 30; -static int32_t fcoder_metacmd_ID_eol_dosify = 31; -static int32_t fcoder_metacmd_ID_eol_nixify = 32; -static int32_t fcoder_metacmd_ID_execute_any_cli = 33; -static int32_t fcoder_metacmd_ID_execute_arbitrary_command = 34; -static int32_t fcoder_metacmd_ID_execute_previous_cli = 35; -static int32_t fcoder_metacmd_ID_exit_4coder = 36; -static int32_t fcoder_metacmd_ID_goto_beginning_of_file = 37; -static int32_t fcoder_metacmd_ID_goto_end_of_file = 38; -static int32_t fcoder_metacmd_ID_goto_first_jump_direct = 39; -static int32_t fcoder_metacmd_ID_goto_first_jump_same_panel_sticky = 40; -static int32_t fcoder_metacmd_ID_goto_first_jump_sticky = 41; -static int32_t fcoder_metacmd_ID_goto_jump_at_cursor_direct = 42; -static int32_t fcoder_metacmd_ID_goto_jump_at_cursor_same_panel_direct = 43; -static int32_t fcoder_metacmd_ID_goto_jump_at_cursor_same_panel_sticky = 44; -static int32_t fcoder_metacmd_ID_goto_jump_at_cursor_sticky = 45; -static int32_t fcoder_metacmd_ID_goto_line = 46; -static int32_t fcoder_metacmd_ID_goto_next_jump_direct = 47; -static int32_t fcoder_metacmd_ID_goto_next_jump_no_skips_direct = 48; -static int32_t fcoder_metacmd_ID_goto_next_jump_no_skips_sticky = 49; -static int32_t fcoder_metacmd_ID_goto_next_jump_sticky = 50; -static int32_t fcoder_metacmd_ID_goto_prev_jump_direct = 51; -static int32_t fcoder_metacmd_ID_goto_prev_jump_no_skips_direct = 52; -static int32_t fcoder_metacmd_ID_goto_prev_jump_no_skips_sticky = 53; -static int32_t fcoder_metacmd_ID_goto_prev_jump_sticky = 54; -static int32_t fcoder_metacmd_ID_hide_filebar = 55; -static int32_t fcoder_metacmd_ID_hide_scrollbar = 56; -static int32_t fcoder_metacmd_ID_highlight_next_scope_absolute = 57; -static int32_t fcoder_metacmd_ID_highlight_prev_scope_absolute = 58; -static int32_t fcoder_metacmd_ID_highlight_surrounding_scope = 59; -static int32_t fcoder_metacmd_ID_if0_off = 60; -static int32_t fcoder_metacmd_ID_increase_face_size = 61; -static int32_t fcoder_metacmd_ID_increase_line_wrap = 62; -static int32_t fcoder_metacmd_ID_interactive_kill_buffer = 63; -static int32_t fcoder_metacmd_ID_interactive_new = 64; -static int32_t fcoder_metacmd_ID_interactive_open = 65; -static int32_t fcoder_metacmd_ID_interactive_open_or_new = 66; -static int32_t fcoder_metacmd_ID_interactive_switch_buffer = 67; -static int32_t fcoder_metacmd_ID_kill_buffer = 68; -static int32_t fcoder_metacmd_ID_kill_rect = 69; -static int32_t fcoder_metacmd_ID_left_adjust_view = 70; -static int32_t fcoder_metacmd_ID_list_all_functions_current_buffer = 71; -static int32_t fcoder_metacmd_ID_list_all_locations = 72; -static int32_t fcoder_metacmd_ID_list_all_locations_case_insensitive = 73; -static int32_t fcoder_metacmd_ID_list_all_locations_of_identifier = 74; -static int32_t fcoder_metacmd_ID_list_all_locations_of_identifier_case_insensitive = 75; -static int32_t fcoder_metacmd_ID_list_all_locations_of_selection = 76; -static int32_t fcoder_metacmd_ID_list_all_locations_of_selection_case_insensitive = 77; -static int32_t fcoder_metacmd_ID_list_all_locations_of_type_definition = 78; -static int32_t fcoder_metacmd_ID_list_all_locations_of_type_definition_of_identifier = 79; -static int32_t fcoder_metacmd_ID_list_all_substring_locations = 80; -static int32_t fcoder_metacmd_ID_list_all_substring_locations_case_insensitive = 81; -static int32_t fcoder_metacmd_ID_load_project = 82; -static int32_t fcoder_metacmd_ID_make_directory_query = 83; -static int32_t fcoder_metacmd_ID_miblo_decrement_basic = 84; -static int32_t fcoder_metacmd_ID_miblo_decrement_time_stamp = 85; -static int32_t fcoder_metacmd_ID_miblo_decrement_time_stamp_minute = 86; -static int32_t fcoder_metacmd_ID_miblo_increment_basic = 87; -static int32_t fcoder_metacmd_ID_miblo_increment_time_stamp = 88; -static int32_t fcoder_metacmd_ID_miblo_increment_time_stamp_minute = 89; -static int32_t fcoder_metacmd_ID_move_down = 90; -static int32_t fcoder_metacmd_ID_move_down_10 = 91; -static int32_t fcoder_metacmd_ID_move_down_textual = 92; -static int32_t fcoder_metacmd_ID_move_left = 93; -static int32_t fcoder_metacmd_ID_move_line_down = 94; -static int32_t fcoder_metacmd_ID_move_line_up = 95; -static int32_t fcoder_metacmd_ID_move_right = 96; -static int32_t fcoder_metacmd_ID_move_up = 97; -static int32_t fcoder_metacmd_ID_move_up_10 = 98; -static int32_t fcoder_metacmd_ID_multi_line_edit = 99; -static int32_t fcoder_metacmd_ID_newline_or_goto_position_direct = 100; -static int32_t fcoder_metacmd_ID_newline_or_goto_position_same_panel_direct = 101; -static int32_t fcoder_metacmd_ID_newline_or_goto_position_same_panel_sticky = 102; -static int32_t fcoder_metacmd_ID_newline_or_goto_position_sticky = 103; -static int32_t fcoder_metacmd_ID_open_all_code = 104; -static int32_t fcoder_metacmd_ID_open_all_code_recursive = 105; -static int32_t fcoder_metacmd_ID_open_color_tweaker = 106; -static int32_t fcoder_metacmd_ID_open_file_in_quotes = 107; -static int32_t fcoder_metacmd_ID_open_in_other = 108; -static int32_t fcoder_metacmd_ID_open_long_braces = 109; -static int32_t fcoder_metacmd_ID_open_long_braces_break = 110; -static int32_t fcoder_metacmd_ID_open_long_braces_semicolon = 111; -static int32_t fcoder_metacmd_ID_open_matching_file_cpp = 112; -static int32_t fcoder_metacmd_ID_open_panel_hsplit = 113; -static int32_t fcoder_metacmd_ID_open_panel_vsplit = 114; -static int32_t fcoder_metacmd_ID_page_down = 115; -static int32_t fcoder_metacmd_ID_page_up = 116; -static int32_t fcoder_metacmd_ID_paste = 117; -static int32_t fcoder_metacmd_ID_paste_and_indent = 118; -static int32_t fcoder_metacmd_ID_paste_next = 119; -static int32_t fcoder_metacmd_ID_paste_next_and_indent = 120; -static int32_t fcoder_metacmd_ID_place_in_scope = 121; -static int32_t fcoder_metacmd_ID_project_fkey_command = 122; -static int32_t fcoder_metacmd_ID_project_go_to_root_directory = 123; -static int32_t fcoder_metacmd_ID_query_replace = 124; -static int32_t fcoder_metacmd_ID_query_replace_identifier = 125; -static int32_t fcoder_metacmd_ID_query_replace_selection = 126; -static int32_t fcoder_metacmd_ID_redo = 127; -static int32_t fcoder_metacmd_ID_remap_interactive = 128; -static int32_t fcoder_metacmd_ID_rename_file_query = 129; -static int32_t fcoder_metacmd_ID_rename_parameter = 130; -static int32_t fcoder_metacmd_ID_reopen = 131; -static int32_t fcoder_metacmd_ID_replace_all_occurrences = 132; -static int32_t fcoder_metacmd_ID_replace_in_range = 133; -static int32_t fcoder_metacmd_ID_reverse_search = 134; -static int32_t fcoder_metacmd_ID_reverse_search_identifier = 135; -static int32_t fcoder_metacmd_ID_save = 136; -static int32_t fcoder_metacmd_ID_save_all_dirty_buffers = 137; -static int32_t fcoder_metacmd_ID_save_to_query = 138; -static int32_t fcoder_metacmd_ID_scope_absorb_down = 139; -static int32_t fcoder_metacmd_ID_search = 140; -static int32_t fcoder_metacmd_ID_search_identifier = 141; -static int32_t fcoder_metacmd_ID_seek_alphanumeric_left = 142; -static int32_t fcoder_metacmd_ID_seek_alphanumeric_or_camel_left = 143; -static int32_t fcoder_metacmd_ID_seek_alphanumeric_or_camel_right = 144; -static int32_t fcoder_metacmd_ID_seek_alphanumeric_right = 145; -static int32_t fcoder_metacmd_ID_seek_beginning_of_line = 146; -static int32_t fcoder_metacmd_ID_seek_beginning_of_textual_line = 147; -static int32_t fcoder_metacmd_ID_seek_end_of_line = 148; -static int32_t fcoder_metacmd_ID_seek_end_of_textual_line = 149; -static int32_t fcoder_metacmd_ID_seek_token_left = 150; -static int32_t fcoder_metacmd_ID_seek_token_right = 151; -static int32_t fcoder_metacmd_ID_seek_white_or_token_left = 152; -static int32_t fcoder_metacmd_ID_seek_white_or_token_right = 153; -static int32_t fcoder_metacmd_ID_seek_whitespace_down = 154; -static int32_t fcoder_metacmd_ID_seek_whitespace_down_end_line = 155; -static int32_t fcoder_metacmd_ID_seek_whitespace_left = 156; -static int32_t fcoder_metacmd_ID_seek_whitespace_right = 157; -static int32_t fcoder_metacmd_ID_seek_whitespace_up = 158; -static int32_t fcoder_metacmd_ID_seek_whitespace_up_end_line = 159; -static int32_t fcoder_metacmd_ID_select_all = 160; -static int32_t fcoder_metacmd_ID_set_bindings_choose = 161; -static int32_t fcoder_metacmd_ID_set_bindings_default = 162; -static int32_t fcoder_metacmd_ID_set_bindings_mac_default = 163; -static int32_t fcoder_metacmd_ID_set_mark = 164; -static int32_t fcoder_metacmd_ID_setup_build_bat = 165; -static int32_t fcoder_metacmd_ID_setup_build_bat_and_sh = 166; -static int32_t fcoder_metacmd_ID_setup_build_sh = 167; -static int32_t fcoder_metacmd_ID_setup_new_project = 168; -static int32_t fcoder_metacmd_ID_show_filebar = 169; -static int32_t fcoder_metacmd_ID_show_scrollbar = 170; -static int32_t fcoder_metacmd_ID_snipe_token_or_word = 171; -static int32_t fcoder_metacmd_ID_snipe_token_or_word_right = 172; -static int32_t fcoder_metacmd_ID_suppress_mouse = 173; -static int32_t fcoder_metacmd_ID_swap_buffers_between_panels = 174; -static int32_t fcoder_metacmd_ID_to_lowercase = 175; -static int32_t fcoder_metacmd_ID_to_uppercase = 176; -static int32_t fcoder_metacmd_ID_toggle_filebar = 177; -static int32_t fcoder_metacmd_ID_toggle_fullscreen = 178; -static int32_t fcoder_metacmd_ID_toggle_line_wrap = 179; -static int32_t fcoder_metacmd_ID_toggle_mouse = 180; -static int32_t fcoder_metacmd_ID_toggle_show_whitespace = 181; -static int32_t fcoder_metacmd_ID_toggle_virtual_whitespace = 182; -static int32_t fcoder_metacmd_ID_undo = 183; -static int32_t fcoder_metacmd_ID_view_buffer_other_panel = 184; -static int32_t fcoder_metacmd_ID_word_complete = 185; -static int32_t fcoder_metacmd_ID_write_and_auto_tab = 186; -static int32_t fcoder_metacmd_ID_write_block = 187; -static int32_t fcoder_metacmd_ID_write_character = 188; -static int32_t fcoder_metacmd_ID_write_explicit_enum_flags = 189; -static int32_t fcoder_metacmd_ID_write_explicit_enum_values = 190; -static int32_t fcoder_metacmd_ID_write_hack = 191; -static int32_t fcoder_metacmd_ID_write_note = 192; -static int32_t fcoder_metacmd_ID_write_todo = 193; -static int32_t fcoder_metacmd_ID_write_underscore = 194; -static int32_t fcoder_metacmd_ID_write_zero_struct = 195; diff --git a/4coder_jump_sticky.cpp b/4coder_jump_sticky.cpp index 442f9f10..554e70d8 100644 --- a/4coder_jump_sticky.cpp +++ b/4coder_jump_sticky.cpp @@ -596,9 +596,6 @@ OPEN_FILE_HOOK_SIG(end_file_close_jump_list){ delete_marker_list(list); } default_end_file(app, buffer_id); - - - return(0); } diff --git a/4coder_lib/4coder_mem.h b/4coder_lib/4coder_mem.h index 6cddb344..c6c3db03 100644 --- a/4coder_lib/4coder_mem.h +++ b/4coder_lib/4coder_mem.h @@ -301,14 +301,8 @@ static i32_4tech general_memory_check(General_Memory *general){} #endif -#if !defined(PRFL_FUNC_GROUP) -#define PRFL_FUNC_GROUP() -#endif - static void* general_memory_allocate(General_Memory *general, i32_4tech size){ - PRFL_FUNC_GROUP(); - void *result = 0; if (size < BUBBLE_MIN_SIZE) size = BUBBLE_MIN_SIZE; for (Bubble *bubble = general->free_sentinel.next2; diff --git a/4coder_lib/4coder_string.h b/4coder_lib/4coder_string.h index c2e903ff..e333e832 100644 --- a/4coder_lib/4coder_string.h +++ b/4coder_lib/4coder_string.h @@ -1,5 +1,5 @@ /* -4coder_string.h - Version 1.0.111 +4coder_string.h - Version 1.0.114 no warranty implied; use at your own risk This software is in the public domain. Where that dedication is not @@ -1494,14 +1494,16 @@ string_interpret_escapes(String src, char *dst){ case 1: { - switch (src.str[i]){ - case '\\':{dst[j++] = '\\'; mode = 0;}break; - case 'n': {dst[j++] = '\n'; mode = 0;}break; - case 't': {dst[j++] = '\t'; mode = 0;}break; - case '"': {dst[j++] = '"'; mode = 0;}break; - case '\'':{dst[j++] = '\''; mode = 0;}break; - case '0': {dst[j++] = '\0'; mode = 0;}break; + char c = src.str[i]; + switch (c){ + case '\\':{dst[j++] = '\\';} break; + case 'n': {dst[j++] = '\n';} break; + case 't': {dst[j++] = '\t';} break; + case '"': {dst[j++] = '"'; } break; + case '0': {dst[j++] = '\0';} break; + default: {dst[j++] = '\\'; dst[j++] = c;}break; } + mode = 0; }break; } } diff --git a/4coder_lib/4cpp_lexer.h b/4coder_lib/4cpp_lexer.h index 4e36d424..2630d30e 100644 --- a/4coder_lib/4cpp_lexer.h +++ b/4coder_lib/4cpp_lexer.h @@ -733,7 +733,12 @@ cpp_lex_nonalloc_null_end_no_limit(Cpp_Lex_Data *S_ptr, char *chunk, i32_4tech s if (item_ptr != 0){ S.token.type = (Cpp_Token_Type)(item_ptr[1]); - S.token.flags = CPP_TFLAG_PP_DIRECTIVE; + if (CPP_PP_INCLUDE <= S.token.type && S.token.type <= CPP_PP_UNKNOWN){ + S.token.flags = CPP_TFLAG_PP_DIRECTIVE; + } + else{ + S.token.flags = 0; + } S.pp_state = (u8_4tech)cpp__pp_directive_to_state(S.token.type); break; } diff --git a/4coder_project_commands.cpp b/4coder_project_commands.cpp index ffea8a8c..15f035af 100644 --- a/4coder_project_commands.cpp +++ b/4coder_project_commands.cpp @@ -1300,11 +1300,11 @@ project_generate_project_4coder_file(Partition *scratch, fprintf(out, "command_list = {\n"); fprintf(out, " { .name = \"build\",\n"); fprintf(out, " .out = \"*compilation*\", .footer_panel = true, .save_dirty_files = true,\n"); - fprintf(out, " .cmd = { { \"%.*s.bat\", .os = \"win\" },\n", + fprintf(out, " .cmd = { { \"%.*s.bat\" , .os = \"win\" },\n", script_file.size, script_file.str); - fprintf(out, " { \"%.*s.sh\" , .os = \"linux\" },\n", + fprintf(out, " { \"./%.*s.sh\", .os = \"linux\" },\n", script_file.size, script_file.str); - fprintf(out, " { \"%.*s.sh\" , .os = \"mac\" }, }, },\n", + fprintf(out, " { \"./%.*s.sh\", .os = \"mac\" }, }, },\n", script_file.size, script_file.str); fprintf(out, " { .name = \"run\",\n"); fprintf(out, " .out = \"*run*\", .footer_panel = false, .save_dirty_files = false,\n"); diff --git a/4ed_api_implementation.cpp b/4ed_api_implementation.cpp index 207104d5..da7404a3 100644 --- a/4ed_api_implementation.cpp +++ b/4ed_api_implementation.cpp @@ -687,8 +687,6 @@ range is not within the bounds of the buffer. ) DOC_SEE(4coder_Buffer_Positioning_System) */{ - PRFL_FUNC_GROUP(); - Command_Data *cmd = (Command_Data*)app->cmd_context; Editing_File *file = imp_get_file(cmd, buffer); @@ -1308,8 +1306,6 @@ DOC(Try to create a new buffer. This call first checks to see if a buffer alrea If no buffer exists with the given name, then a new buffer is created. If a file that matches the given filename exists, the file is loaded as the contents of the new buffer. Otherwise a buffer is created without a matching file until the buffer is saved and the buffer is left blank.) DOC_SEE(Buffer_Create_Flag) */{ - PRFL_FUNC_GROUP(); - Command_Data *cmd = (Command_Data*)app->cmd_context; System_Functions *system = cmd->system; Models *models = cmd->models; diff --git a/4ed_buffer.cpp b/4ed_buffer.cpp index babdbb06..9ff7a900 100644 --- a/4ed_buffer.cpp +++ b/4ed_buffer.cpp @@ -620,8 +620,6 @@ buffer_measure_starts(Buffer_Measure_Starts *state, Gap_Buffer *buffer){ internal void buffer_measure_character_starts(System_Functions *system, Font_Pointers font, Gap_Buffer *buffer, i32 *character_starts, i32 mode, i32 virtual_white){ - PRFL_FUNC_GROUP(); - Assert(mode == 0); Gap_Buffer_Stream stream = {0}; diff --git a/4ed_code_wrap.cpp b/4ed_code_wrap.cpp index 19fe7d50..94ecbf65 100644 --- a/4ed_code_wrap.cpp +++ b/4ed_code_wrap.cpp @@ -435,8 +435,6 @@ get_current_shift(Code_Wrap_State *wrap_state, i32 next_line_start){ internal void file_measure_wraps(System_Functions *system, Mem_Options *mem, Editing_File *file, Font_Pointers font){ - PRFL_FUNC_GROUP(); - General_Memory *general = &mem->general; Partition *part = &mem->part; diff --git a/4ed_file.cpp b/4ed_file.cpp index f8c52ea3..77e1362d 100644 --- a/4ed_file.cpp +++ b/4ed_file.cpp @@ -541,8 +541,6 @@ file_grow_starts_as_needed(General_Memory *general, Gap_Buffer *buffer, i32 addi internal void file_measure_starts(General_Memory *general, Gap_Buffer *buffer){ - PRFL_FUNC_GROUP(); - if (buffer->line_starts == 0){ i32 max = buffer->line_max = KB(1); buffer->line_starts = (i32*)general_memory_allocate(general, max*sizeof(i32)); @@ -612,8 +610,6 @@ file_allocate_wrap_positions_as_needed(General_Memory *general, Editing_File *fi internal void file_create_from_string(System_Functions *system, Models *models, Editing_File *file, String val, u32 flags){ - PRFL_FUNC_GROUP(); - General_Memory *general = &models->mem.general; Partition *part = &models->mem.part; Open_File_Hook_Function *hook_open_file = models->hook_open_file; @@ -735,8 +731,6 @@ internal void init_normal_file(System_Functions *system, Models *models, char *buffer, i32 size, Editing_File *file){ - PRFL_FUNC_GROUP(); - String val = make_string(buffer, size); file_create_from_string(system, models, file, val, 0); diff --git a/4ed_font_provider_freetype.cpp b/4ed_font_provider_freetype.cpp index d345d6bc..691e2f67 100644 --- a/4ed_font_provider_freetype.cpp +++ b/4ed_font_provider_freetype.cpp @@ -492,7 +492,7 @@ Sys_Font_Face_Allocate_And_Init_Sig(system_font_face_allocate_and_init, new_sett // TODO(allen): This could be O(log n) instead of O(n) if I end up making bit manipulation helpers someday. u64 last_mask_fill = 0; if (page_slot_count%64 != 0){ - last_mask_fill = (1LLU << 63); + last_mask_fill = (1ULL << 63); for (i32 spread_step = (page_slot_count%64) - 1; spread_step > 0; --spread_step){ @@ -540,7 +540,7 @@ Sys_Font_Face_Allocate_And_Init_Sig(system_font_face_allocate_and_init, new_sett j_stop = SLOT_PER_PAGE%64; } for (i32 j = 0; j < j_stop; ++j){ - if ((is_active_v & (1LLU << j)) == 0){ + if ((is_active_v & (1ULL << j)) == 0){ index = i*64 + j; break; } @@ -554,7 +554,7 @@ Sys_Font_Face_Allocate_And_Init_Sig(system_font_face_allocate_and_init, new_sett Assert(index != -1); u64 *is_active_flags = &page_with_slot->is_active[index/64]; - u64 is_active_mask = (1LLU << (index % 64)); + u64 is_active_mask = (1ULL << (index % 64)); Font_Settings *settings = &page_with_slot->settings[index]; Font_Metrics *metrics = &page_with_slot->metrics[index]; Font_Page_Storage *pages = &page_with_slot->pages[index]; @@ -611,7 +611,7 @@ system_font_get_active_location(Face_ID font_id){ if (page->first_id <= font_id && font_id < page->first_id + SLOT_PER_PAGE){ i32 index = (i32)(font_id - page->first_id); u64 is_active_v = page->is_active[index/64]; - if ((is_active_v & (1LLU << (index%64))) != 0){ + if ((is_active_v & (1ULL << (index%64))) != 0){ result.page = page; result.index = index; } diff --git a/4ed_working_set.cpp b/4ed_working_set.cpp index 2dedbb2c..b8ffb63f 100644 --- a/4ed_working_set.cpp +++ b/4ed_working_set.cpp @@ -585,26 +585,22 @@ open_file(System_Functions *system, Models *models, String filename){ buffer_bind_file(system, general, working_set, file, canon_name.name); buffer_bind_name(models, general, part, working_set, file, front_of_directory(filename)); - i32 size = system->load_size(handle); - char *buffer = 0; - b32 gen_buffer = 0; - Temp_Memory temp = begin_temp_memory(part); - buffer = push_array(part, char, size); + i32 size = system->load_size(handle); + char *buffer = push_array(part, char, size); + b32 gen_buffer = false; if (buffer == 0){ buffer = (char*)general_memory_allocate(general, size); - Assert(buffer); - gen_buffer = 1; + Assert(buffer != 0); + gen_buffer = true; } - if (system->load_file(handle, buffer, size)){ - system->load_close(handle); + b32 good_load = system->load_file(handle, buffer, size); + system->load_close(handle); + if (good_load){ init_normal_file(system, models, buffer, size, file); } - else{ - system->load_close(handle); - } if (gen_buffer){ general_memory_free(general, buffer); diff --git a/meta/4ed_meta_generate_parser.cpp b/meta/4ed_meta_generate_parser.cpp index 89328e16..24d6e707 100644 --- a/meta/4ed_meta_generate_parser.cpp +++ b/meta/4ed_meta_generate_parser.cpp @@ -100,16 +100,16 @@ print_config_var(FILE *out, Operation *op){ fprintf(out, "%s", op->code_before); } fprintf(out, "Config_Get_Result result = config_var(config, var_name, subscript);\n"); + fprintf(out, "bool32 success = result.success && result.type == ConfigRValueType_%s;\n", type_names[op->r_type]); if (op->output_type != 0){ - fprintf(out, "if (result.success){\n"); + fprintf(out, "if (success){\n"); fprintf(out, "*var_out = result.%s;\n", op->result_type); fprintf(out, "}\n"); } if (op->code_after != 0){ - fprintf(out, "bool32 success = result.success;\n"); fprintf(out, "%s", op->code_after); } - fprintf(out, "return(result.success);\n"); + fprintf(out, "return(success);\n"); fprintf(out, "}\n\n"); fprintf(out, "static bool32\n"); @@ -127,16 +127,16 @@ print_config_var(FILE *out, Operation *op){ } fprintf(out, "String var_name_str = make_string_slowly(var_name);\n"); fprintf(out, "Config_Get_Result result = config_var(config, var_name_str, subscript);\n"); + fprintf(out, "bool32 success = result.success && result.type == ConfigRValueType_%s;\n", type_names[op->r_type]); if (op->output_type != 0){ - fprintf(out, "if (result.success){\n"); + fprintf(out, "if (success){\n"); fprintf(out, "*var_out = result.%s;\n", op->result_type); fprintf(out, "}\n"); } if (op->code_after != 0){ - fprintf(out, "bool32 success = result.success;\n"); fprintf(out, "%s", op->code_after); } - fprintf(out, "return(result.success);\n"); + fprintf(out, "return(success);\n"); fprintf(out, "}\n\n"); } @@ -157,16 +157,16 @@ print_compound_member(FILE *out, Operation *op){ fprintf(out, "%s", op->code_before); } fprintf(out, "Config_Get_Result result = config_compound_member(config, compound, var_name, index);\n"); + fprintf(out, "bool32 success = result.success && result.type == ConfigRValueType_%s;\n", type_names[op->r_type]); if (op->output_type != 0){ - fprintf(out, "if (result.success){\n"); + fprintf(out, "if (success){\n"); fprintf(out, "*var_out = result.%s;\n", op->result_type); fprintf(out, "}\n"); } if (op->code_after != 0){ - fprintf(out, "bool32 success = result.success;\n"); fprintf(out, "%s", op->code_after); } - fprintf(out, "return(result.success);\n"); + fprintf(out, "return(success);\n"); fprintf(out, "}\n\n"); fprintf(out, "static bool32\n"); @@ -185,16 +185,16 @@ print_compound_member(FILE *out, Operation *op){ fprintf(out, "%s", op->code_before); } fprintf(out, "Config_Get_Result result = config_compound_member(config, compound, var_name_str, index);\n"); + fprintf(out, "bool32 success = result.success && result.type == ConfigRValueType_%s;\n", type_names[op->r_type]); if (op->output_type != 0){ - fprintf(out, "if (result.success){\n"); + fprintf(out, "if (success){\n"); fprintf(out, "*var_out = result.%s;\n", op->result_type); fprintf(out, "}\n"); } if (op->code_after != 0){ - fprintf(out, "bool32 success = result.success;\n"); fprintf(out, "%s", op->code_after); } - fprintf(out, "return(result.success);\n"); + fprintf(out, "return(success);\n"); fprintf(out, "}\n\n"); } diff --git a/platform_linux/linux_4ed.cpp b/platform_linux/linux_4ed.cpp index 69338c3c..958b1a0d 100644 --- a/platform_linux/linux_4ed.cpp +++ b/platform_linux/linux_4ed.cpp @@ -958,8 +958,7 @@ LinuxInputInit(Display *dpy, Window XWindow){ // Keyboard handling funcs // -global Key_Code keycode_lookup_table[255]; - +#if 0 internal void LinuxKeycodeInit(Display* dpy){ @@ -976,7 +975,9 @@ LinuxKeycodeInit(Display* dpy){ struct SymMapping { KeySym sym; u16 code; - } sym_table[] = { + }; + + SymMapping sym_table[] = { { XK_BackSpace, key_back }, { XK_Delete, key_del }, { XK_Up, key_up }, @@ -1016,7 +1017,9 @@ LinuxKeycodeInit(Display* dpy){ KeySym* syms = XGetKeyboardMapping(dpy, key_min, key_count, &syms_per_code); - if (!syms) return; + if (syms == 0){ + return; + } int key = key_min; for(int i = 0; i < key_count * syms_per_code; ++i){ @@ -1029,8 +1032,8 @@ LinuxKeycodeInit(Display* dpy){ } XFree(syms); - } +#endif internal void LinuxPushKey(Key_Code code, Key_Code chr, Key_Code chr_nocaps, b8 *mods) @@ -1335,41 +1338,41 @@ LinuxX11WindowInit(int argc, char** argv, int* window_width, int* window_height) internal void LinuxHandleX11Events(void) { - static XEvent PrevEvent = {}; + static XEvent prev_event = {}; b32 should_step = false; while (XPending(linuxvars.XDisplay)) { - XEvent Event; - XNextEvent(linuxvars.XDisplay, &Event); + XEvent event; + XNextEvent(linuxvars.XDisplay, &event); - if (XFilterEvent(&Event, None) == True){ + if (XFilterEvent(&event, None) == True){ continue; } - switch (Event.type){ + switch (event.type){ case KeyPress: { should_step = true; - b32 is_hold = (PrevEvent.type == KeyRelease && - PrevEvent.xkey.time == Event.xkey.time && - PrevEvent.xkey.keycode == Event.xkey.keycode); + b32 is_hold = (prev_event.type == KeyRelease && + prev_event.xkey.time == event.xkey.time && + prev_event.xkey.keycode == event.xkey.keycode); b8 mods[MDFR_INDEX_COUNT] = {}; mods[MDFR_HOLD_INDEX] = is_hold; - if (Event.xkey.state & ShiftMask) mods[MDFR_SHIFT_INDEX] = 1; - if (Event.xkey.state & ControlMask) mods[MDFR_CONTROL_INDEX] = 1; - if (Event.xkey.state & LockMask) mods[MDFR_CAPS_INDEX] = 1; - if (Event.xkey.state & Mod1Mask) mods[MDFR_ALT_INDEX] = 1; + if (event.xkey.state & ShiftMask) mods[MDFR_SHIFT_INDEX] = 1; + if (event.xkey.state & ControlMask) mods[MDFR_CONTROL_INDEX] = 1; + if (event.xkey.state & LockMask) mods[MDFR_CAPS_INDEX] = 1; + if (event.xkey.state & Mod1Mask) mods[MDFR_ALT_INDEX] = 1; - Event.xkey.state &= ~(ControlMask); + event.xkey.state &= ~(ControlMask); Status status; KeySym keysym = NoSymbol; u8 buff[32] = {}; - Xutf8LookupString(linuxvars.input_context, &Event.xkey, (char*)buff, sizeof(buff) - 1, &keysym, &status); + Xutf8LookupString(linuxvars.input_context, &event.xkey, (char*)buff, sizeof(buff) - 1, &keysym, &status); if (status == XBufferOverflow){ //TODO(inso): handle properly @@ -1378,14 +1381,26 @@ LinuxHandleX11Events(void) LOG("FIXME: XBufferOverflow from LookupString.\n"); } + // don't push modifiers + if (keysym >= XK_Shift_L && keysym <= XK_Hyper_R){ + break; + } + u32 key = utf8_to_u32_unchecked(buff); u32 key_no_caps = key; - if (mods[MDFR_CAPS_INDEX] && status == XLookupBoth && Event.xkey.keycode){ + if (mods[MDFR_CAPS_INDEX] && status == XLookupBoth && event.xkey.keycode){ u8 buff_no_caps[32] = {0}; - Event.xkey.state &= ~(LockMask); + event.xkey.state &= ~(LockMask); - XLookupString(&Event.xkey, (char*)buff_no_caps, sizeof(buff_no_caps) - 1, NULL, NULL); + Xutf8LookupString(linuxvars.input_context, &event.xkey, (char*)buff_no_caps, sizeof(buff_no_caps) - 1, NULL, &status); + + if (status == XBufferOverflow){ + //TODO(inso): handle properly + Xutf8ResetIC(linuxvars.input_context); + XSetICFocus(linuxvars.input_context); + LOG("FIXME: XBufferOverflow from LookupString.\n"); + } if (*buff_no_caps){ key_no_caps = utf8_to_u32_unchecked(buff_no_caps); @@ -1395,21 +1410,160 @@ LinuxHandleX11Events(void) if (key == '\r') key = '\n'; if (key_no_caps == '\r') key_no_caps = '\n'; - // don't push modifiers - if (keysym >= XK_Shift_L && keysym <= XK_Hyper_R){ - break; - } - if (keysym == XK_ISO_Left_Tab){ key = key_no_caps = '\t'; mods[MDFR_SHIFT_INDEX] = 1; } - Key_Code special_key = keycode_lookup_table[(u8)Event.xkey.keycode]; + //Key_Code special_key = keycode_lookup_table[keysym]; + + Key_Code special_key = 0; + switch (keysym){ + case XK_BackSpace: + { + special_key = key_back; + }break; + + case XK_Delete: + { + special_key = key_del; + }break; + + case XK_Up: + { + special_key = key_up; + }break; + + case XK_Down: + { + special_key = key_down; + }break; + + case XK_Left: + { + special_key = key_left; + }break; + + case XK_Right: + { + special_key = key_right; + }break; + + case XK_Insert: + { + special_key = key_insert; + }break; + + case XK_Home: + { + special_key = key_home; + }break; + + case XK_End: + { + special_key = key_end; + }break; + + case XK_Page_Up: + { + special_key = key_page_up; + }break; + + case XK_Page_Down: + { + special_key = key_page_down; + }break; + + case XK_Escape: + { + special_key = key_esc; + }break; + + case XK_F1: + { + special_key = key_f1; + }break; + + case XK_F2: + { + special_key = key_f2; + }break; + + case XK_F3: + { + special_key = key_f3; + }break; + + case XK_F4: + { + special_key = key_f4; + }break; + + case XK_F5: + { + special_key = key_f5; + }break; + + case XK_F6: + { + special_key = key_f6; + }break; + + case XK_F7: + { + special_key = key_f7; + }break; + + case XK_F8: + { + special_key = key_f8; + }break; + + case XK_F9: + { + special_key = key_f9; + }break; + + case XK_F10: + { + special_key = key_f10; + }break; + + case XK_F11: + { + special_key = key_f11; + }break; + + case XK_F12: + { + special_key = key_f12; + }break; + + case XK_F13: + { + special_key = key_f13; + }break; + + case XK_F14: + { + special_key = key_f14; + }break; + + case XK_F15: + { + special_key = key_f15; + }break; + + case XK_F16: + { + special_key = key_f16; + }break; + } + if (special_key){ LinuxPushKey(special_key, 0, 0, mods); - } else if (key < 256){ + } else if (key != 0){ LinuxPushKey(key, key, key_no_caps, mods); } else { LinuxPushKey(0, 0, 0, mods); @@ -1422,13 +1576,13 @@ LinuxHandleX11Events(void) case MotionNotify: { should_step = true; - linuxvars.input.mouse.x = Event.xmotion.x; - linuxvars.input.mouse.y = Event.xmotion.y; + linuxvars.input.mouse.x = event.xmotion.x; + linuxvars.input.mouse.y = event.xmotion.y; }break; case ButtonPress: { should_step = true; - switch(Event.xbutton.button){ + switch(event.xbutton.button){ case Button1: { linuxvars.input.mouse.press_l = 1; linuxvars.input.mouse.l = 1; @@ -1452,7 +1606,7 @@ LinuxHandleX11Events(void) case ButtonRelease: { should_step = true; - switch(Event.xbutton.button){ + switch(event.xbutton.button){ case Button1: { linuxvars.input.mouse.release_l = 1; linuxvars.input.mouse.l = 0; @@ -1483,8 +1637,8 @@ LinuxHandleX11Events(void) case ConfigureNotify: { should_step = true; - i32 w = Event.xconfigure.width; - i32 h = Event.xconfigure.height; + i32 w = event.xconfigure.width; + i32 h = event.xconfigure.height; if (w != target.width || h != target.height){ LinuxResizeTarget(w, h); @@ -1492,32 +1646,31 @@ LinuxHandleX11Events(void) }break; case MappingNotify: { - if (Event.xmapping.request == MappingModifier || Event.xmapping.request == MappingKeyboard){ - XRefreshKeyboardMapping(&Event.xmapping); - LinuxKeycodeInit(linuxvars.XDisplay); + if (event.xmapping.request == MappingModifier || event.xmapping.request == MappingKeyboard){ + XRefreshKeyboardMapping(&event.xmapping); + //LinuxKeycodeInit(linuxvars.XDisplay); } }break; case ClientMessage: { - if ((Atom)Event.xclient.data.l[0] == linuxvars.atom_WM_DELETE_WINDOW) { + if ((Atom)event.xclient.data.l[0] == linuxvars.atom_WM_DELETE_WINDOW) { should_step = true; linuxvars.keep_running = 0; } - else if ((Atom)Event.xclient.data.l[0] == linuxvars.atom__NET_WM_PING) { - Event.xclient.window = DefaultRootWindow(linuxvars.XDisplay); + else if ((Atom)event.xclient.data.l[0] == linuxvars.atom__NET_WM_PING) { + event.xclient.window = DefaultRootWindow(linuxvars.XDisplay); XSendEvent( linuxvars.XDisplay, - Event.xclient.window, + event.xclient.window, False, SubstructureRedirectMask | SubstructureNotifyMask, - &Event - ); + &event); } }break; // NOTE(inso): Someone wants us to give them the clipboard data. case SelectionRequest: { - XSelectionRequestEvent request = Event.xselectionrequest; + XSelectionRequestEvent request = event.xselectionrequest; XSelectionEvent response = {}; response.type = SelectionNotify; @@ -1582,14 +1735,14 @@ LinuxHandleX11Events(void) // NOTE(inso): Another program is now the clipboard owner. case SelectionClear: { - if (Event.xselectionclear.selection == linuxvars.atom_CLIPBOARD){ + if (event.xselectionclear.selection == linuxvars.atom_CLIPBOARD){ linuxvars.clipboard_outgoing.size = 0; } }break; // NOTE(inso): A program is giving us the clipboard data we asked for. case SelectionNotify: { - XSelectionEvent* e = (XSelectionEvent*)&Event; + XSelectionEvent* e = (XSelectionEvent*)&event; if (e->selection == linuxvars.atom_CLIPBOARD && e->target == linuxvars.atom_UTF8_STRING && e->property != None){ Atom type; int fmt; @@ -1617,8 +1770,8 @@ LinuxHandleX11Events(void) }break; default: { - if (Event.type == linuxvars.xfixes_selection_event){ - XFixesSelectionNotifyEvent* sne = (XFixesSelectionNotifyEvent*)&Event; + if (event.type == linuxvars.xfixes_selection_event){ + XFixesSelectionNotifyEvent* sne = (XFixesSelectionNotifyEvent*)&event; if (sne->subtype == XFixesSelectionNotify && sne->owner != linuxvars.XWindow){ XConvertSelection(linuxvars.XDisplay, linuxvars.atom_CLIPBOARD, linuxvars.atom_UTF8_STRING, linuxvars.atom_CLIPBOARD, linuxvars.XWindow, CurrentTime); } @@ -1626,7 +1779,7 @@ LinuxHandleX11Events(void) }break; } - PrevEvent = Event; + prev_event = event; } if (should_step){ @@ -1769,7 +1922,7 @@ main(int argc, char **argv){ linuxvars.input_style = input_result.best_style; linuxvars.input_context = input_result.xic; - LinuxKeycodeInit(linuxvars.XDisplay); + //LinuxKeycodeInit(linuxvars.XDisplay); Cursor xcursors[APP_MOUSE_CURSOR_COUNT] = { None, diff --git a/platform_unix/unix_4ed_functions.cpp b/platform_unix/unix_4ed_functions.cpp index 08964dff..3e975376 100644 --- a/platform_unix/unix_4ed_functions.cpp +++ b/platform_unix/unix_4ed_functions.cpp @@ -204,20 +204,20 @@ Sys_Set_File_List_Sig(system_set_file_list){ entry != 0; entry = readdir(d)){ char *fname = entry->d_name; - if (match_cc(fname, ".") || match_cc(fname, "..")){ + if (match(fname, ".") || match(fname, "..")){ continue; } char *cursor_start = cursor; i32 length = copy_fast_unsafe_cc(cursor_start, fname); cursor += length; - if(entry->d_type == DT_LNK){ + if (entry->d_type == DT_LNK){ struct stat st; - if(stat(entry->d_name, &st) != -1){ + if (stat(entry->d_name, &st) != -1){ info_ptr->folder = S_ISDIR(st.st_mode); } else{ - info_ptr->folder = 0; + info_ptr->folder = false; } } else{ diff --git a/platform_win32/win32_4ed_functions.cpp b/platform_win32/win32_4ed_functions.cpp index 2d700bcd..dc1e3d06 100644 --- a/platform_win32/win32_4ed_functions.cpp +++ b/platform_win32/win32_4ed_functions.cpp @@ -134,11 +134,9 @@ Sys_Set_File_List_Sig(system_set_file_list){ DWORD final_length = GetFinalPathNameByHandle_utf8(dir_handle, (u8*)dir_space, sizeof(dir_space), 0); CloseHandle(dir_handle); - if (final_length < sizeof(dir_space)){ + if (final_length + 2 < sizeof(dir_space)){ u8 *c_str_dir = (u8*)dir_space; - final_length -= 4; - memmove(c_str_dir, c_str_dir+4, final_length); c_str_dir[final_length] = '\\'; c_str_dir[final_length+1] = '*'; c_str_dir[final_length+2] = 0; @@ -253,7 +251,11 @@ Sys_Get_Canonical_Sig(system_get_canonical){ u32 result = 0; char src_space[MAX_PATH + 32]; - if (len < sizeof(src_space) && len >= 2 && ((filename[0] >= 'a' && filename[0] <= 'z') || (filename[0] >= 'A' && filename[0] <= 'Z')) && filename[1] == ':'){ + if (len < sizeof(src_space) && + (len >= 2 && + ((filename[0] >= 'a' && filename[0] <= 'z') || + (filename[0] >= 'A' && filename[0] <= 'Z')) && filename[1] == ':') || + (filename[0] == '\\' && filename[1] == '\\')){ memcpy(src_space, filename, len); src_space[len] = 0; @@ -263,11 +265,11 @@ Sys_Get_Canonical_Sig(system_get_canonical){ DWORD final_length = GetFinalPathNameByHandle_utf8(file, (u8*)buffer, max, 0); if (final_length < max && final_length >= 4){ - if (buffer[final_length-1] == 0){ + if (buffer[final_length - 1] == 0){ --final_length; } - final_length -= 4; - memmove(buffer, buffer+4, final_length); + //final_length -= 4; + //memmove(buffer, buffer+4, final_length); buffer[final_length] = 0; result = final_length; } diff --git a/project.4coder b/project.4coder index d8c6beb7..b4bfaa05 100644 --- a/project.4coder +++ b/project.4coder @@ -26,20 +26,20 @@ build_x86_mac = "echo build: x86 & ./build.sh -DDEV_BUILD_X86"; command_list = { { .name = "build x64", - .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = true, + .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cmd = { {"echo build: x64 & build.bat" , .os = "win" }, {"echo build: x64 & ./build.sh", .os = "linux"}, {"echo build: x64 & ./build.sh", .os = "mac" }, }, }, { .name = "build site", .out = "*site*", .footer_panel = false, .save_dirty_files = true, .cmd = { {"build_site.bat", .os = "win" }, - {"build_site.sh" , .os = "linux"}, - {"build_site.sh" , .os = "mac" }, }, }, + {"./build_site.sh" , .os = "linux"}, + {"./build_site.sh" , .os = "mac" }, }, }, { .name = "build string", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cmd = { {"build_string.bat", .os = "win" }, - {"build_string.sh" , .os = "linux"}, - {"build_string.sh" , .os = "mac" }, }, }, + {"./build_string.sh" , .os = "linux"}, + {"./build_string.sh" , .os = "mac" }, }, }, { .name = "build x86", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cmd = { {build_x86_win32, .os = "win" }, @@ -48,18 +48,18 @@ command_list = { { .name = "build metadata", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cmd = { {"build_metadata.bat", .os = "win" }, - {"build_metadata.sh" , .os = "linux"}, - {"build_metadata.sh" , .os = "mac" }, }, }, + {"./build_metadata.sh" , .os = "linux"}, + {"./build_metadata.sh" , .os = "mac" }, }, }, { .name = "package", .out = "*package*", .footer_panel = false, .save_dirty_files = true, .cmd = { {"package.bat", .os = "win" }, - {"package.sh" , .os = "linux"}, - {"package.sh" , .os = "mac" }, }, }, + {"./package.sh" , .os = "linux"}, + {"./package.sh" , .os = "mac" }, }, }, { .name = "build config parser generator", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cmd = { {"build_config_parser_generator.bat", .os = "win" }, - {"build_config_parser_generator.sh" , .os = "linux"}, - {"build_config_parser_generator.sh" , .os = "mac" }, }, }, + {"./build_config_parser_generator.sh" , .os = "linux"}, + {"./build_config_parser_generator.sh" , .os = "mac" }, }, }, { .name = "generate config parser", .out = "*gen*", .footer_panel = false, .save_dirty_files = true, .cmd = { {"..\\build\\generate_config_parser", .os = "win" }, diff --git a/release-config.4coder b/release-config.4coder index 6de0c703..cea56a1a 100644 --- a/release-config.4coder +++ b/release-config.4coder @@ -11,6 +11,7 @@ use_scroll_bars = false; use_file_bars = true; // Code Wrapping +enable_virtual_whitespace = true; enable_code_wrapping = true; automatically_adjust_wrapping = true; default_wrap_width = 672; diff --git a/site/source_material/tutorials.txt b/site/source_material/tutorials.txt index c26d7aa9..6f938805 100644 --- a/site/source_material/tutorials.txt +++ b/site/source_material/tutorials.txt @@ -5,13 +5,9 @@ Getting started with 4coder and navigating your files: \VIDEO{youtube:h5cbOcnSrcc} -Setting up and navigating your project with 4coder: +Creating and using a "version(1)" project in 4coder: -\VIDEO{youtube:glPEpaT6GH0} - -Extending your project with a project.4coder file: - -\VIDEO{youtube:iZLtS3IoatE} +\VIDEO{youtube:FX8WPI2WGVI} Using customizable keywords in the 4coder custom API: diff --git a/string/4coder_string_build_num.txt b/string/4coder_string_build_num.txt index cb029319..e7d513d1 100644 --- a/string/4coder_string_build_num.txt +++ b/string/4coder_string_build_num.txt @@ -1,5 +1,5 @@ 1 0 -112 +115 diff --git a/string/internal_4coder_string.cpp b/string/internal_4coder_string.cpp index 4882a8aa..b5b165c8 100644 --- a/string/internal_4coder_string.cpp +++ b/string/internal_4coder_string.cpp @@ -1257,13 +1257,16 @@ string_interpret_escapes(String src, char *dst){ case 1: { - switch (src.str[i]){ - case '\\':{dst[j++] = '\\'; mode = 0;}break; - case 'n': {dst[j++] = '\n'; mode = 0;}break; - case 't': {dst[j++] = '\t'; mode = 0;}break; - case '"': {dst[j++] = '"'; mode = 0;}break; - case '0': {dst[j++] = '\0'; mode = 0;}break; + char c = src.str[i]; + switch (c){ + case '\\':{dst[j++] = '\\';} break; + case 'n': {dst[j++] = '\n';} break; + case 't': {dst[j++] = '\t';} break; + case '"': {dst[j++] = '"'; } break; + case '0': {dst[j++] = '\0';} break; + default: {dst[j++] = '\\'; dst[j++] = c;}break; } + mode = 0; }break; } }