From 6755d4e9ca529ce784c60b8324617ce1b71e412c Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Thu, 24 Oct 2019 23:17:54 -0700 Subject: [PATCH] Organizing listers as simple 'get_*_from_user' functions --- 4ed_edit.cpp | 6 +- custom/4coder_base_commands.cpp | 4 +- custom/4coder_command_map.cpp | 141 ++++--- custom/4coder_config.cpp | 53 ++- custom/4coder_default_hooks.cpp | 35 +- custom/4coder_lister_base.cpp | 164 +++++++- custom/4coder_lister_base.h | 22 +- custom/4coder_lists.cpp | 458 +++++++++-------------- custom/4coder_profile_inspect.cpp | 67 ++-- custom/4coder_profile_static_disable.cpp | 4 + custom/4coder_profile_static_enable.cpp | 10 + custom/4coder_project_commands.cpp | 149 ++++---- custom/4coder_scope_commands.cpp | 42 ++- custom/4coder_types.h | 15 +- custom/generated/command_metadata.h | 308 +++++++-------- custom/generated/remapping.h | 2 + 16 files changed, 858 insertions(+), 622 deletions(-) diff --git a/4ed_edit.cpp b/4ed_edit.cpp index 1d9a28d1..b1b93040 100644 --- a/4ed_edit.cpp +++ b/4ed_edit.cpp @@ -178,7 +178,8 @@ edit_fix_markers(Thread_Context *tctx, Models *models, Editing_File *file, Edit } internal void -edit_single(Thread_Context *tctx, Models *models, Editing_File *file, Interval_i64 range, String_Const_u8 string, Edit_Behaviors behaviors){ +edit_single(Thread_Context *tctx, Models *models, Editing_File *file, + Interval_i64 range, String_Const_u8 string, Edit_Behaviors behaviors){ Edit edit = {}; edit.text = string; edit.range = range; @@ -391,7 +392,8 @@ edit_merge_history_range(Thread_Context *tctx, Models *models, Editing_File *fil } internal b32 -edit_batch(Thread_Context *tctx, Models *models, Editing_File *file, Batch_Edit *batch, Edit_Behaviors behaviors){ +edit_batch(Thread_Context *tctx, Models *models, Editing_File *file, + Batch_Edit *batch, Edit_Behaviors behaviors){ b32 result = true; if (batch != 0){ History_Record_Index start_index = 0; diff --git a/custom/4coder_base_commands.cpp b/custom/4coder_base_commands.cpp index 06e7fc3d..8bb14721 100644 --- a/custom/4coder_base_commands.cpp +++ b/custom/4coder_base_commands.cpp @@ -7,6 +7,7 @@ moving the cursor, which work even without the default 4coder framework. function void write_character_parameter(Application_Links *app, String_Const_u8 insert){ + ProfileScope(app, "write character"); if (insert.str != 0 && insert.size > 0){ View_ID view = get_active_view(app, Access_ReadWriteVisible); if_view_has_highlighted_range_delete_range(app, view); @@ -280,6 +281,7 @@ CUSTOM_DOC("Reads the scroll wheel value from the mouse state and scrolls accord internal void move_vertical_pixels(Application_Links *app, View_ID view, f32 pixels){ + ProfileScope(app, "move vertical pixels"); i64 pos = view_get_cursor_pos(app, view); Buffer_Cursor cursor = view_compute_cursor(app, view, seek_pos(pos)); Vec2_f32 p = view_relative_xy_of_pos(app, view, cursor.line, pos); @@ -379,7 +381,6 @@ seek_blank_line(Application_Links *app, Scan_Direction direction, Position_Withi { new_pos = get_pos_past_lead_whitespace(app, buffer, new_pos); }break; - case PositionWithinLine_End: { new_pos = get_line_side_pos_from_pos(app, buffer, new_pos, Side_Max); @@ -584,6 +585,7 @@ CUSTOM_DOC("Converts all ascii text in the range between the cursor and the mark CUSTOM_COMMAND_SIG(clean_all_lines) CUSTOM_DOC("Removes trailing whitespace from all lines in the current buffer.") { + ProfileScope(app, "clean all lines"); View_ID view = get_active_view(app, Access_ReadWriteVisible); Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible); diff --git a/custom/4coder_command_map.cpp b/custom/4coder_command_map.cpp index 8579b7b0..a64b4140 100644 --- a/custom/4coder_command_map.cpp +++ b/custom/4coder_command_map.cpp @@ -9,12 +9,12 @@ // TOP -internal u64 +function u64 mapping__key(Input_Event_Kind kind, u32 sub_code){ return((((u64)kind) << 32) | sub_code); } -internal Command_Map* +function Command_Map* mapping__alloc_map(Mapping *mapping){ Command_Map *result = mapping->free_maps; if (result != 0){ @@ -26,12 +26,12 @@ mapping__alloc_map(Mapping *mapping){ return(result); } -internal void +function void mapping__free_map(Mapping *mapping, Command_Map *map){ sll_stack_push(mapping->free_maps, map); } -internal Command_Modified_Binding* +function Command_Modified_Binding* mapping__alloc_modified_binding(Mapping *mapping){ Command_Modified_Binding *result = mapping->free_bindings; if (result != 0){ @@ -43,12 +43,12 @@ mapping__alloc_modified_binding(Mapping *mapping){ return(result); } -internal void +function void mapping__free_modified_binding(Mapping *mapping, Command_Modified_Binding *binding){ sll_stack_push(mapping->free_bindings, binding); } -internal Command_Binding_List* +function Command_Binding_List* mapping__alloc_binding_list(Mapping *mapping){ Command_Binding_List *result = mapping->free_lists; if (result != 0){ @@ -60,12 +60,12 @@ mapping__alloc_binding_list(Mapping *mapping){ return(result); } -internal void +function void mapping__free_binding_list(Mapping *mapping, Command_Binding_List *binding_list){ sll_stack_push(mapping->free_lists, binding_list); } -internal Command_Binding_List* +function Command_Binding_List* map__get_list(Command_Map *map, u64 key){ Command_Binding_List *result = 0; Table_Lookup lookup = table_lookup(&map->event_code_to_binding_list, key); @@ -77,7 +77,7 @@ map__get_list(Command_Map *map, u64 key){ return(result); } -internal Command_Binding_List* +function Command_Binding_List* map__get_or_make_list(Mapping *mapping, Command_Map *map, u64 key){ Command_Binding_List *result = map__get_list(map, key); if (result == 0){ @@ -91,7 +91,7 @@ map__get_or_make_list(Mapping *mapping, Command_Map *map, u64 key){ //////////////////////////////// -internal void +function void mapping_init(Thread_Context *tctx, Mapping *mapping){ block_zero_struct(mapping); mapping->node_arena = reserve_arena(tctx); @@ -101,7 +101,7 @@ mapping_init(Thread_Context *tctx, Mapping *mapping){ mapping->id_counter = 1; } -internal void +function void mapping_release(Thread_Context *tctx, Mapping *mapping){ if (mapping->node_arena != 0){ release_arena(tctx, mapping->node_arena); @@ -109,15 +109,16 @@ mapping_release(Thread_Context *tctx, Mapping *mapping){ } } -internal void +function void map__init(Mapping *mapping, Command_Map *map, Command_Map_ID id){ block_zero_struct(map); map->id = id; map->node_arena = make_arena(&mapping->heap_wrapper, KB(2)); map->event_code_to_binding_list = make_table_u64_u64(&mapping->heap_wrapper, 100); + map->cmd_to_binding_trigger = make_table_u64_u64(&mapping->heap_wrapper, 100); } -internal Command_Map* +function Command_Map* mapping_begin_new_map(Mapping *mapping){ Command_Map *map = mapping__alloc_map(mapping); map__init(mapping, map, mapping->id_counter); @@ -126,7 +127,7 @@ mapping_begin_new_map(Mapping *mapping){ return(map); } -internal Command_Map* +function Command_Map* mapping_get_map(Mapping *mapping, Command_Map_ID id){ Command_Map *result = 0; Table_Lookup lookup = table_lookup(&mapping->id_to_map, id); @@ -138,7 +139,7 @@ mapping_get_map(Mapping *mapping, Command_Map_ID id){ return(result); } -internal Command_Map_ID +function Command_Map_ID mapping_validate_id(Mapping *mapping, Command_Map_ID id){ Table_Lookup lookup = table_lookup(&mapping->id_to_map, id); if (!lookup.found_match){ @@ -147,7 +148,7 @@ mapping_validate_id(Mapping *mapping, Command_Map_ID id){ return(id); } -internal Command_Map* +function Command_Map* mapping_get_or_make_map(Mapping *mapping, Command_Map_ID id){ Command_Map *result = mapping_get_map(mapping, id); if (result == 0){ @@ -158,7 +159,7 @@ mapping_get_or_make_map(Mapping *mapping, Command_Map_ID id){ return(result); } -internal void +function void mapping_release_map(Mapping *mapping, Command_Map *map){ table_erase(&mapping->id_to_map, map->id); if (map->binding_last != 0){ @@ -173,7 +174,7 @@ mapping_release_map(Mapping *mapping, Command_Map *map){ linalloc_clear(&map->node_arena); } -internal Command_Binding +function Command_Binding map_get_binding_non_recursive(Command_Map *map, Input_Event *event){ Command_Binding result = {}; @@ -234,10 +235,10 @@ map_get_binding_non_recursive(Command_Map *map, Input_Event *event){ node != 0; node = node->next){ Command_Modified_Binding *mod_binding = CastFromMember(Command_Modified_Binding, order_node, node); - Input_Modifier_Set *binding_modifiers = &mod_binding->modifiers; + Input_Modifier_Set *binding_mod_set = &mod_binding->mods; b32 is_a_match = true; - i32 binding_mod_count = binding_modifiers->count; - Key_Code *binding_mods = binding_modifiers->mods; + i32 binding_mod_count = binding_mod_set->count; + Key_Code *binding_mods = binding_mod_set->mods; for (i32 i = 0; i < binding_mod_count; i += 1){ if (!has_modifier(mods, binding_mods[i])){ is_a_match = false; @@ -261,7 +262,7 @@ map_get_binding_non_recursive(Command_Map *map, Input_Event *event){ return(result); } -internal Command_Binding +function Command_Binding map_get_binding_recursive(Mapping *mapping, Command_Map *map, Input_Event *event){ Command_Binding result = {}; for (i32 safety_counter = 0; @@ -276,21 +277,58 @@ map_get_binding_recursive(Mapping *mapping, Command_Map *map, Input_Event *event return(result); } -internal void +function void map_set_parent(Command_Map *map, Command_Map *parent){ if (map != 0 && parent != 0){ map->parent = parent->id; } } -internal void +function void map_null_parent(Command_Map *map){ map->parent = 0; } -internal void +function void +map__command_add_trigger(Command_Map *map, Custom_Command_Function *custom, + Command_Trigger *trigger){ + if (map != 0){ + u64 key = (u64)(PtrAsInt(custom)); + Table_Lookup lookup = table_lookup(&map->cmd_to_binding_trigger, key); + Command_Trigger_List *list = 0; + if (!lookup.found_match){ + list = push_array_zero(&map->node_arena, Command_Trigger_List, 1); + table_insert(&map->cmd_to_binding_trigger, key, (u64)(PtrAsInt(list))); + } + else{ + u64 val = 0; + table_read(&map->cmd_to_binding_trigger, lookup, &val); + list = (Command_Trigger_List*)IntAsPtr(val); + } + Command_Trigger *trigger_ptr = push_array(&map->node_arena, Command_Trigger, 1); + block_copy_struct(trigger_ptr, trigger); + sll_queue_push(list->first, list->last, trigger_ptr); + } +} + +function Command_Trigger_List +map_get_triggers(Command_Map *map, Custom_Command_Function *custom){ + Command_Trigger_List result = {}; + if (map != 0){ + u64 key = (u64)(PtrAsInt(custom)); + Table_Lookup lookup = table_lookup(&map->cmd_to_binding_trigger, key); + if (lookup.found_match){ + u64 val = 0; + table_read(&map->cmd_to_binding_trigger, lookup, &val); + result = *(Command_Trigger_List*)IntAsPtr(val); + } + } + return(result); +} + +function void map_set_binding(Mapping *mapping, Command_Map *map, Custom_Command_Function *custom, - u32 code1, u32 code2, Input_Modifier_Set *modifiers){ + u32 code1, u32 code2, Input_Modifier_Set *mods){ if (map != 0){ u64 key = mapping__key(code1, code2); Command_Binding_List *list = map__get_or_make_list(mapping, map, key); @@ -304,37 +342,46 @@ map_set_binding(Mapping *mapping, Command_Map *map, Custom_Command_Function *cus list->last= list->first; } list->count += 1; - mod_binding->modifiers = copy_modifier_set(&map->node_arena, modifiers); + mod_binding->mods = copy_modifier_set(&map->node_arena, mods); mod_binding->binding.custom = custom; + + Command_Trigger trigger = {}; + trigger.kind = code1; + trigger.sub_code = code2; + trigger.mods = mod_binding->mods; + map__command_add_trigger(map, custom, &trigger); } } -internal void +function void map_set_binding_key(Mapping *mapping, Command_Map *map, Custom_Command_Function *custom, Key_Code code, Input_Modifier_Set *modifiers){ map_set_binding(mapping, map, custom, InputEventKind_KeyStroke, code, modifiers); } -internal void +function void map_set_binding_mouse(Mapping *mapping, Command_Map *map, Custom_Command_Function *custom, Mouse_Code code, Input_Modifier_Set *modifiers){ map_set_binding(mapping, map, custom, InputEventKind_MouseButton, code, modifiers); } -internal void +function void map_set_binding_core(Mapping *mapping, Command_Map *map, Custom_Command_Function *custom, Core_Code code, Input_Modifier_Set *modifiers){ map_set_binding(mapping, map, custom, InputEventKind_Core, code, modifiers); } -internal void +function void map_set_binding_text_input(Command_Map *map, Custom_Command_Function *custom){ if (map != 0){ map->text_input_command.custom = custom; + Command_Trigger trigger = {}; + trigger.kind = InputEventKind_TextInsert; + map__command_add_trigger(map, custom, &trigger); } } -internal Command_Binding_List* +function Command_Binding_List* map_get_binding_list_on_key(Command_Map *map, Key_Code code){ Command_Binding_List *result = 0; if (map != 0){ @@ -344,7 +391,7 @@ map_get_binding_list_on_key(Command_Map *map, Key_Code code){ return(result); } -internal Command_Binding_List* +function Command_Binding_List* map_get_binding_list_on_mouse_button(Command_Map *map, Mouse_Code code){ Command_Binding_List *result = 0; if (map != 0){ @@ -354,7 +401,7 @@ map_get_binding_list_on_mouse_button(Command_Map *map, Mouse_Code code){ return(result); } -internal Command_Binding_List* +function Command_Binding_List* map_get_binding_list_on_core(Command_Map *map, Core_Code code){ Command_Binding_List *result = 0; if (map != 0){ @@ -366,72 +413,72 @@ map_get_binding_list_on_core(Command_Map *map, Core_Code code){ //////////////////////////////// -internal void +function void map_set_parent(Mapping *mapping, Command_Map_ID map_id, Command_Map_ID parent_id){ Command_Map *map = mapping_get_map(mapping, map_id); Command_Map *parent = mapping_get_map(mapping, parent_id); map_set_parent(map, parent); } -internal void +function void map_set_parent(Mapping *mapping, Command_Map *map, Command_Map_ID parent_id){ Command_Map *parent = mapping_get_map(mapping, parent_id); map_set_parent(map, parent); } -internal void +function void map_null_parent(Mapping *mapping, Command_Map_ID map_id){ Command_Map *map = mapping_get_map(mapping, map_id); map_null_parent(map); } -internal void +function void map_set_binding(Mapping *mapping, Command_Map_ID map_id, Custom_Command_Function *custom, u32 code1, u32 code2, Input_Modifier_Set *modifiers){ Command_Map *map = mapping_get_map(mapping, map_id); map_set_binding(mapping, map, custom, code1, code2, modifiers); } -internal void +function void map_set_binding_key(Mapping *mapping, Command_Map_ID map_id, Custom_Command_Function *custom, Key_Code code, Input_Modifier_Set *modifiers){ Command_Map *map = mapping_get_map(mapping, map_id); map_set_binding_key(mapping, map, custom, code, modifiers); } -internal void +function void map_set_binding_mouse(Mapping *mapping, Command_Map_ID map_id, Custom_Command_Function *custom, Mouse_Code code, Input_Modifier_Set *modifiers){ Command_Map *map = mapping_get_map(mapping, map_id); map_set_binding_mouse(mapping, map, custom, code, modifiers); } -internal void +function void map_set_binding_core(Mapping *mapping, Command_Map_ID map_id, Custom_Command_Function *custom, Core_Code code, Input_Modifier_Set *modifiers){ Command_Map *map = mapping_get_map(mapping, map_id); map_set_binding_core(mapping, map, custom, code, modifiers); } -internal void +function void map_set_binding_text_input(Mapping *mapping, Command_Map_ID map_id, Custom_Command_Function *custom){ Command_Map *map = mapping_get_map(mapping, map_id); map_set_binding_text_input(map, custom); } -internal Command_Binding_List* +function Command_Binding_List* map_get_binding_list_on_key(Mapping *mapping, Command_Map_ID map_id, Key_Code code){ Command_Map *map = mapping_get_map(mapping, map_id); return(map_get_binding_list_on_key(map, code)); } -internal Command_Binding +function Command_Binding map_get_binding_non_recursive(Mapping *mapping, Command_Map_ID map_id, Input_Event *event){ Command_Map *map = mapping_get_map(mapping, map_id); return(map_get_binding_non_recursive(map, event)); } -internal Command_Binding +function Command_Binding map_get_binding_recursive(Mapping *mapping, Command_Map_ID map_id, Input_Event *event){ Command_Map *map = mapping_get_map(mapping, map_id); return(map_get_binding_recursive(mapping, map, event)); @@ -439,7 +486,7 @@ map_get_binding_recursive(Mapping *mapping, Command_Map_ID map_id, Input_Event * //////////////////////////////// -internal void +function void map_set_binding_lv(Mapping *mapping, Command_Map *map, Custom_Command_Function *custom, u32 code1, u32 code2, va_list args){ Input_Modifier_Set mods = {}; @@ -455,7 +502,7 @@ map_set_binding_lv(Mapping *mapping, Command_Map *map, } return(map_set_binding(mapping, map, custom, code1, code2, &mods)); } -internal void +function void map_set_binding_l(Mapping *mapping, Command_Map *map, Custom_Command_Function *custom, u32 code1, u32 code2, ...){ va_list args; diff --git a/custom/4coder_config.cpp b/custom/4coder_config.cpp index c3cb6c99..b1a71b91 100644 --- a/custom/4coder_config.cpp +++ b/custom/4coder_config.cpp @@ -5,7 +5,9 @@ // TOP function String_Const_u8_Array -parse_extension_line_to_extension_list(Arena *arena, String_Const_u8 str){ +parse_extension_line_to_extension_list(Application_Links *app, + Arena *arena, String_Const_u8 str){ + ProfileScope(app, "parse extension line to extension list"); i32 count = 0; for (umem i = 0; i < str.size; i += 1){ if (str.str[i] == '.'){ @@ -33,7 +35,8 @@ parse_extension_line_to_extension_list(Arena *arena, String_Const_u8 str){ //////////////////////////////// function Error_Location -get_error_location(u8 *base, u8 *pos){ +get_error_location(Application_Links *app, u8 *base, u8 *pos){ + ProfileScope(app, "get error location"); Error_Location location = {}; location.line_number = 1; location.column_number = 1; @@ -52,14 +55,16 @@ get_error_location(u8 *base, u8 *pos){ } function String_Const_u8 -config_stringize_errors(Arena *arena, Config *parsed){ +config_stringize_errors(Application_Links *app, Arena *arena, Config *parsed){ + ProfileScope(app, "stringize errors"); String_Const_u8 result = {}; if (parsed->errors.first != 0){ List_String_Const_u8 list = {}; for (Config_Error *error = parsed->errors.first; error != 0; error = error->next){ - Error_Location location = get_error_location(parsed->data.str, error->pos); + Error_Location location = get_error_location(app, parsed->data.str, + error->pos); string_list_pushf(arena, &list, "%.*s:%d:%d: %.*s\n", string_expand(error->file_name), location.line_number, location.column_number, string_expand(error->text)); } @@ -202,7 +207,9 @@ function Config_Compound *config_parser__compound (Config_Parser *ctx); function Config_Compound_Element *config_parser__element (Config_Parser *ctx); function Config* -text_data_and_token_array_to_parse_data(Arena *arena, String_Const_u8 file_name, String_Const_u8 data, Token_Array array){ +config_parse(Application_Links *app, Arena *arena, String_Const_u8 file_name, + String_Const_u8 data, Token_Array array){ + ProfileScope(app, "config parse"); Temp_Memory restore_point = begin_temp(arena); Config_Parser ctx = make_config_parser(arena, file_name, data, array); Config *config = config_parser__config(&ctx); @@ -214,7 +221,8 @@ text_data_and_token_array_to_parse_data(Arena *arena, String_Const_u8 file_name, // TODO(allen): Move to string library function Config_Error* -config_error_push(Arena *arena, Config_Error_List *list, String_Const_u8 file_name, u8 *pos, char *error_text){ +config_error_push(Arena *arena, Config_Error_List *list, String_Const_u8 file_name, + u8 *pos, char *error_text){ Config_Error *error = push_array(arena, Config_Error, 1); zdll_push_back(list->first, list->last, error); list->count += 1; @@ -518,7 +526,8 @@ config_parser__element(Config_Parser *ctx){ function Config_Error* config_add_error(Arena *arena, Config *config, u8 *pos, char *error_text){ - return(config_error_push(arena, &config->errors, config->file_name, pos, error_text)); + return(config_error_push(arena, &config->errors, config->file_name, pos, + error_text)); } //////////////////////////////// @@ -1159,18 +1168,20 @@ change_mode(Application_Links *app, String_Const_u8 mode){ //////////////////////////////// function Token_Array -token_array_from_text(Arena *arena, String_Const_u8 data){ +token_array_from_text(Application_Links *app, Arena *arena, String_Const_u8 data){ + ProfileScope(app, "token array from text"); Token_List list = lex_full_input_cpp(arena, data); return(token_array_from_list(arena, &list)); } function Config* -text_data_to_parsed_data(Arena *arena, String_Const_u8 file_name, String_Const_u8 data){ +config_from_text(Application_Links *app, Arena *arena, String_Const_u8 file_name, + String_Const_u8 data){ Config *parsed = 0; Temp_Memory restore_point = begin_temp(arena); - Token_Array array = token_array_from_text(arena, data); + Token_Array array = token_array_from_text(app, arena, data); if (array.tokens != 0){ - parsed = text_data_and_token_array_to_parse_data(arena, file_name, data, array); + parsed = config_parse(app, arena, file_name, data, array); if (parsed == 0){ end_temp(restore_point); } @@ -1234,12 +1245,13 @@ config_init_default(Config_Data *config){ } function Config* -config_parse__data(Arena *arena, String_Const_u8 file_name, String_Const_u8 data, Config_Data *config){ +config_parse__data(Application_Links *app, Arena *arena, String_Const_u8 file_name, + String_Const_u8 data, Config_Data *config){ config_init_default(config); b32 success = false; - Config *parsed = text_data_to_parsed_data(arena, file_name, data); + Config *parsed = config_from_text(app, arena, file_name, data); if (parsed != 0){ success = true; @@ -1248,7 +1260,8 @@ config_parse__data(Arena *arena, String_Const_u8 file_name, String_Const_u8 data String_Const_u8 str = {}; if (config_string_var(parsed, "treat_as_code", 0, &str)){ - config->code_exts = parse_extension_line_to_extension_list(arena, str); + config->code_exts = + parse_extension_line_to_extension_list(app, arena, str); } config_fixed_string_var(parsed, "mode", 0, @@ -1308,11 +1321,12 @@ config_parse__data(Arena *arena, String_Const_u8 file_name, String_Const_u8 data } function Config* -config_parse__file_handle(Arena *arena, String_Const_u8 file_name, FILE *file, Config_Data *config){ +config_parse__file_handle(Application_Links *app, Arena *arena, + String_Const_u8 file_name, FILE *file, Config_Data *config){ Config *parsed = 0; Data data = dump_file_handle(arena, file); if (data.data != 0){ - parsed = config_parse__data(arena, file_name, SCu8(data), config); + parsed = config_parse__data(app, arena, file_name, SCu8(data), config); } else{ config_init_default(config); @@ -1329,7 +1343,8 @@ config_parse__file_name(Application_Links *app, Arena *arena, char *file_name, C Data data = dump_file_handle(arena, file); fclose(file); if (data.data != 0){ - parsed = config_parse__data(arena, SCu8(file_name), SCu8(data), config); + parsed = config_parse__data(app, arena, SCu8(file_name), SCu8(data), + config); success = true; } } @@ -1353,7 +1368,7 @@ theme_parse__data(Partition *arena, String file_name, String data, Theme_Data *t copy(&theme->name, "unnamed"); init_theme_zero(&theme->theme); - Config *parsed = text_data_to_parsed_data(arena, file_name, data); + Config *parsed = config_from_text(arena, file_name, data); if (parsed != 0){ config_fixed_string_var(parsed, "name", 0, &theme->name, theme->space); @@ -1450,7 +1465,7 @@ load_config_and_apply(Application_Links *app, Arena *out_arena, Config_Data *con print_message(app, string_u8_litexpr("Loaded config file:\n")); // Errors - String_Const_u8 error_text = config_stringize_errors(scratch, parsed); + String_Const_u8 error_text = config_stringize_errors(app, scratch, parsed); if (error_text.str != 0){ print_message(app, error_text); } diff --git a/custom/4coder_default_hooks.cpp b/custom/4coder_default_hooks.cpp index a82de309..2e4667cd 100644 --- a/custom/4coder_default_hooks.cpp +++ b/custom/4coder_default_hooks.cpp @@ -7,6 +7,7 @@ CUSTOM_COMMAND_SIG(default_startup) CUSTOM_DOC("Default command for responding to a startup event") { + ProfileScope(app, "default startup"); User_Input input = get_current_input(app); if (match_core_code(&input, CoreCode_Startup)){ String_Const_u8_Array file_names = input.event.core.file_names; @@ -74,6 +75,7 @@ CUSTOM_DOC("Input consumption loop for default view behavior") for (;;){ // NOTE(allen): Get the binding from the buffer's current map User_Input input = get_next_input(app, EventPropertyGroup_Any, 0); + ProfileScopeNamed(app, "before view input", view_input_profile); if (input.abort){ break; } @@ -95,13 +97,15 @@ CUSTOM_DOC("Input consumption loop for default view behavior") } Command_Map_ID map_id = *map_id_ptr; - Command_Binding binding = map_get_binding_recursive(&framework_mapping, map_id, &input.event); + Command_Binding binding = + map_get_binding_recursive(&framework_mapping, map_id, &input.event); Managed_Scope scope = view_get_managed_scope(app, view); Custom_Command_Function** next_call = 0; call_again: - next_call = scope_attachment(app, scope, view_call_next, Custom_Command_Function*); + next_call = scope_attachment(app, scope, view_call_next, + Custom_Command_Function*); *next_call = 0; if (binding.custom == 0){ @@ -112,32 +116,43 @@ CUSTOM_DOC("Input consumption loop for default view behavior") } else{ // NOTE(allen): before the command is called do some book keeping - Rewrite_Type *next_rewrite = scope_attachment(app, scope, view_next_rewrite_loc, Rewrite_Type); + Rewrite_Type *next_rewrite = + scope_attachment(app, scope, view_next_rewrite_loc, Rewrite_Type); *next_rewrite = Rewrite_None; if (fcoder_mode == FCoderMode_NotepadLike){ for (View_ID view_it = get_view_next(app, 0, Access_Always); view_it != 0; view_it = get_view_next(app, view_it, Access_Always)){ Managed_Scope scope_it = view_get_managed_scope(app, view_it); - b32 *snap_mark_to_cursor = scope_attachment(app, scope_it, view_snap_mark_to_cursor, b32); + b32 *snap_mark_to_cursor = + scope_attachment(app, scope_it, view_snap_mark_to_cursor, + b32); *snap_mark_to_cursor = true; } } + view_input_profile.close_now(); + // NOTE(allen): call the command binding.custom(app); // NOTE(allen): after the command is called do some book keeping - next_rewrite = scope_attachment(app, scope, view_next_rewrite_loc, Rewrite_Type); + ProfileScope(app, "after view input"); + + next_rewrite = scope_attachment(app, scope, view_next_rewrite_loc, + Rewrite_Type); if (next_rewrite != 0){ - Rewrite_Type *rewrite = scope_attachment(app, scope, view_rewrite_loc, Rewrite_Type); + Rewrite_Type *rewrite = + scope_attachment(app, scope, view_rewrite_loc, Rewrite_Type); *rewrite = *next_rewrite; if (fcoder_mode == FCoderMode_NotepadLike){ for (View_ID view_it = get_view_next(app, 0, Access_Always); view_it != 0; view_it = get_view_next(app, view_it, Access_Always)){ Managed_Scope scope_it = view_get_managed_scope(app, view_it); - b32 *snap_mark_to_cursor = scope_attachment(app, scope_it, view_snap_mark_to_cursor, b32); + b32 *snap_mark_to_cursor = + scope_attachment(app, scope_it, view_snap_mark_to_cursor, + b32); if (*snap_mark_to_cursor){ i64 pos = view_get_cursor_pos(app, view_it); view_set_mark(app, view_it, seek_pos(pos)); @@ -146,7 +161,8 @@ CUSTOM_DOC("Input consumption loop for default view behavior") } } - next_call = scope_attachment(app, scope, view_call_next, Custom_Command_Function*); + next_call = scope_attachment(app, scope, view_call_next, + Custom_Command_Function*); if (next_call != 0 && *next_call != 0){ binding.custom = *next_call; goto call_again; @@ -267,6 +283,7 @@ function void default_render_buffer(Application_Links *app, View_ID view_id, b32 is_active_view, Buffer_ID buffer, Text_Layout_ID text_layout_id, Rect_f32 rect){ + ProfileScope(app, "render buffer"); Rect_f32 prev_clip = draw_set_clip(app, rect); // NOTE(allen): Token colorizing @@ -358,6 +375,7 @@ default_render_buffer(Application_Links *app, View_ID view_id, b32 is_active_vie function void default_render_caller(Application_Links *app, Frame_Info frame_info, View_ID view_id){ + ProfileScope(app, "default render caller"); View_ID active_view = get_active_view(app, Access_Always); b32 is_active_view = (active_view == view_id); @@ -445,6 +463,7 @@ HOOK_SIG(default_view_adjust){ } BUFFER_NAME_RESOLVER_SIG(default_buffer_name_resolution){ + ProfileScope(app, "default buffer name resolution"); if (conflict_count > 1){ // List of unresolved conflicts Scratch_Block scratch(app); diff --git a/custom/4coder_lister_base.cpp b/custom/4coder_lister_base.cpp index a8533b98..8ef03298 100644 --- a/custom/4coder_lister_base.cpp +++ b/custom/4coder_lister_base.cpp @@ -436,6 +436,8 @@ lister_call_activate_handler(Application_Links *app, View_ID view, Lister *liste else{ lister_default(app, view, lister, ListerActivation_Finished); } + lister->out.user_data = user_data; + lister->out.activated_by_click = activated_by_mouse; return(result); } @@ -475,8 +477,8 @@ lister_user_data_at_p(Application_Links *app, View_ID view, Lister *lister, Vec2 return(result); } -function void -lister_run(Application_Links *app, View_ID view, Lister *lister){ +function Lister_Result +run_lister(Application_Links *app, View_ID view, Lister *lister){ lister->filter_restore_point = begin_temp(lister->arena); lister_update_filtered_list(app, view, lister); @@ -486,8 +488,11 @@ lister_run(Application_Links *app, View_ID view, Lister *lister){ view_push_context(app, view, &ctx); for (;;){ - User_Input in = get_next_input(app, EventPropertyGroup_Any, EventProperty_Escape); + User_Input in = get_next_input(app, EventPropertyGroup_Any, + EventProperty_Escape); if (in.abort){ + block_zero_struct(&lister->out); + lister->out.canceled = true; break; } @@ -657,6 +662,8 @@ lister_run(Application_Links *app, View_ID view, Lister *lister){ } view_pop_context(app, view); + + return(lister->out); } function Lister_Prealloced_String @@ -674,8 +681,8 @@ lister_begin_new_item_set(Application_Links *app, Lister *lister){ } function void* -lister_add_item(Lister *lister, Lister_Prealloced_String string, Lister_Prealloced_String status, - void *user_data, umem extra_space){ +lister_add_item(Lister *lister, Lister_Prealloced_String string, + Lister_Prealloced_String status, void *user_data, umem extra_space){ void *base_memory = push_array(lister->arena, u8, sizeof(Lister_Node) + extra_space); Lister_Node *node = (Lister_Node*)base_memory; node->string = string.string; @@ -758,5 +765,152 @@ lister__navigate__default(Application_Links *app, View_ID view, Lister *lister, lister_update_selection_values(lister); } +function Lister_Activation_Code +lister__key_stroke__fixed_list(Application_Links *app){ + Lister_Activation_Code result = ListerActivation_Continue; + View_ID view = get_active_view(app, Access_Always); + Lister *lister = view_get_lister(view); + if (lister != 0){ + User_Input in = get_current_input(app); + if (in.event.kind == InputEventKind_KeyStroke){ + void *user_data = 0; + b32 did_shortcut_key = false; + for (Lister_Node *node = lister->options.first; + node != 0; + node = node->next){ + Key_Code *key_code = (Key_Code*)(node + 1); + if (*key_code == in.event.key.code){ + user_data = node->user_data; + did_shortcut_key = true; + break; + } + } + if (did_shortcut_key){ + result = lister_call_activate_handler(app, view, lister, user_data, false); + } + } + } + return(result); +} + +function Lister_Handlers +lister_get_default_handlers(void){ + Lister_Handlers handlers = {}; + handlers.write_character = lister__write_string__default; + handlers.backspace = lister__backspace_text_field__default; + handlers.navigate = lister__navigate__default; + return(handlers); +} + +//////////////////////////////// + +function Lister_Result +run_lister_with_refresh_handler(Application_Links *app, String_Const_u8 query, + Lister_Handlers handlers, + void *user_data, i32 user_data_size, View_ID view){ + Scratch_Block scratch(app); + Lister_Result result = {}; + if (handlers.refresh != 0){ + Lister *lister = begin_lister(app, scratch, view, user_data, user_data_size); + lister_set_query(lister, query); + lister->handlers = handlers; + handlers.refresh(app, lister); + result = run_lister(app, view, lister); + } + else{ +#define M "ERROR: No refresh handler specified for lister (query_string = \"%.*s\")\n" + String_Const_u8 str = push_u8_stringf(scratch, M, string_expand(query)); +#undef M + print_message(app, str); + } + return(result); +} + +function Lister_Result +run_lister_with_options_array(Application_Links *app, char *query_string, + Lister_Activation_Type *activate, + void *user_data, i32 user_data_size, + Lister_Option *options, i32 option_count, + i32 estimated_string_space_size, + View_ID view){ + Scratch_Block scratch(app); + Lister *lister = begin_lister(app, scratch, view, user_data, user_data_size); + for (i32 i = 0; i < option_count; i += 1){ + lister_add_item(lister, options[i].string, options[i].status, options[i].user_data, 0); + } + lister_set_query(lister, query_string); + lister->handlers = lister_get_default_handlers(); + lister->handlers.activate = activate; + return(run_lister(app, view, lister)); +} + +function void +lister_choice(Arena *arena, Lister_Choice_List *list, + String_Const_u8 string, String_Const_u8 status, + Key_Code code, u64 user_data){ + Lister_Choice *choice = push_array(arena, Lister_Choice, 1); + sll_queue_push(list->first, list->last, choice); + choice->string = string; + choice->status = status; + choice->key_code = code; + choice->user_data = user_data; +} + +function void +lister_choice(Arena *arena, Lister_Choice_List *list, + char *string, String_Const_u8 status, + Key_Code code, u64 user_data){ + lister_choice(arena, list, SCu8(string), status, code, (u64)PtrAsInt(user_data)); +} + +function void +lister_choice(Arena *arena, Lister_Choice_List *list, + String_Const_u8 string, char *status, + Key_Code code, u64 user_data){ + lister_choice(arena, list, string, SCu8(status), code, (u64)PtrAsInt(user_data)); +} + +function void +lister_choice(Arena *arena, Lister_Choice_List *list, + char *string, char *status, + Key_Code code, u64 user_data){ + lister_choice(arena, list, SCu8(string), SCu8(status), code, + (u64)PtrAsInt(user_data)); +} + +function Lister_Choice* +get_choice_from_user(Application_Links *app, String_Const_u8 query, + Lister_Choice_List list){ + Scratch_Block scratch(app); + View_ID view = get_active_view(app, Access_Always); + Lister *lister = begin_lister(app, scratch, view, 0, 0); + for (Lister_Choice *choice = list.first; + choice != 0; + choice = choice->next){ + umem code_size = sizeof(choice->key_code); + void *extra = lister_add_item(lister, choice->string, choice->status, + choice, code_size); + block_copy(extra, &choice->key_code, code_size); + } + lister_set_query(lister, query); + Lister_Handlers handlers = {}; + handlers.navigate = lister__navigate__default; + handlers.key_stroke = lister__key_stroke__fixed_list; + lister->handlers = handlers; + lister->handlers.refresh = 0; + + Lister_Result l_result = run_lister(app, view, lister); + Lister_Choice *result = 0; + if (!l_result.canceled){ + result = (Lister_Choice*)l_result.user_data; + } + return(result); +} + +function Lister_Choice* +get_choice_from_user(Application_Links *app, char *query, Lister_Choice_List list){ + return(get_choice_from_user(app, SCu8(query), list)); +} + // BOTTOM diff --git a/custom/4coder_lister_base.h b/custom/4coder_lister_base.h index 4d3426d4..65565a7e 100644 --- a/custom/4coder_lister_base.h +++ b/custom/4coder_lister_base.h @@ -56,6 +56,12 @@ struct Lister_Handlers{ Lister_Key_Stroke_Function *key_stroke; }; +struct Lister_Result{ + void *user_data; + b32 activated_by_click; + b32 canceled; +}; + struct Lister{ Arena *arena; Temp_Memory restore_all_point; @@ -87,6 +93,8 @@ struct Lister{ Basic_Scroll scroll; i32 visible_count; + + Lister_Result out; }; struct Lister_Prealloced_String{ @@ -107,11 +115,17 @@ struct Lister_Option{ void *user_data; }; -struct Lister_Fixed_Option{ - char *string; - char *status; +struct Lister_Choice{ + Lister_Choice *next; + String_Const_u8 string; + String_Const_u8 status; Key_Code key_code; - void *user_data; + u64 user_data; +}; + +struct Lister_Choice_List{ + Lister_Choice *first; + Lister_Choice *last; }; #endif diff --git a/custom/4coder_lists.cpp b/custom/4coder_lists.cpp index ab5231cc..f8b41255 100644 --- a/custom/4coder_lists.cpp +++ b/custom/4coder_lists.cpp @@ -5,6 +5,99 @@ such as open file, switch buffer, or kill buffer. // TOP +function void +generate_all_buffers_list__output_buffer(Application_Links *app, Lister *lister, + Buffer_ID buffer){ + Dirty_State dirty = buffer_get_dirty_state(app, buffer); + String_Const_u8 status = {}; + switch (dirty){ + case DirtyState_UnsavedChanges: status = string_u8_litexpr("*"); break; + case DirtyState_UnloadedChanges: status = string_u8_litexpr("!"); break; + case DirtyState_UnsavedChangesAndUnloadedChanges: status = string_u8_litexpr("*!"); break; + } + Scratch_Block scratch(app); + String_Const_u8 buffer_name = push_buffer_unique_name(app, scratch, buffer); + lister_add_item(lister, buffer_name, status, IntAsPtr(buffer), 0); +} + +function void +generate_all_buffers_list(Application_Links *app, Lister *lister){ + lister_begin_new_item_set(app, lister); + + Buffer_ID viewed_buffers[16]; + i32 viewed_buffer_count = 0; + + // List currently viewed buffers + for (View_ID view = get_view_next(app, 0, Access_Always); + view != 0; + view = get_view_next(app, view, Access_Always)){ + Buffer_ID new_buffer_id = view_get_buffer(app, view, Access_Always); + for (i32 i = 0; i < viewed_buffer_count; i += 1){ + if (new_buffer_id == viewed_buffers[i]){ + goto skip0; + } + } + viewed_buffers[viewed_buffer_count++] = new_buffer_id; + skip0:; + } + + // Regular Buffers + for (Buffer_ID buffer = get_buffer_next(app, 0, Access_Always); + buffer != 0; + buffer = get_buffer_next(app, buffer, Access_Always)){ + for (i32 i = 0; i < viewed_buffer_count; i += 1){ + if (buffer == viewed_buffers[i]){ + goto skip1; + } + } + if (!buffer_has_name_with_star(app, buffer)){ + generate_all_buffers_list__output_buffer(app, lister, buffer); + } + skip1:; + } + + // Buffers Starting with * + for (Buffer_ID buffer = get_buffer_next(app, 0, Access_Always); + buffer != 0; + buffer = get_buffer_next(app, buffer, Access_Always)){ + for (i32 i = 0; i < viewed_buffer_count; i += 1){ + if (buffer == viewed_buffers[i]){ + goto skip2; + } + } + if (buffer_has_name_with_star(app, buffer)){ + generate_all_buffers_list__output_buffer(app, lister, buffer); + } + skip2:; + } + + // Buffers That Are Open in Views + for (i32 i = 0; i < viewed_buffer_count; i += 1){ + generate_all_buffers_list__output_buffer(app, lister, viewed_buffers[i]); + } +} + +function Buffer_ID +get_buffer_from_user(Application_Links *app, String_Const_u8 query){ + View_ID view = get_active_view(app, Access_Always); + Lister_Handlers handlers = lister_get_default_handlers(); + handlers.refresh = generate_all_buffers_list; + Lister_Result l_result = run_lister_with_refresh_handler(app, query, handlers, + 0, 0, view); + Buffer_ID result = 0; + if (!l_result.canceled){ + result = (Buffer_ID)(PtrAsInt(l_result.user_data)); + } + return(result); +} + +function Buffer_ID +get_buffer_from_user(Application_Links *app, char *query){ + return(get_buffer_from_user(app, SCu8(query))); +} + +//////////////////////////////// + function void lister__write_character__file_path(Application_Links *app){ View_ID view = get_active_view(app, Access_Always); @@ -46,8 +139,8 @@ lister__backspace_text_field__file_path(Application_Links *app){ lister->text_field.size = new_hot.size; } set_hot_directory(app, new_hot); - // TODO(allen): We have to protect against lister_call_refresh_handler changing - // the text_field here. Clean this up. + // TODO(allen): We have to protect against lister_call_refresh_handler + // changing the text_field here. Clean this up. String_u8 dingus = lister->text_field; lister_call_refresh_handler(app, view, lister); lister->text_field = dingus; @@ -65,206 +158,6 @@ lister__backspace_text_field__file_path(Application_Links *app){ } } -function Lister_Activation_Code -lister__key_stroke__fixed_list(Application_Links *app){ - Lister_Activation_Code result = ListerActivation_Continue; - View_ID view = get_active_view(app, Access_Always); - Lister *lister = view_get_lister(view); - if (lister != 0){ - User_Input in = get_current_input(app); - if (in.event.kind == InputEventKind_KeyStroke){ - void *user_data = 0; - b32 did_shortcut_key = false; - for (Lister_Node *node = lister->options.first; - node != 0; - node = node->next){ - Key_Code *key_code = (Key_Code*)(node + 1); - if (*key_code == in.event.key.code){ - user_data = node->user_data; - did_shortcut_key = true; - break; - } - } - if (did_shortcut_key){ - result = lister_call_activate_handler(app, view, lister, user_data, false); - } - } - } - return(result); -} - -//////////////////////////////// - -function Lister_Handlers -lister_get_default_handlers(void){ - Lister_Handlers handlers = {}; - handlers.write_character = lister__write_string__default; - handlers.backspace = lister__backspace_text_field__default; - handlers.navigate = lister__navigate__default; - return(handlers); -} - -function Lister_Handlers -lister_get_fixed_list_handlers(void){ - Lister_Handlers handlers = {}; - handlers.navigate = lister__navigate__default; - handlers.key_stroke = lister__key_stroke__fixed_list; - return(handlers); -} - -function void -run_lister_with_refresh_handler(Application_Links *app, char *query_string, - Lister_Handlers handlers, - void *user_data, i32 user_data_size, - View_ID view){ - if (handlers.refresh != 0){ - Scratch_Block scratch(app); - Lister *lister = begin_lister(app, scratch, view, user_data, user_data_size); - lister_set_query(lister, query_string); - lister->handlers = handlers; - handlers.refresh(app, lister); - lister_run(app, view, lister); - } - else{ - Scratch_Block scratch(app); - List_String_Const_u8 list = {}; - string_list_push(scratch, &list, string_u8_litexpr("ERROR: No refresh handler specified for lister (query_string = \"")); - string_list_push(scratch, &list, SCu8(query_string)); - string_list_push(scratch, &list, string_u8_litexpr("\")\n")); - String_Const_u8 str = string_list_flatten(scratch, list); - print_message(app, str); - } -} - -function void -run_lister_with_options_array(Application_Links *app, char *query_string, - Lister_Activation_Type *activate, - void *user_data, i32 user_data_size, - Lister_Option *options, i32 option_count, - i32 estimated_string_space_size, - View_ID view){ - Scratch_Block scratch(app); - Lister *lister = begin_lister(app, scratch, view, user_data, user_data_size); - for (i32 i = 0; i < option_count; i += 1){ - lister_add_item(lister, options[i].string, options[i].status, options[i].user_data, 0); - } - lister_set_query(lister, query_string); - lister->handlers = lister_get_default_handlers(); - lister->handlers.activate = activate; - lister_run(app, view, lister); -} - -function void -run_lister_with_fixed_options(Application_Links *app, char *query_string, - Lister_Handlers handlers, - void *user_data, i32 user_data_size, - Lister_Fixed_Option *options, i32 option_count, - View_ID view){ - Scratch_Block scratch(app); - Lister *lister = begin_lister(app, scratch, view, user_data, user_data_size); - for (i32 i = 0; i < option_count; i += 1){ - Key_Code code = options[i].key_code; - void *extra = lister_add_item(lister, SCu8(options[i].string), SCu8(options[i].status), - options[i].user_data, sizeof(code)); - block_copy(extra, &code, sizeof(code)); - } - lister_set_query(lister, query_string); - lister->handlers = handlers; - lister->handlers.refresh = 0; - lister_run(app, view, lister); -} - -function void -run_lister_with_fixed_options(Application_Links *app, char *query_string, - Lister_Activation_Type *activate, - void *user_data, i32 user_data_size, - Lister_Fixed_Option *options, i32 option_count, - View_ID view){ - Lister_Handlers handlers = lister_get_fixed_list_handlers(); - handlers.activate = activate; - run_lister_with_fixed_options(app, query_string, - handlers, user_data, user_data_size, - options, option_count, - view); -} - -//////////////////////////////// - -function void -generate_all_buffers_list__output_buffer(Application_Links *app, Lister *lister, Buffer_ID buffer){ - Dirty_State dirty = buffer_get_dirty_state(app, buffer); - String_Const_u8 status = {}; - switch (dirty){ - case DirtyState_UnsavedChanges: status = string_u8_litexpr("*"); break; - case DirtyState_UnloadedChanges: status = string_u8_litexpr("!"); break; - case DirtyState_UnsavedChangesAndUnloadedChanges: status = string_u8_litexpr("*!"); break; - } - Scratch_Block scratch(app); - String_Const_u8 buffer_name = push_buffer_unique_name(app, scratch, buffer); - lister_add_item(lister, buffer_name, status, IntAsPtr(buffer), 0); -} - -function void -generate_all_buffers_list(Application_Links *app, Lister *lister){ - lister_begin_new_item_set(app, lister); - - Buffer_ID buffers_currently_being_viewed[16]; - i32 currently_viewed_buffer_count = 0; - - // List currently viewed buffers - { - for (View_ID view = get_view_next(app, 0, Access_Always); - view != 0; - view = get_view_next(app, view, Access_Always)){ - Buffer_ID new_buffer_id = view_get_buffer(app, view, Access_Always); - for (i32 i = 0; i < currently_viewed_buffer_count; i += 1){ - if (new_buffer_id == buffers_currently_being_viewed[i]){ - goto skip0; - } - } - buffers_currently_being_viewed[currently_viewed_buffer_count++] = new_buffer_id; - skip0:; - } - } - - // Regular Buffers - { - for (Buffer_ID buffer = get_buffer_next(app, 0, Access_Always); - buffer != 0; - buffer = get_buffer_next(app, buffer, Access_Always)){ - for (i32 i = 0; i < currently_viewed_buffer_count; i += 1){ - if (buffer == buffers_currently_being_viewed[i]){ - goto skip1; - } - } - if (!buffer_has_name_with_star(app, buffer)){ - generate_all_buffers_list__output_buffer(app, lister, buffer); - } - skip1:; - } - } - // Buffers Starting with * - { - for (Buffer_ID buffer = get_buffer_next(app, 0, Access_Always); - buffer != 0; - buffer = get_buffer_next(app, buffer, Access_Always)){ - for (i32 i = 0; i < currently_viewed_buffer_count; i += 1){ - if (buffer == buffers_currently_being_viewed[i]){ - goto skip2; - } - } - if (buffer_has_name_with_star(app, buffer)){ - generate_all_buffers_list__output_buffer(app, lister, buffer); - } - skip2:; - } - } - // Buffers That Are Open in Views - for (i32 i = 0; i < currently_viewed_buffer_count; i += 1){ - generate_all_buffers_list__output_buffer(app, lister, buffers_currently_being_viewed[i]); - } -} - function void generate_hot_directory_file_list(Application_Links *app, Lister *lister){ Scratch_Block scratch(app); @@ -334,23 +227,16 @@ generate_hot_directory_file_list(Application_Links *app, Lister *lister){ } function void -run_lister_buffer_list(Application_Links *app, char *query_string, Lister_Activation_Type *activate_procedure, - void *user_data, i32 user_data_size, View_ID target_view){ - Lister_Handlers handlers = lister_get_default_handlers(); - handlers.activate = activate_procedure; - handlers.refresh = generate_all_buffers_list; - run_lister_with_refresh_handler(app, query_string, handlers, user_data, user_data_size, target_view); -} - -function void -run_lister_file_system_list(Application_Links *app, char *query_string, Lister_Activation_Type *activate_procedure, +run_lister_file_system_list(Application_Links *app, char *query_string, + Lister_Activation_Type *activate_procedure, void *user_data, i32 user_data_size, View_ID target_view){ Lister_Handlers handlers = lister_get_default_handlers(); handlers.activate = activate_procedure; handlers.refresh = generate_hot_directory_file_list; handlers.write_character = lister__write_character__file_path; handlers.backspace = lister__backspace_text_field__file_path; - run_lister_with_refresh_handler(app, query_string, handlers, user_data, user_data_size, target_view); + run_lister_with_refresh_handler(app, SCu8(query_string), handlers, + user_data, user_data_size, target_view); } //////////////////////////////// @@ -362,58 +248,46 @@ enum{ SureToKill_Save = 3, }; -struct Confirm_Kill_Data{ - Buffer_ID id; - b32 do_kill; -}; - -function Lister_Activation_Code -activate_confirm_kill(Application_Links *app, View_ID view, Lister *lister, - String_Const_u8 text_field, void *user_data, b32 clicked){ - i32 behavior = (i32)PtrAsInt(user_data); - Confirm_Kill_Data *data = (Confirm_Kill_Data*)(lister->user_data); - switch (behavior){ - case SureToKill_No: - {}break; - - case SureToKill_Yes: - { - data->do_kill = true; - }break; - - case SureToKill_Save: - { - Scratch_Block scratch(app); - String_Const_u8 file_name = push_buffer_file_name(app, scratch, data->id); - if (buffer_save(app, data->id, file_name, BufferSave_IgnoreDirtyFlag)){ - data->do_kill = true; - } - else{ - String_Const_u8 str = push_u8_stringf(scratch, "Did not close '%.*s' because it did not successfully save.", - string_expand(file_name)); - print_message(app, str); - } - }break; - } - lister_default(app, view, lister, ListerActivation_Finished); - return(ListerActivation_Finished); -} - function b32 do_gui_sure_to_kill(Application_Links *app, Buffer_ID buffer, View_ID view){ - Lister_Fixed_Option options[] = { - {"(N)o" , "", KeyCode_N, IntAsPtr(SureToKill_No) }, - {"(Y)es" , "", KeyCode_Y, IntAsPtr(SureToKill_Yes) }, - {"(S)ave and Kill", "", KeyCode_S, IntAsPtr(SureToKill_Save)}, - }; - i32 option_count = sizeof(options)/sizeof(options[0]); - Confirm_Kill_Data data = {}; - data.id = buffer; - run_lister_with_fixed_options(app, "There are unsaved changes, close anyway?", - activate_confirm_kill, &data, sizeof(data), - options, option_count, - view); - return(data.do_kill); + Scratch_Block scratch(app); + Lister_Choice_List list = {}; + lister_choice(scratch, &list, "(N)o" , "", KeyCode_N, SureToKill_No); + lister_choice(scratch, &list, "(Y)es" , "", KeyCode_Y, SureToKill_Yes); + lister_choice(scratch, &list, "(S)ave", "", KeyCode_S, SureToKill_Save); + + Lister_Choice *choice = + get_choice_from_user(app, "There are unsaved changes, close anyway?", list); + + b32 do_kill = false; + if (choice != 0){ + switch (choice->user_data){ + case SureToKill_No: + {}break; + + case SureToKill_Yes: + { + do_kill = true; + }break; + + case SureToKill_Save: + { + String_Const_u8 file_name = push_buffer_file_name(app, scratch, buffer); + if (buffer_save(app, buffer, file_name, BufferSave_IgnoreDirtyFlag)){ + do_kill = true; + } + else{ +#define M "Did not close '%.*s' because it did not successfully save." + String_Const_u8 str = + push_u8_stringf(scratch, M, string_expand(file_name)); +#undef M + print_message(app, str); + } + }break; + } + } + + return(do_kill); } function Lister_Activation_Code @@ -445,23 +319,44 @@ activate_confirm_close_4coder(Application_Links *app, function b32 do_gui_sure_to_close_4coder(Application_Links *app, View_ID view){ - Lister_Fixed_Option options[] = { - {"(N)o" , "", KeyCode_N, (void*)SureToKill_No }, - {"(Y)es" , "", KeyCode_Y, (void*)SureToKill_Yes }, - {"(S)ave All and Close", "", KeyCode_S, (void*)SureToKill_Save}, - }; - i32 option_count = sizeof(options)/sizeof(options[0]); + Scratch_Block scratch(app); + Lister_Choice_List list = {}; + lister_choice(scratch, &list, "(N)o" , "", KeyCode_N, SureToKill_No); + lister_choice(scratch, &list, "(Y)es" , "", KeyCode_Y, SureToKill_Yes); + lister_choice(scratch, &list, "(S)ave all and close", "", + KeyCode_S, SureToKill_Save); + +#define M "There are one or more buffers with unsave changes, close anyway?" + Lister_Choice *choice = get_choice_from_user(app, M, list); +#undef M + b32 do_exit = false; - run_lister_with_fixed_options(app, "There are one or more buffers with unsave changes, close anyway?", - activate_confirm_close_4coder, - &do_exit, sizeof(do_exit), - options, option_count, - view); + if (choice != 0){ + switch (choice->user_data){ + case SureToKill_No: + {}break; + + case SureToKill_Yes: + { + allow_immediate_close_without_checking_for_changes = true; + do_exit = true; + }break; + + case SureToKill_Save: + { + save_all_dirty_buffers(app); + allow_immediate_close_without_checking_for_changes = true; + do_exit = true; + }break; + } + } + return(do_exit); } //////////////////////////////// +#if 0 function Lister_Activation_Code activate_switch_buffer(Application_Links *app, View_ID view, Lister *lister, @@ -473,14 +368,20 @@ activate_switch_buffer(Application_Links *app, lister_default(app, view, lister, ListerActivation_Finished); return(ListerActivation_Finished); } +#endif CUSTOM_UI_COMMAND_SIG(interactive_switch_buffer) CUSTOM_DOC("Interactively switch to an open buffer.") { View_ID view = get_active_view(app, Access_Always); - run_lister_buffer_list(app, "Switch:", activate_switch_buffer, 0, 0, view); + //run_lister_buffer_list(app, "Switch:", activate_switch_buffer, 0, 0, view); + Buffer_ID buffer = get_buffer_from_user(app, "Switch: "); + if (buffer != 0){ + view_set_buffer(app, view, buffer, 0); + } } +#if 0 function Lister_Activation_Code activate_kill_buffer(Application_Links *app, View_ID view, Lister *lister, @@ -492,12 +393,17 @@ activate_kill_buffer(Application_Links *app, } return(ListerActivation_Finished); } +#endif CUSTOM_UI_COMMAND_SIG(interactive_kill_buffer) CUSTOM_DOC("Interactively kill an open buffer.") { View_ID view = get_active_view(app, Access_Always); - run_lister_buffer_list(app, "Kill:", activate_kill_buffer, 0, 0, view); + //run_lister_buffer_list(app, "Kill:", activate_kill_buffer, 0, 0, view); + Buffer_ID buffer = get_buffer_from_user(app, "Kill: "); + if (buffer != 0){ + try_buffer_kill(app, buffer, view, 0); + } } function Lister_Activation_Code diff --git a/custom/4coder_profile_inspect.cpp b/custom/4coder_profile_inspect.cpp index 6b15e7bc..bf2871a2 100644 --- a/custom/4coder_profile_inspect.cpp +++ b/custom/4coder_profile_inspect.cpp @@ -368,37 +368,40 @@ profile_draw_node(Application_Links *app, View_ID view, Face_ID face_id, for (Profile_Node *child = node->first_child; child != 0; child = child->next){ - if (child->closed){ - Range_u64 child_time = child->time; - Range_f32 child_y = {}; - child_y.min = unlerp(top_time.min, child_time.min, top_time.max); - child_y.max = unlerp(top_time.min, child_time.max, top_time.max); - child_y.min = lerp(y.min, child_y.min, y.max); - child_y.max = lerp(y.min, child_y.max, y.max); + if (!child->closed){ + continue; + } + + Range_u64 child_time = child->time; + Range_f32 child_y = {}; + child_y.min = unlerp(top_time.min, child_time.min, top_time.max); + child_y.max = unlerp(top_time.min, child_time.max, top_time.max); + child_y.min = lerp(y.min, child_y.min, y.max); + child_y.max = lerp(y.min, child_y.max, y.max); + + Rect_f32 box = Rf32(x, child_y); + draw_rectangle(app, box, 0.f, colors[cycle_counter%count]); + cycle_counter += 1; + + if (rect_contains_point(box, m_p)){ + insp->full_name_hovered = profile_node_name(child); + insp->unique_counter_hovered = child->unique_counter; + insp->location_jump_hovered = profile_node_location(child); + insp->hover_node = child; + } + + if (range_size(child_y) >= line_height){ + String_Const_u8 child_name = profile_node_name(child); + Fancy_Line line = {}; + push_fancy_string(scratch, &line, fcolor_id(Stag_Pop1), + child_name); + push_fancy_stringf(scratch, &line, fcolor_id(Stag_Default), + 0.5f, 0.f, "#%4llu", child->unique_counter); - Rect_f32 box = Rf32(x, child_y); - draw_rectangle(app, box, 0.f, colors[cycle_counter%count]); - cycle_counter += 1; - - if (rect_contains_point(box, m_p)){ - insp->full_name_hovered = profile_node_name(child); - insp->unique_counter_hovered = child->unique_counter; - insp->hover_node = child; - } - - if (range_size(child_y) >= line_height){ - String_Const_u8 child_name = profile_node_name(child); - Fancy_Line line = {}; - push_fancy_string(scratch, &line, fcolor_id(Stag_Pop1), - child_name); - push_fancy_stringf(scratch, &line, fcolor_id(Stag_Default), - 0.5f, 0.f, "#%4llu", child->unique_counter); - - Vec2_f32 p = V2f32(x.min + x_half_padding, - child_y.min); - draw_fancy_line(app, face_id, fcolor_zero(), - &line, p); - } + Vec2_f32 p = V2f32(x.min + x_half_padding, + child_y.min); + draw_fancy_line(app, face_id, fcolor_zero(), + &line, p); } } } @@ -441,7 +444,7 @@ profile_draw_node(Application_Links *app, View_ID view, Face_ID face_id, Profile_Node *child = *child_ptr; y = If32_size(y_pos, block_height); - f32 ratio = ((f32)range_size(child->time))/((f32)range_size(node->time)); + f32 child_duration = ((f32)range_size(child->time))/1000000.f; String_Const_u8 child_name = profile_node_name(child); Fancy_Line line = {}; @@ -449,7 +452,7 @@ profile_draw_node(Application_Links *app, View_ID view, Face_ID face_id, push_fancy_stringf(scratch, &line, fcolor_id(Stag_Default), 0.5f, 0.f, "#%4llu", child->unique_counter); push_fancy_stringf(scratch, &line, fcolor_id(Stag_Pop2), - 0.5f, 0.f, "%6.4f", ratio); + 0.5f, 0.f, "%6.4f", child_duration); Vec2_f32 p = V2f32(x.min + x_half_padding, (y.min + y.max - line_height)*0.5f); diff --git a/custom/4coder_profile_static_disable.cpp b/custom/4coder_profile_static_disable.cpp index f708f142..16bbffd5 100644 --- a/custom/4coder_profile_static_disable.cpp +++ b/custom/4coder_profile_static_disable.cpp @@ -10,12 +10,16 @@ #undef ProfileEnd #undef ProfileBlock #undef ProfileScope +#undef ProfileBlockNamed +#undef ProfileScopeNamed #endif #define ProfileBegin(T,N) #define ProfileEnd(T,I) #define ProfileBlock(T,N) #define ProfileScope(T,N) +#define ProfileBlockNamed(T,N,M) +#define ProfileScopeNamed(T,N,M) // BOTTOM diff --git a/custom/4coder_profile_static_enable.cpp b/custom/4coder_profile_static_enable.cpp index 8f0f2052..b20e1276 100644 --- a/custom/4coder_profile_static_enable.cpp +++ b/custom/4coder_profile_static_enable.cpp @@ -9,6 +9,8 @@ #undef ProfileEnd #undef ProfileBlock #undef ProfileScope +#undef ProfileBlockNamed +#undef ProfileScopeNamed #endif #define ProfileBegin(T,N) \ @@ -25,5 +27,13 @@ Profile_Block glue(profile_block_, __LINE__) \ Profile_Scope_Block glue(profile_block_, __LINE__) \ ((T), string_u8_litexpr(N), string_u8_litexpr(file_name_line_number)) +#define ProfileBlockNamed(T,N,M) \ +Profile_Block M \ +((T), string_u8_litexpr(N), string_u8_litexpr(file_name_line_number)) + +#define ProfileScopeNamed(T,N,M) \ +Profile_Scope_Block M \ +((T), string_u8_litexpr(N), string_u8_litexpr(file_name_line_number)) + // BOTTOM diff --git a/custom/4coder_project_commands.cpp b/custom/4coder_project_commands.cpp index f703183c..ff721972 100644 --- a/custom/4coder_project_commands.cpp +++ b/custom/4coder_project_commands.cpp @@ -4,12 +4,12 @@ // TOP -static Project current_project = {}; -static Arena *current_project_arena = {}; +global Project current_project = {}; +global Arena *current_project_arena = {}; /////////////////////////////// -static Project_File_Pattern_Array +function Project_File_Pattern_Array get_pattern_array_from_string_array(Arena *arena, String_Const_u8_Array list){ Project_File_Pattern_Array array = {}; array.count = list.count; @@ -23,7 +23,7 @@ get_pattern_array_from_string_array(Arena *arena, String_Const_u8_Array list){ /////////////////////////////// -static void +function void close_all_files_with_extension(Application_Links *app, String_Const_u8_Array extension_array){ Scratch_Block scratch(app); @@ -71,7 +71,7 @@ close_all_files_with_extension(Application_Links *app, String_Const_u8_Array ext }while(do_repeat); } -static b32 +function b32 match_in_pattern_array(String_Const_u8 string, Project_File_Pattern_Array array){ b32 found_match = false; Project_File_Pattern *pattern = array.patterns; @@ -84,14 +84,16 @@ match_in_pattern_array(String_Const_u8 string, Project_File_Pattern_Array array) return(found_match); } -static void -open_all_files_in_directory_pattern_match__recursive(Application_Links *app, - String_Const_u8 path, - Project_File_Pattern_Array whitelist, - Project_File_Pattern_Array blacklist, - u32 flags){ +function void +open_files_pattern_match__recursive(Application_Links *app, String_Const_u8 path, + Project_File_Pattern_Array whitelist, + Project_File_Pattern_Array blacklist, + u32 flags){ Scratch_Block scratch(app); + + Profile_ID get_file_list_id = ProfileBegin(app, "get file list"); File_List list = system_get_file_list(scratch, path); + ProfileEnd(app, get_file_list_id); File_Info **info = list.infos; for (u32 i = 0; i < list.count; ++i, ++info){ @@ -104,7 +106,7 @@ open_all_files_in_directory_pattern_match__recursive(Application_Links *app, String_Const_u8 new_path = push_u8_stringf(scratch, "%.*s%.*s/", string_expand(path), string_expand(file_name)); - open_all_files_in_directory_pattern_match__recursive(app, new_path, + open_files_pattern_match__recursive(app, new_path, whitelist, blacklist, flags); } else{ @@ -118,12 +120,14 @@ open_all_files_in_directory_pattern_match__recursive(Application_Links *app, String_Const_u8 full_path = push_u8_stringf(scratch, "%.*s%.*s", string_expand(path), string_expand(file_name)); + Profile_ID create_buffer_id = ProfileBegin(app, "create buffer"); create_buffer(app, full_path, 0); + ProfileEnd(app, create_buffer_id); } } } -static Project_File_Pattern_Array +function Project_File_Pattern_Array get_standard_blacklist(Arena *arena){ String_Const_u8 dot = string_u8_litexpr(".*"); String_Const_u8_Array black_array = {}; @@ -132,30 +136,30 @@ get_standard_blacklist(Arena *arena){ return(get_pattern_array_from_string_array(arena, black_array)); } -static void -open_all_files_in_directory_pattern_match(Application_Links *app, - String_Const_u8 dir, - Project_File_Pattern_Array whitelist, - Project_File_Pattern_Array blacklist, - u32 flags){ +function void +open_files_pattern_match(Application_Links *app, + String_Const_u8 dir, + Project_File_Pattern_Array whitelist, + Project_File_Pattern_Array blacklist, + u32 flags){ ProfileScope(app, "open all files in directory pattern"); Scratch_Block scratch(app); String_Const_u8 directory = dir; if (!character_is_slash(string_get_character(directory, directory.size - 1))){ directory = push_u8_stringf(scratch, "%.*s/", string_expand(dir)); } - open_all_files_in_directory_pattern_match__recursive(app, directory, whitelist, blacklist, flags); + open_files_pattern_match__recursive(app, directory, whitelist, blacklist, flags); } -static void -open_all_files_in_directory_with_extension(Application_Links *app, String_Const_u8 dir, String_Const_u8_Array array, u32 flags){ +function void +open_files_with_extension(Application_Links *app, String_Const_u8 dir, String_Const_u8_Array array, u32 flags){ Scratch_Block scratch(app); Project_File_Pattern_Array whitelist = get_pattern_array_from_string_array(scratch, array); Project_File_Pattern_Array blacklist = get_standard_blacklist(scratch); - open_all_files_in_directory_pattern_match(app, dir, whitelist, blacklist, flags); + open_files_pattern_match(app, dir, whitelist, blacklist, flags); } -static void +function void open_all_files_in_hot_with_extension(Application_Links *app, String_Const_u8_Array array, u32 flags){ Scratch_Block scratch(app); String_Const_u8 hot = push_hot_directory(app, scratch); @@ -163,7 +167,7 @@ open_all_files_in_hot_with_extension(Application_Links *app, String_Const_u8_Arr if (!character_is_slash(string_get_character(hot, hot.size - 1))){ directory = push_u8_stringf(scratch, "%.*s/", string_expand(hot)); } - open_all_files_in_directory_with_extension(app, hot, array, flags); + open_files_with_extension(app, hot, array, flags); } /////////////////////////////// @@ -178,8 +182,9 @@ open_all_files_in_hot_with_extension(Application_Links *app, String_Const_u8_Arr # error no project configuration names for this platform #endif -static Project* -parse_project__config_data__version_0(Arena *arena, String_Const_u8 file_dir, Config *parsed){ +function Project* +parse_project__config_data__version_0(Application_Links *app, Arena *arena, + String_Const_u8 file_dir, Config *parsed){ Project *project = push_array_zero(arena, Project, 1); // Set new project directory @@ -199,7 +204,8 @@ parse_project__config_data__version_0(Arena *arena, String_Const_u8 file_dir, Co // Read the settings from project.4coder String_Const_u8 str = {}; if (config_string_var(parsed, "extensions", 0, &str)){ - String_Const_u8_Array extension_list = parse_extension_line_to_extension_list(arena, str); + String_Const_u8_Array extension_list = + parse_extension_line_to_extension_list(app, arena, str); project->pattern_array = get_pattern_array_from_string_array(arena, extension_list); project->blacklist_pattern_array = get_standard_blacklist(arena); } @@ -249,7 +255,7 @@ parse_project__config_data__version_0(Arena *arena, String_Const_u8 file_dir, Co return(project); } -static void +function void parse_project__extract_pattern_array(Arena *arena, Config *parsed, char *root_variable_name, Project_File_Pattern_Array *array_out){ Config_Compound *compound = 0; if (config_compound_var(parsed, root_variable_name, 0, &compound)){ @@ -268,7 +274,7 @@ parse_project__extract_pattern_array(Arena *arena, Config *parsed, char *root_va } } -static Project_OS_Match_Level +function Project_OS_Match_Level parse_project__version_1__os_match(String_Const_u8 str, String_Const_u8 this_os_str){ if (string_match(str, this_os_str)){ return(ProjectOSMatchLevel_ActiveMatch); @@ -282,8 +288,9 @@ parse_project__version_1__os_match(String_Const_u8 str, String_Const_u8 this_os_ return(ProjectOSMatchLevel_NoMatch); } -static Project* -parse_project__config_data__version_1(Arena *arena, String_Const_u8 root_dir, Config *parsed){ +function Project* +parse_project__config_data__version_1(Application_Links *app, Arena *arena, + String_Const_u8 root_dir, Config *parsed){ Project *project = push_array_zero(arena, Project, 1); // Set new project directory @@ -495,8 +502,9 @@ parse_project__config_data__version_1(Arena *arena, String_Const_u8 root_dir, Co return(project); } -static Project* -parse_project__config_data(Arena *arena, String_Const_u8 file_dir, Config *parsed){ +function Project* +parse_project__config_data(Application_Links *app, Arena *arena, + String_Const_u8 file_dir, Config *parsed){ i32 version = 0; if (parsed->version != 0){ version = *parsed->version; @@ -505,12 +513,12 @@ parse_project__config_data(Arena *arena, String_Const_u8 file_dir, Config *parse switch (version){ case 0: { - return(parse_project__config_data__version_0(arena, file_dir, parsed)); + return(parse_project__config_data__version_0(app, arena, file_dir, parsed)); }break; case 1: { - return(parse_project__config_data__version_1(arena, file_dir, parsed)); + return(parse_project__config_data__version_1(app, arena, file_dir, parsed)); }break; default: @@ -520,21 +528,23 @@ parse_project__config_data(Arena *arena, String_Const_u8 file_dir, Config *parse } } -static Project_Parse_Result -parse_project__data(Arena *arena, String_Const_u8 file_name, Data raw_data, String_Const_u8 file_dir){ +function Project_Parse_Result +parse_project__data(Application_Links *app, Arena *arena, String_Const_u8 file_name, + Data raw_data, String_Const_u8 file_dir){ String_Const_u8 data = SCu8(raw_data); Project_Parse_Result result = {}; - Token_Array array = token_array_from_text(arena, data); + Token_Array array = token_array_from_text(app, arena, data); if (array.tokens != 0){ - result.parsed = text_data_and_token_array_to_parse_data(arena, file_name, data, array); + result.parsed = config_parse(app, arena, file_name, data, array); if (result.parsed != 0){ - result.project = parse_project__config_data(arena, file_dir, result.parsed); + result.project = parse_project__config_data(app, arena, file_dir, + result.parsed); } } return(result); } -static Project_Parse_Result +function Project_Parse_Result parse_project__nearest_file(Application_Links *app, Arena *arena){ Project_Parse_Result result = {}; @@ -547,7 +557,8 @@ parse_project__nearest_file(Application_Links *app, Arena *arena){ File_Name_Data dump = dump_file_search_up_path(app, arena, project_path, string_u8_litexpr("project.4coder")); if (dump.data.data != 0){ String_Const_u8 project_root = string_remove_last_folder(dump.file_name); - result = parse_project__data(arena, dump.file_name, dump.data, project_root); + result = parse_project__data(app, arena, dump.file_name, dump.data, + project_root); } else{ List_String_Const_u8 list = {}; @@ -574,7 +585,7 @@ parse_project__nearest_file(Application_Links *app, Arena *arena){ return(result); } -static void +function void project_deep_copy__pattern_array(Arena *arena, Project_File_Pattern_Array *src_array, Project_File_Pattern_Array *dst_array){ i32 pattern_count = src_array->count; dst_array->patterns = push_array(arena, Project_File_Pattern, pattern_count); @@ -590,7 +601,7 @@ project_deep_copy__pattern_array(Arena *arena, Project_File_Pattern_Array *src_a } } -static Project +function Project project_deep_copy__inner(Arena *arena, Project *project){ Project result = {}; result.dir = push_string_copy(arena, project->dir); @@ -641,7 +652,7 @@ project_deep_copy__inner(Arena *arena, Project *project){ return(result); } -static Project +function Project project_deep_copy(Arena *arena, Project *project){ Temp_Memory restore_point = begin_temp(arena); Project result = project_deep_copy__inner(arena, project); @@ -652,7 +663,7 @@ project_deep_copy(Arena *arena, Project *project){ return(result); } -static void +function void config_feedback_file_pattern_array(Arena *arena, List_String_Const_u8 *list, char *name, Project_File_Pattern_Array *array){ string_list_pushf(arena, list, "%s = {\n", name); Project_File_Pattern *pattern = array->patterns; @@ -675,7 +686,7 @@ config_feedback_file_pattern_array(Arena *arena, List_String_Const_u8 *list, cha string_list_push_u8_lit(arena, list, "};\n"); } -static void +function void config_feedback_file_load_path_array(Arena *arena, List_String_Const_u8 *list, char *name, Project_File_Load_Path_Array *array){ string_list_pushf(arena, list, "%s = {\n", name); Project_File_Load_Path *path = array->paths; @@ -686,7 +697,7 @@ config_feedback_file_load_path_array(Arena *arena, List_String_Const_u8 *list, c string_list_push_u8_lit(arena, list, "};\n"); } -static void +function void config_feedback_command_array(Arena *arena, List_String_Const_u8 *list, char *name, Project_Command_Array *array){ string_list_pushf(arena, list, "%s = {\n", name); Project_Command *command = array->commands; @@ -702,7 +713,7 @@ config_feedback_command_array(Arena *arena, List_String_Const_u8 *list, char *na string_list_push_u8_lit(arena, list, "};\n"); } -static void +function void set_current_project(Application_Links *app, Project *project, Config *parsed){ b32 print_feedback = false; Scratch_Block scratch(app); @@ -742,7 +753,7 @@ set_current_project(Application_Links *app, Project *project, Config *parsed){ Project_File_Pattern_Array whitelist = current_project.pattern_array; Project_File_Pattern_Array blacklist = current_project.blacklist_pattern_array; - open_all_files_in_directory_pattern_match(app, file_dir, whitelist, blacklist, flags); + open_files_pattern_match(app, file_dir, whitelist, blacklist, flags); end_temp(temp); } @@ -772,7 +783,7 @@ set_current_project(Application_Links *app, Project *project, Config *parsed){ print_message(app, string_u8_litexpr("Loaded project file:\n")); // Errors - String_Const_u8 error_text = config_stringize_errors(scratch, parsed); + String_Const_u8 error_text = config_stringize_errors(app, scratch, parsed); print_message(app, error_text); // Values @@ -802,21 +813,23 @@ set_current_project(Application_Links *app, Project *project, Config *parsed){ } } -static void -set_current_project_from_data(Application_Links *app, String_Const_u8 file_name, Data data, String_Const_u8 file_dir){ +function void +set_current_project_from_data(Application_Links *app, String_Const_u8 file_name, + Data data, String_Const_u8 file_dir){ Scratch_Block scratch(app, Scratch_Share); - Project_Parse_Result project_parse = parse_project__data(scratch, file_name, data, file_dir); + Project_Parse_Result project_parse = parse_project__data(app, scratch, file_name, + data, file_dir); set_current_project(app, project_parse.project, project_parse.parsed); } -static void +function void set_current_project_from_nearest_project_file(Application_Links *app){ Scratch_Block scratch(app, Scratch_Share); Project_Parse_Result project_parse = parse_project__nearest_file(app, scratch); set_current_project(app, project_parse.project, project_parse.parsed); } -static void +function void exec_project_command(Application_Links *app, Project_Command *command){ if (command->cmd.size > 0){ b32 footer_panel = command->footer_panel; @@ -869,7 +882,7 @@ exec_project_command(Application_Links *app, Project_Command *command){ } } -static void +function void exec_project_command_by_index(Application_Links *app, i32 command_index){ if (!current_project.loaded){ return; @@ -881,7 +894,7 @@ exec_project_command_by_index(Application_Links *app, i32 command_index){ exec_project_command(app, command); } -static void +function void exec_project_fkey_command(Application_Links *app, i32 fkey_index){ if (!current_project.loaded){ return; @@ -894,7 +907,7 @@ exec_project_fkey_command(Application_Links *app, i32 fkey_index){ exec_project_command(app, command); } -static void +function void exec_project_command_by_name(Application_Links *app, String_Const_u8 name){ if (!current_project.loaded){ return; @@ -908,7 +921,7 @@ exec_project_command_by_name(Application_Links *app, String_Const_u8 name){ } } -static void +function void exec_project_command_by_name(Application_Links *app, char *name){ exec_project_command_by_name(app, SCu8(name)); } @@ -979,7 +992,7 @@ CUSTOM_DOC("Changes 4coder's hot directory to the root directory of the currentl /////////////////////////////// -static Project_Setup_Status +function Project_Setup_Status project_is_setup(Application_Links *app, String_Const_u8 script_path, String_Const_u8 script_file){ Project_Setup_Status result = {}; { @@ -1006,7 +1019,7 @@ project_is_setup(Application_Links *app, String_Const_u8 script_path, String_Con return(result); } -static Project_Key_Strings +function Project_Key_Strings project_key_strings_query_user(Application_Links *app, b32 get_script_file, b32 get_code_file, u8 *script_file_space, i32 script_file_cap, @@ -1062,7 +1075,7 @@ project_key_strings_query_user(Application_Links *app, return(keys); } -static b32 +function b32 project_generate_bat_script(Arena *scratch, String_Const_u8 opts, String_Const_u8 compiler, String_Const_u8 script_path, String_Const_u8 script_file, String_Const_u8 code_file, String_Const_u8 output_dir, String_Const_u8 binary_file){ @@ -1100,7 +1113,7 @@ project_generate_bat_script(Arena *scratch, String_Const_u8 opts, String_Const_u return(success); } -static b32 +function b32 project_generate_sh_script(Arena *scratch, String_Const_u8 opts, String_Const_u8 compiler, String_Const_u8 script_path, String_Const_u8 script_file, String_Const_u8 code_file, String_Const_u8 output_dir, String_Const_u8 binary_file){ @@ -1133,7 +1146,7 @@ project_generate_sh_script(Arena *scratch, String_Const_u8 opts, String_Const_u8 return(success); } -static b32 +function b32 project_generate_project_4coder_file(Arena *scratch, String_Const_u8 script_path, String_Const_u8 script_file, String_Const_u8 output_dir, String_Const_u8 binary_file){ b32 success = false; @@ -1201,7 +1214,7 @@ project_generate_project_4coder_file(Arena *scratch, String_Const_u8 script_path return(success); } -static void +function void project_setup_scripts__generic(Application_Links *app, b32 do_project_file, b32 do_bat_script, b32 do_sh_script){ Scratch_Block scratch(app); String_Const_u8 script_path = push_hot_directory(app, scratch); @@ -1330,7 +1343,7 @@ CUSTOM_DOC("Queries the user for several configuration options and initializes a /////////////////////////////// -static Lister_Activation_Code +function Lister_Activation_Code activate_project_command(Application_Links *app, View_ID view, Lister *lister, String_Const_u8 text_field, void *user_data, b32 activated_by_mouse){ i32 command_index = (i32)PtrAsInt(user_data); exec_project_command_by_index(app, command_index); diff --git a/custom/4coder_scope_commands.cpp b/custom/4coder_scope_commands.cpp index 4c2974de..1da52f28 100644 --- a/custom/4coder_scope_commands.cpp +++ b/custom/4coder_scope_commands.cpp @@ -4,6 +4,20 @@ // TOP +function void +select_next_scope_after_pos(Application_Links *app, View_ID view, Buffer_ID buffer, + i64 pos){ + Find_Nest_Flag flags = FindNest_Scope; + Range_i64 range = {}; + if (find_nest_side(app, buffer, pos + 1, flags, Scan_Forward, NestDelim_Open, + &range) && + find_nest_side(app, buffer, range.end, + flags|FindNest_Balanced|FindNest_EndOfToken, Scan_Forward, + NestDelim_Close, &range.end)){ + select_scope(app, view, range); + } +} + CUSTOM_COMMAND_SIG(select_surrounding_scope) CUSTOM_DOC("Finds the scope enclosed by '{' '}' surrounding the cursor and puts the cursor and mark on the '{' and '}'.") { @@ -16,15 +30,20 @@ CUSTOM_DOC("Finds the scope enclosed by '{' '}' surrounding the cursor and puts } } -function void -select_next_scope_after_pos(Application_Links *app, View_ID view, Buffer_ID buffer, i64 pos){ - Find_Nest_Flag flags = FindNest_Scope; +CUSTOM_COMMAND_SIG(select_surrounding_scope_maximal) +CUSTOM_DOC("Selects the top-most scope that surrounds the cursor.") +{ + View_ID view = get_active_view(app, Access_ReadVisible); + Buffer_ID buffer = view_get_buffer(app, view, Access_ReadVisible); + i64 pos = view_get_cursor_pos(app, view); Range_i64 range = {}; - if (find_nest_side(app, buffer, pos + 1, - flags, Scan_Forward, NestDelim_Open, &range) && - find_nest_side(app, buffer, range.end, - flags|FindNest_Balanced|FindNest_EndOfToken, Scan_Forward, - NestDelim_Close, &range.end)){ + if (find_surrounding_nest(app, buffer, pos, FindNest_Scope, &range)){ + for (;;){ + pos = range.min; + if (!find_surrounding_nest(app, buffer, pos, FindNest_Scope, &range)){ + break; + } + } select_scope(app, view, range); } } @@ -64,6 +83,13 @@ CUSTOM_DOC("Finds the first scope started by '{' before the cursor and puts the } } +CUSTOM_COMMAND_SIG(select_prev_top_most_scope) +CUSTOM_DOC("Finds the first scope that starts before the cursor, then finds the top most scope that contains that scope.") +{ + select_prev_scope_absolute(app); + select_surrounding_scope_maximal(app); +} + CUSTOM_COMMAND_SIG(place_in_scope) CUSTOM_DOC("Wraps the code contained in the range between cursor and mark with a new curly brace scope.") { diff --git a/custom/4coder_types.h b/custom/4coder_types.h index 5141b186..4707f12f 100644 --- a/custom/4coder_types.h +++ b/custom/4coder_types.h @@ -584,6 +584,18 @@ typedef void Render_Caller_Function(Application_Links *app, Frame_Info frame_inf typedef i64 Command_Map_ID; +struct Command_Trigger{ + Command_Trigger *next; + Input_Event_Kind kind; + u32 sub_code; + Input_Modifier_Set mods; +}; + +struct Command_Trigger_List{ + Command_Trigger *first; + Command_Trigger *last; +}; + struct Command_Binding{ Custom_Command_Function *custom; }; @@ -591,7 +603,7 @@ struct Command_Binding{ struct Command_Modified_Binding{ Command_Modified_Binding *next; SNode order_node; - Input_Modifier_Set modifiers; + Input_Modifier_Set mods; Command_Binding binding; }; @@ -609,6 +621,7 @@ struct Command_Map{ Command_Binding text_input_command; Arena node_arena; Table_u64_u64 event_code_to_binding_list; + Table_u64_u64 cmd_to_binding_trigger; Command_Modified_Binding *binding_first; Command_Modified_Binding *binding_last; Command_Binding_List *list_first; diff --git a/custom/generated/command_metadata.h b/custom/generated/command_metadata.h index 0fed90a1..7f3128c7 100644 --- a/custom/generated/command_metadata.h +++ b/custom/generated/command_metadata.h @@ -2,7 +2,7 @@ #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 211 +#define command_one_past_last_id 213 #if defined(CUSTOM_COMMAND_SIG) #define PROC_LINKS(x,y) x #else @@ -193,9 +193,11 @@ CUSTOM_COMMAND_SIG(list_all_functions_current_buffer_lister); CUSTOM_COMMAND_SIG(list_all_functions_all_buffers); CUSTOM_COMMAND_SIG(list_all_functions_all_buffers_lister); CUSTOM_COMMAND_SIG(select_surrounding_scope); +CUSTOM_COMMAND_SIG(select_surrounding_scope_maximal); CUSTOM_COMMAND_SIG(select_next_scope_absolute); CUSTOM_COMMAND_SIG(select_next_scope_after_current); CUSTOM_COMMAND_SIG(select_prev_scope_absolute); +CUSTOM_COMMAND_SIG(select_prev_top_most_scope); CUSTOM_COMMAND_SIG(place_in_scope); CUSTOM_COMMAND_SIG(delete_current_scope); CUSTOM_COMMAND_SIG(open_long_braces); @@ -232,8 +234,8 @@ char *source_name; i32 source_name_len; i32 line_number; }; -static Command_Metadata fcoder_metacmd_table[211] = { -{ PROC_LINKS(default_view_input_handler, 0), false, "default_view_input_handler", 26, "Input consumption loop for default view behavior", 48, "w:\\4ed\\code\\custom\\4coder_default_hooks.cpp", 43, 56 }, +static Command_Metadata fcoder_metacmd_table[213] = { +{ PROC_LINKS(default_view_input_handler, 0), false, "default_view_input_handler", 26, "Input consumption loop for default view behavior", 48, "w:\\4ed\\code\\custom\\4coder_default_hooks.cpp", 43, 57 }, { PROC_LINKS(profile_enable, 0), false, "profile_enable", 14, "Allow 4coder's self profiler to gather new profiling information.", 65, "w:\\4ed\\code\\custom\\4coder_profile.cpp", 37, 204 }, { PROC_LINKS(profile_disable, 0), false, "profile_disable", 15, "Prevent 4coder's self profiler from gathering new profiling information.", 72, "w:\\4ed\\code\\custom\\4coder_profile.cpp", 37, 210 }, { PROC_LINKS(profile_clear, 0), false, "profile_clear", 13, "Clear all profiling information from 4coder's self profiler.", 60, "w:\\4ed\\code\\custom\\4coder_profile.cpp", 37, 216 }, @@ -256,112 +258,112 @@ static Command_Metadata fcoder_metacmd_table[211] = { { PROC_LINKS(toggle_highlight_enclosing_scopes, 0), false, "toggle_highlight_enclosing_scopes", 33, "In code files scopes surrounding the cursor are highlighted with distinguishing colors.", 87, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 401 }, { PROC_LINKS(toggle_paren_matching_helper, 0), false, "toggle_paren_matching_helper", 28, "In code files matching parentheses pairs are colored with distinguishing colors.", 80, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 407 }, { PROC_LINKS(toggle_fullscreen, 0), false, "toggle_fullscreen", 17, "Toggle fullscreen mode on or off. The change(s) do not take effect until the next frame.", 89, "w:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 413 }, -{ PROC_LINKS(write_text_input, 0), false, "write_text_input", 16, "Inserts whatever character was used to trigger this command.", 60, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 58 }, -{ PROC_LINKS(write_space, 0), false, "write_space", 11, "Inserts an underscore.", 22, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 66 }, -{ PROC_LINKS(write_underscore, 0), false, "write_underscore", 16, "Inserts an underscore.", 22, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 72 }, -{ PROC_LINKS(delete_char, 0), false, "delete_char", 11, "Deletes the character to the right of the cursor.", 49, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 78 }, -{ PROC_LINKS(backspace_char, 0), false, "backspace_char", 14, "Deletes the character to the left of the cursor.", 48, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 95 }, -{ PROC_LINKS(set_mark, 0), false, "set_mark", 8, "Sets the mark to the current position of the cursor.", 52, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 114 }, -{ PROC_LINKS(cursor_mark_swap, 0), false, "cursor_mark_swap", 16, "Swaps the position of the cursor and the mark.", 46, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 123 }, -{ PROC_LINKS(delete_range, 0), false, "delete_range", 12, "Deletes the text in the range between the cursor and the mark.", 62, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 133 }, -{ PROC_LINKS(backspace_alpha_numeric_boundary, 0), false, "backspace_alpha_numeric_boundary", 32, "Delete characters between the cursor position and the first alphanumeric boundary to the left.", 94, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 153 }, -{ PROC_LINKS(delete_alpha_numeric_boundary, 0), false, "delete_alpha_numeric_boundary", 29, "Delete characters between the cursor position and the first alphanumeric boundary to the right.", 95, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 161 }, -{ PROC_LINKS(snipe_backward_whitespace_or_token_boundary, 0), false, "snipe_backward_whitespace_or_token_boundary", 43, "Delete a single, whole token on or to the left of the cursor and post it to the clipboard.", 90, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 181 }, -{ PROC_LINKS(snipe_forward_whitespace_or_token_boundary, 0), false, "snipe_forward_whitespace_or_token_boundary", 42, "Delete a single, whole token on or to the right of the cursor and post it to the clipboard.", 91, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 189 }, -{ PROC_LINKS(center_view, 0), false, "center_view", 11, "Centers the view vertically on the line on which the cursor sits.", 65, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 199 }, -{ PROC_LINKS(left_adjust_view, 0), false, "left_adjust_view", 16, "Sets the left size of the view near the x position of the cursor.", 65, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 213 }, -{ PROC_LINKS(click_set_cursor_and_mark, 0), false, "click_set_cursor_and_mark", 25, "Sets the cursor position and mark to the mouse position.", 56, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 225 }, -{ PROC_LINKS(click_set_cursor, 0), false, "click_set_cursor", 16, "Sets the cursor position to the mouse position.", 47, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 235 }, -{ PROC_LINKS(click_set_cursor_if_lbutton, 0), false, "click_set_cursor_if_lbutton", 27, "If the mouse left button is pressed, sets the cursor position to the mouse position.", 84, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 245 }, -{ PROC_LINKS(click_set_mark, 0), false, "click_set_mark", 14, "Sets the mark position to the mouse position.", 45, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 257 }, -{ PROC_LINKS(mouse_wheel_scroll, 0), false, "mouse_wheel_scroll", 18, "Reads the scroll wheel value from the mouse state and scrolls accordingly.", 74, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 267 }, -{ PROC_LINKS(move_up, 0), false, "move_up", 7, "Moves the cursor up one line.", 29, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 321 }, -{ PROC_LINKS(move_down, 0), false, "move_down", 9, "Moves the cursor down one line.", 31, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 327 }, -{ PROC_LINKS(move_up_10, 0), false, "move_up_10", 10, "Moves the cursor up ten lines.", 30, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 333 }, -{ PROC_LINKS(move_down_10, 0), false, "move_down_10", 12, "Moves the cursor down ten lines.", 32, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 339 }, -{ PROC_LINKS(move_down_textual, 0), false, "move_down_textual", 17, "Moves down to the next line of actual text, regardless of line wrapping.", 72, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 345 }, -{ PROC_LINKS(page_up, 0), false, "page_up", 7, "Scrolls the view up one view height and moves the cursor up one view height.", 76, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 355 }, -{ PROC_LINKS(page_down, 0), false, "page_down", 9, "Scrolls the view down one view height and moves the cursor down one view height.", 80, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 363 }, -{ PROC_LINKS(move_up_to_blank_line, 0), false, "move_up_to_blank_line", 21, "Seeks the cursor up to the next blank line.", 43, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 393 }, -{ PROC_LINKS(move_down_to_blank_line, 0), false, "move_down_to_blank_line", 23, "Seeks the cursor down to the next blank line.", 45, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 399 }, -{ PROC_LINKS(move_up_to_blank_line_skip_whitespace, 0), false, "move_up_to_blank_line_skip_whitespace", 37, "Seeks the cursor up to the next blank line and places it at the end of the line.", 80, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 405 }, -{ PROC_LINKS(move_down_to_blank_line_skip_whitespace, 0), false, "move_down_to_blank_line_skip_whitespace", 39, "Seeks the cursor down to the next blank line and places it at the end of the line.", 82, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 411 }, -{ PROC_LINKS(move_up_to_blank_line_end, 0), false, "move_up_to_blank_line_end", 25, "Seeks the cursor up to the next blank line and places it at the end of the line.", 80, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 417 }, -{ PROC_LINKS(move_down_to_blank_line_end, 0), false, "move_down_to_blank_line_end", 27, "Seeks the cursor down to the next blank line and places it at the end of the line.", 82, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 423 }, -{ PROC_LINKS(move_left, 0), false, "move_left", 9, "Moves the cursor one character to the left.", 43, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 429 }, -{ PROC_LINKS(move_right, 0), false, "move_right", 10, "Moves the cursor one character to the right.", 44, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 441 }, -{ PROC_LINKS(move_right_whitespace_boundary, 0), false, "move_right_whitespace_boundary", 30, "Seek right for the next boundary between whitespace and non-whitespace.", 71, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 463 }, -{ PROC_LINKS(move_left_whitespace_boundary, 0), false, "move_left_whitespace_boundary", 29, "Seek left for the next boundary between whitespace and non-whitespace.", 70, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 471 }, -{ PROC_LINKS(move_right_token_boundary, 0), false, "move_right_token_boundary", 25, "Seek right for the next end of a token.", 39, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 479 }, -{ PROC_LINKS(move_left_token_boundary, 0), false, "move_left_token_boundary", 24, "Seek left for the next beginning of a token.", 44, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 487 }, -{ PROC_LINKS(move_right_whitespace_or_token_boundary, 0), false, "move_right_whitespace_or_token_boundary", 39, "Seek right for the next end of a token or boundary between whitespace and non-whitespace.", 89, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 495 }, -{ PROC_LINKS(move_left_whitespace_or_token_boundary, 0), false, "move_left_whitespace_or_token_boundary", 38, "Seek left for the next end of a token or boundary between whitespace and non-whitespace.", 88, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 503 }, -{ PROC_LINKS(move_right_alpha_numeric_boundary, 0), false, "move_right_alpha_numeric_boundary", 33, "Seek right for boundary between alphanumeric characters and non-alphanumeric characters.", 88, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 511 }, -{ PROC_LINKS(move_left_alpha_numeric_boundary, 0), false, "move_left_alpha_numeric_boundary", 32, "Seek left for boundary between alphanumeric characters and non-alphanumeric characters.", 87, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 519 }, -{ PROC_LINKS(move_right_alpha_numeric_or_camel_boundary, 0), false, "move_right_alpha_numeric_or_camel_boundary", 42, "Seek right for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 107, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 527 }, -{ PROC_LINKS(move_left_alpha_numeric_or_camel_boundary, 0), false, "move_left_alpha_numeric_or_camel_boundary", 41, "Seek left for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 106, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 535 }, -{ PROC_LINKS(select_all, 0), false, "select_all", 10, "Puts the cursor at the top of the file, and the mark at the bottom of the file.", 79, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 545 }, -{ PROC_LINKS(to_uppercase, 0), false, "to_uppercase", 12, "Converts all ascii text in the range between the cursor and the mark to uppercase.", 82, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 558 }, -{ PROC_LINKS(to_lowercase, 0), false, "to_lowercase", 12, "Converts all ascii text in the range between the cursor and the mark to lowercase.", 82, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 571 }, -{ PROC_LINKS(clean_all_lines, 0), false, "clean_all_lines", 15, "Removes trailing whitespace from all lines in the current buffer.", 65, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 584 }, -{ PROC_LINKS(basic_change_active_panel, 0), false, "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, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 618 }, -{ PROC_LINKS(close_panel, 0), false, "close_panel", 11, "Closes the currently active panel if it is not the only panel open.", 67, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 626 }, -{ PROC_LINKS(show_scrollbar, 0), false, "show_scrollbar", 14, "Sets the current view to show it's scrollbar.", 45, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 635 }, -{ PROC_LINKS(hide_scrollbar, 0), false, "hide_scrollbar", 14, "Sets the current view to hide it's scrollbar.", 45, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 642 }, -{ PROC_LINKS(show_filebar, 0), false, "show_filebar", 12, "Sets the current view to show it's filebar.", 43, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 649 }, -{ PROC_LINKS(hide_filebar, 0), false, "hide_filebar", 12, "Sets the current view to hide it's filebar.", 43, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 656 }, -{ PROC_LINKS(toggle_filebar, 0), false, "toggle_filebar", 14, "Toggles the visibility status of the current view's filebar.", 60, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 663 }, -{ PROC_LINKS(toggle_fps_meter, 0), false, "toggle_fps_meter", 16, "Toggles the visibility of the FPS performance meter", 51, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 672 }, -{ PROC_LINKS(increase_face_size, 0), false, "increase_face_size", 18, "Increase the size of the face used by the current buffer.", 57, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 678 }, -{ PROC_LINKS(decrease_face_size, 0), false, "decrease_face_size", 18, "Decrease the size of the face used by the current buffer.", 57, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 689 }, -{ PROC_LINKS(mouse_wheel_change_face_size, 0), false, "mouse_wheel_change_face_size", 28, "Reads the state of the mouse wheel and uses it to either increase or decrease the face size.", 92, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 700 }, -{ PROC_LINKS(toggle_virtual_whitespace, 0), false, "toggle_virtual_whitespace", 25, "Toggles the current buffer's virtual whitespace status.", 55, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 717 }, -{ PROC_LINKS(toggle_show_whitespace, 0), false, "toggle_show_whitespace", 22, "Toggles the current buffer's whitespace visibility status.", 58, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 726 }, -{ PROC_LINKS(toggle_line_numbers, 0), false, "toggle_line_numbers", 19, "Toggles the left margin line numbers.", 37, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 735 }, -{ PROC_LINKS(exit_4coder, 0), false, "exit_4coder", 11, "Attempts to close 4coder.", 25, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 741 }, -{ PROC_LINKS(goto_line, 0), false, "goto_line", 9, "Queries the user for a number, and jumps the cursor to the corresponding line.", 78, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 749 }, -{ PROC_LINKS(search, 0), false, "search", 6, "Begins an incremental search down through the current buffer for a user specified string.", 89, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 977 }, -{ PROC_LINKS(reverse_search, 0), false, "reverse_search", 14, "Begins an incremental search up through the current buffer for a user specified string.", 87, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 983 }, -{ PROC_LINKS(search_identifier, 0), false, "search_identifier", 17, "Begins an incremental search down through the current buffer for the word or token under the cursor.", 100, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 989 }, -{ PROC_LINKS(reverse_search_identifier, 0), false, "reverse_search_identifier", 25, "Begins an incremental search up through the current buffer for the word or token under the cursor.", 98, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 995 }, -{ PROC_LINKS(replace_in_range, 0), false, "replace_in_range", 16, "Queries the user for a needle and string. Replaces all occurences of needle with string in the range between cursor and the mark in the active buffer.", 150, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1042 }, -{ PROC_LINKS(replace_in_buffer, 0), false, "replace_in_buffer", 17, "Queries the user for a needle and string. Replaces all occurences of needle with string in the active buffer.", 109, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1051 }, -{ PROC_LINKS(replace_in_all_buffers, 0), false, "replace_in_all_buffers", 22, "Queries the user for a needle and string. Replaces all occurences of needle with string in all editable buffers.", 112, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1060 }, -{ PROC_LINKS(query_replace, 0), false, "query_replace", 13, "Queries the user for two strings, and incrementally replaces every occurence of the first string with the second string.", 120, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1150 }, -{ PROC_LINKS(query_replace_identifier, 0), false, "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, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1171 }, -{ PROC_LINKS(query_replace_selection, 0), false, "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, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1187 }, -{ PROC_LINKS(save_all_dirty_buffers, 0), false, "save_all_dirty_buffers", 22, "Saves all buffers marked dirty (showing the '*' indicator).", 59, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1223 }, -{ PROC_LINKS(delete_file_query, 0), false, "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, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1248 }, -{ PROC_LINKS(save_to_query, 0), false, "save_to_query", 13, "Queries the user for a file name and saves the contents of the current buffer, altering the buffer's name too.", 110, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1292 }, -{ PROC_LINKS(rename_file_query, 0), false, "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, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1325 }, -{ PROC_LINKS(make_directory_query, 0), false, "make_directory_query", 20, "Queries the user for a name and creates a new directory with the given name.", 76, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1363 }, -{ PROC_LINKS(move_line_up, 0), false, "move_line_up", 12, "Swaps the line under the cursor with the line above it, and moves the cursor up with it.", 88, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1397 }, -{ PROC_LINKS(move_line_down, 0), false, "move_line_down", 14, "Swaps the line under the cursor with the line below it, and moves the cursor down with it.", 90, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1403 }, -{ PROC_LINKS(duplicate_line, 0), false, "duplicate_line", 14, "Create a copy of the line on which the cursor sits.", 51, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1409 }, -{ PROC_LINKS(delete_line, 0), false, "delete_line", 11, "Delete the line the on which the cursor sits.", 45, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1423 }, -{ PROC_LINKS(open_file_in_quotes, 0), false, "open_file_in_quotes", 19, "Reads a filename from surrounding '\"' characters and attempts to open the corresponding file.", 94, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1488 }, -{ PROC_LINKS(open_matching_file_cpp, 0), false, "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, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1520 }, -{ PROC_LINKS(view_buffer_other_panel, 0), false, "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, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1533 }, -{ PROC_LINKS(swap_buffers_between_panels, 0), false, "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, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1545 }, -{ PROC_LINKS(kill_buffer, 0), false, "kill_buffer", 11, "Kills the current buffer.", 25, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1579 }, -{ PROC_LINKS(save, 0), false, "save", 4, "Saves the current buffer.", 25, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1587 }, -{ PROC_LINKS(reopen, 0), false, "reopen", 6, "Reopen the current buffer from the hard drive.", 46, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1597 }, -{ PROC_LINKS(undo, 0), false, "undo", 4, "Advances backwards through the undo history of the current buffer.", 66, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1822 }, -{ PROC_LINKS(redo, 0), false, "redo", 4, "Advances forwards through the undo history of the current buffer.", 65, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1835 }, -{ PROC_LINKS(undo_all_buffers, 0), false, "undo_all_buffers", 16, "Advances backward through the undo history in the buffer containing the most recent regular edit.", 97, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1849 }, -{ PROC_LINKS(redo_all_buffers, 0), false, "redo_all_buffers", 16, "Advances forward through the undo history in the buffer containing the most recent regular edit.", 96, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1920 }, -{ PROC_LINKS(open_in_other, 0), false, "open_in_other", 13, "Interactively opens a file in the other panel.", 46, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 2021 }, -{ PROC_LINKS(default_file_externally_modified, 0), false, "default_file_externally_modified", 32, "Notes the external modification of attached files by printing a message.", 72, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 2028 }, +{ PROC_LINKS(write_text_input, 0), false, "write_text_input", 16, "Inserts whatever character was used to trigger this command.", 60, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 59 }, +{ PROC_LINKS(write_space, 0), false, "write_space", 11, "Inserts an underscore.", 22, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 67 }, +{ PROC_LINKS(write_underscore, 0), false, "write_underscore", 16, "Inserts an underscore.", 22, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 73 }, +{ PROC_LINKS(delete_char, 0), false, "delete_char", 11, "Deletes the character to the right of the cursor.", 49, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 79 }, +{ PROC_LINKS(backspace_char, 0), false, "backspace_char", 14, "Deletes the character to the left of the cursor.", 48, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 96 }, +{ PROC_LINKS(set_mark, 0), false, "set_mark", 8, "Sets the mark to the current position of the cursor.", 52, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 115 }, +{ PROC_LINKS(cursor_mark_swap, 0), false, "cursor_mark_swap", 16, "Swaps the position of the cursor and the mark.", 46, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 124 }, +{ PROC_LINKS(delete_range, 0), false, "delete_range", 12, "Deletes the text in the range between the cursor and the mark.", 62, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 134 }, +{ PROC_LINKS(backspace_alpha_numeric_boundary, 0), false, "backspace_alpha_numeric_boundary", 32, "Delete characters between the cursor position and the first alphanumeric boundary to the left.", 94, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 154 }, +{ PROC_LINKS(delete_alpha_numeric_boundary, 0), false, "delete_alpha_numeric_boundary", 29, "Delete characters between the cursor position and the first alphanumeric boundary to the right.", 95, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 162 }, +{ PROC_LINKS(snipe_backward_whitespace_or_token_boundary, 0), false, "snipe_backward_whitespace_or_token_boundary", 43, "Delete a single, whole token on or to the left of the cursor and post it to the clipboard.", 90, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 182 }, +{ PROC_LINKS(snipe_forward_whitespace_or_token_boundary, 0), false, "snipe_forward_whitespace_or_token_boundary", 42, "Delete a single, whole token on or to the right of the cursor and post it to the clipboard.", 91, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 190 }, +{ PROC_LINKS(center_view, 0), false, "center_view", 11, "Centers the view vertically on the line on which the cursor sits.", 65, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 200 }, +{ PROC_LINKS(left_adjust_view, 0), false, "left_adjust_view", 16, "Sets the left size of the view near the x position of the cursor.", 65, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 214 }, +{ PROC_LINKS(click_set_cursor_and_mark, 0), false, "click_set_cursor_and_mark", 25, "Sets the cursor position and mark to the mouse position.", 56, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 226 }, +{ PROC_LINKS(click_set_cursor, 0), false, "click_set_cursor", 16, "Sets the cursor position to the mouse position.", 47, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 236 }, +{ PROC_LINKS(click_set_cursor_if_lbutton, 0), false, "click_set_cursor_if_lbutton", 27, "If the mouse left button is pressed, sets the cursor position to the mouse position.", 84, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 246 }, +{ PROC_LINKS(click_set_mark, 0), false, "click_set_mark", 14, "Sets the mark position to the mouse position.", 45, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 258 }, +{ PROC_LINKS(mouse_wheel_scroll, 0), false, "mouse_wheel_scroll", 18, "Reads the scroll wheel value from the mouse state and scrolls accordingly.", 74, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 268 }, +{ PROC_LINKS(move_up, 0), false, "move_up", 7, "Moves the cursor up one line.", 29, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 323 }, +{ PROC_LINKS(move_down, 0), false, "move_down", 9, "Moves the cursor down one line.", 31, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 329 }, +{ PROC_LINKS(move_up_10, 0), false, "move_up_10", 10, "Moves the cursor up ten lines.", 30, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 335 }, +{ PROC_LINKS(move_down_10, 0), false, "move_down_10", 12, "Moves the cursor down ten lines.", 32, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 341 }, +{ PROC_LINKS(move_down_textual, 0), false, "move_down_textual", 17, "Moves down to the next line of actual text, regardless of line wrapping.", 72, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 347 }, +{ PROC_LINKS(page_up, 0), false, "page_up", 7, "Scrolls the view up one view height and moves the cursor up one view height.", 76, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 357 }, +{ PROC_LINKS(page_down, 0), false, "page_down", 9, "Scrolls the view down one view height and moves the cursor down one view height.", 80, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 365 }, +{ PROC_LINKS(move_up_to_blank_line, 0), false, "move_up_to_blank_line", 21, "Seeks the cursor up to the next blank line.", 43, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 394 }, +{ PROC_LINKS(move_down_to_blank_line, 0), false, "move_down_to_blank_line", 23, "Seeks the cursor down to the next blank line.", 45, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 400 }, +{ PROC_LINKS(move_up_to_blank_line_skip_whitespace, 0), false, "move_up_to_blank_line_skip_whitespace", 37, "Seeks the cursor up to the next blank line and places it at the end of the line.", 80, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 406 }, +{ PROC_LINKS(move_down_to_blank_line_skip_whitespace, 0), false, "move_down_to_blank_line_skip_whitespace", 39, "Seeks the cursor down to the next blank line and places it at the end of the line.", 82, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 412 }, +{ PROC_LINKS(move_up_to_blank_line_end, 0), false, "move_up_to_blank_line_end", 25, "Seeks the cursor up to the next blank line and places it at the end of the line.", 80, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 418 }, +{ PROC_LINKS(move_down_to_blank_line_end, 0), false, "move_down_to_blank_line_end", 27, "Seeks the cursor down to the next blank line and places it at the end of the line.", 82, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 424 }, +{ PROC_LINKS(move_left, 0), false, "move_left", 9, "Moves the cursor one character to the left.", 43, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 430 }, +{ PROC_LINKS(move_right, 0), false, "move_right", 10, "Moves the cursor one character to the right.", 44, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 442 }, +{ PROC_LINKS(move_right_whitespace_boundary, 0), false, "move_right_whitespace_boundary", 30, "Seek right for the next boundary between whitespace and non-whitespace.", 71, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 464 }, +{ PROC_LINKS(move_left_whitespace_boundary, 0), false, "move_left_whitespace_boundary", 29, "Seek left for the next boundary between whitespace and non-whitespace.", 70, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 472 }, +{ PROC_LINKS(move_right_token_boundary, 0), false, "move_right_token_boundary", 25, "Seek right for the next end of a token.", 39, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 480 }, +{ PROC_LINKS(move_left_token_boundary, 0), false, "move_left_token_boundary", 24, "Seek left for the next beginning of a token.", 44, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 488 }, +{ PROC_LINKS(move_right_whitespace_or_token_boundary, 0), false, "move_right_whitespace_or_token_boundary", 39, "Seek right for the next end of a token or boundary between whitespace and non-whitespace.", 89, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 496 }, +{ PROC_LINKS(move_left_whitespace_or_token_boundary, 0), false, "move_left_whitespace_or_token_boundary", 38, "Seek left for the next end of a token or boundary between whitespace and non-whitespace.", 88, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 504 }, +{ PROC_LINKS(move_right_alpha_numeric_boundary, 0), false, "move_right_alpha_numeric_boundary", 33, "Seek right for boundary between alphanumeric characters and non-alphanumeric characters.", 88, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 512 }, +{ PROC_LINKS(move_left_alpha_numeric_boundary, 0), false, "move_left_alpha_numeric_boundary", 32, "Seek left for boundary between alphanumeric characters and non-alphanumeric characters.", 87, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 520 }, +{ PROC_LINKS(move_right_alpha_numeric_or_camel_boundary, 0), false, "move_right_alpha_numeric_or_camel_boundary", 42, "Seek right for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 107, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 528 }, +{ PROC_LINKS(move_left_alpha_numeric_or_camel_boundary, 0), false, "move_left_alpha_numeric_or_camel_boundary", 41, "Seek left for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 106, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 536 }, +{ PROC_LINKS(select_all, 0), false, "select_all", 10, "Puts the cursor at the top of the file, and the mark at the bottom of the file.", 79, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 546 }, +{ PROC_LINKS(to_uppercase, 0), false, "to_uppercase", 12, "Converts all ascii text in the range between the cursor and the mark to uppercase.", 82, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 559 }, +{ PROC_LINKS(to_lowercase, 0), false, "to_lowercase", 12, "Converts all ascii text in the range between the cursor and the mark to lowercase.", 82, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 572 }, +{ PROC_LINKS(clean_all_lines, 0), false, "clean_all_lines", 15, "Removes trailing whitespace from all lines in the current buffer.", 65, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 585 }, +{ PROC_LINKS(basic_change_active_panel, 0), false, "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, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 620 }, +{ PROC_LINKS(close_panel, 0), false, "close_panel", 11, "Closes the currently active panel if it is not the only panel open.", 67, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 628 }, +{ PROC_LINKS(show_scrollbar, 0), false, "show_scrollbar", 14, "Sets the current view to show it's scrollbar.", 45, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 637 }, +{ PROC_LINKS(hide_scrollbar, 0), false, "hide_scrollbar", 14, "Sets the current view to hide it's scrollbar.", 45, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 644 }, +{ PROC_LINKS(show_filebar, 0), false, "show_filebar", 12, "Sets the current view to show it's filebar.", 43, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 651 }, +{ PROC_LINKS(hide_filebar, 0), false, "hide_filebar", 12, "Sets the current view to hide it's filebar.", 43, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 658 }, +{ PROC_LINKS(toggle_filebar, 0), false, "toggle_filebar", 14, "Toggles the visibility status of the current view's filebar.", 60, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 665 }, +{ PROC_LINKS(toggle_fps_meter, 0), false, "toggle_fps_meter", 16, "Toggles the visibility of the FPS performance meter", 51, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 674 }, +{ PROC_LINKS(increase_face_size, 0), false, "increase_face_size", 18, "Increase the size of the face used by the current buffer.", 57, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 680 }, +{ PROC_LINKS(decrease_face_size, 0), false, "decrease_face_size", 18, "Decrease the size of the face used by the current buffer.", 57, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 691 }, +{ PROC_LINKS(mouse_wheel_change_face_size, 0), false, "mouse_wheel_change_face_size", 28, "Reads the state of the mouse wheel and uses it to either increase or decrease the face size.", 92, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 702 }, +{ PROC_LINKS(toggle_virtual_whitespace, 0), false, "toggle_virtual_whitespace", 25, "Toggles the current buffer's virtual whitespace status.", 55, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 719 }, +{ PROC_LINKS(toggle_show_whitespace, 0), false, "toggle_show_whitespace", 22, "Toggles the current buffer's whitespace visibility status.", 58, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 728 }, +{ PROC_LINKS(toggle_line_numbers, 0), false, "toggle_line_numbers", 19, "Toggles the left margin line numbers.", 37, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 737 }, +{ PROC_LINKS(exit_4coder, 0), false, "exit_4coder", 11, "Attempts to close 4coder.", 25, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 743 }, +{ PROC_LINKS(goto_line, 0), false, "goto_line", 9, "Queries the user for a number, and jumps the cursor to the corresponding line.", 78, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 751 }, +{ PROC_LINKS(search, 0), false, "search", 6, "Begins an incremental search down through the current buffer for a user specified string.", 89, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 979 }, +{ PROC_LINKS(reverse_search, 0), false, "reverse_search", 14, "Begins an incremental search up through the current buffer for a user specified string.", 87, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 985 }, +{ PROC_LINKS(search_identifier, 0), false, "search_identifier", 17, "Begins an incremental search down through the current buffer for the word or token under the cursor.", 100, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 991 }, +{ PROC_LINKS(reverse_search_identifier, 0), false, "reverse_search_identifier", 25, "Begins an incremental search up through the current buffer for the word or token under the cursor.", 98, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 997 }, +{ PROC_LINKS(replace_in_range, 0), false, "replace_in_range", 16, "Queries the user for a needle and string. Replaces all occurences of needle with string in the range between cursor and the mark in the active buffer.", 150, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1044 }, +{ PROC_LINKS(replace_in_buffer, 0), false, "replace_in_buffer", 17, "Queries the user for a needle and string. Replaces all occurences of needle with string in the active buffer.", 109, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1053 }, +{ PROC_LINKS(replace_in_all_buffers, 0), false, "replace_in_all_buffers", 22, "Queries the user for a needle and string. Replaces all occurences of needle with string in all editable buffers.", 112, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1062 }, +{ PROC_LINKS(query_replace, 0), false, "query_replace", 13, "Queries the user for two strings, and incrementally replaces every occurence of the first string with the second string.", 120, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1152 }, +{ PROC_LINKS(query_replace_identifier, 0), false, "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, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1173 }, +{ PROC_LINKS(query_replace_selection, 0), false, "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, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1189 }, +{ PROC_LINKS(save_all_dirty_buffers, 0), false, "save_all_dirty_buffers", 22, "Saves all buffers marked dirty (showing the '*' indicator).", 59, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1225 }, +{ PROC_LINKS(delete_file_query, 0), false, "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, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1250 }, +{ PROC_LINKS(save_to_query, 0), false, "save_to_query", 13, "Queries the user for a file name and saves the contents of the current buffer, altering the buffer's name too.", 110, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1294 }, +{ PROC_LINKS(rename_file_query, 0), false, "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, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1327 }, +{ PROC_LINKS(make_directory_query, 0), false, "make_directory_query", 20, "Queries the user for a name and creates a new directory with the given name.", 76, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1365 }, +{ PROC_LINKS(move_line_up, 0), false, "move_line_up", 12, "Swaps the line under the cursor with the line above it, and moves the cursor up with it.", 88, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1399 }, +{ PROC_LINKS(move_line_down, 0), false, "move_line_down", 14, "Swaps the line under the cursor with the line below it, and moves the cursor down with it.", 90, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1405 }, +{ PROC_LINKS(duplicate_line, 0), false, "duplicate_line", 14, "Create a copy of the line on which the cursor sits.", 51, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1411 }, +{ PROC_LINKS(delete_line, 0), false, "delete_line", 11, "Delete the line the on which the cursor sits.", 45, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1425 }, +{ PROC_LINKS(open_file_in_quotes, 0), false, "open_file_in_quotes", 19, "Reads a filename from surrounding '\"' characters and attempts to open the corresponding file.", 94, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1490 }, +{ PROC_LINKS(open_matching_file_cpp, 0), false, "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, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1522 }, +{ PROC_LINKS(view_buffer_other_panel, 0), false, "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, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1535 }, +{ PROC_LINKS(swap_buffers_between_panels, 0), false, "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, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1547 }, +{ PROC_LINKS(kill_buffer, 0), false, "kill_buffer", 11, "Kills the current buffer.", 25, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1581 }, +{ PROC_LINKS(save, 0), false, "save", 4, "Saves the current buffer.", 25, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1589 }, +{ PROC_LINKS(reopen, 0), false, "reopen", 6, "Reopen the current buffer from the hard drive.", 46, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1599 }, +{ PROC_LINKS(undo, 0), false, "undo", 4, "Advances backwards through the undo history of the current buffer.", 66, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1824 }, +{ PROC_LINKS(redo, 0), false, "redo", 4, "Advances forwards through the undo history of the current buffer.", 65, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1837 }, +{ PROC_LINKS(undo_all_buffers, 0), false, "undo_all_buffers", 16, "Advances backward through the undo history in the buffer containing the most recent regular edit.", 97, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1851 }, +{ PROC_LINKS(redo_all_buffers, 0), false, "redo_all_buffers", 16, "Advances forward through the undo history in the buffer containing the most recent regular edit.", 96, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1922 }, +{ PROC_LINKS(open_in_other, 0), false, "open_in_other", 13, "Interactively opens a file in the other panel.", 46, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 2023 }, +{ PROC_LINKS(default_file_externally_modified, 0), false, "default_file_externally_modified", 32, "Notes the external modification of attached files by printing a message.", 72, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 2030 }, { PROC_LINKS(set_eol_mode_to_crlf, 0), false, "set_eol_mode_to_crlf", 20, "Puts the buffer in crlf line ending mode.", 41, "w:\\4ed\\code\\custom\\4coder_eol.cpp", 33, 82 }, { PROC_LINKS(set_eol_mode_to_lf, 0), false, "set_eol_mode_to_lf", 18, "Puts the buffer in lf line ending mode.", 39, "w:\\4ed\\code\\custom\\4coder_eol.cpp", 33, 93 }, { PROC_LINKS(set_eol_mode_to_binary, 0), false, "set_eol_mode_to_binary", 22, "Puts the buffer in bin line ending mode.", 40, "w:\\4ed\\code\\custom\\4coder_eol.cpp", 33, 104 }, { PROC_LINKS(set_eol_mode_from_contents, 0), false, "set_eol_mode_from_contents", 26, "Sets the buffer's line ending mode to match the contents of the buffer.", 71, "w:\\4ed\\code\\custom\\4coder_eol.cpp", 33, 115 }, -{ PROC_LINKS(interactive_switch_buffer, 0), true, "interactive_switch_buffer", 25, "Interactively switch to an open buffer.", 39, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 477 }, -{ PROC_LINKS(interactive_kill_buffer, 0), true, "interactive_kill_buffer", 23, "Interactively kill an open buffer.", 34, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 496 }, -{ PROC_LINKS(interactive_open_or_new, 0), true, "interactive_open_or_new", 23, "Interactively open a file out of the file system.", 49, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 567 }, -{ PROC_LINKS(interactive_new, 0), true, "interactive_new", 15, "Interactively creates a new file.", 33, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 606 }, -{ PROC_LINKS(interactive_open, 0), true, "interactive_open", 16, "Interactively opens a file.", 27, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 639 }, -{ PROC_LINKS(command_lister, 0), true, "command_lister", 14, "Opens an interactive list of all registered commands.", 53, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 702 }, +{ PROC_LINKS(interactive_switch_buffer, 0), true, "interactive_switch_buffer", 25, "Interactively switch to an open buffer.", 39, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 373 }, +{ PROC_LINKS(interactive_kill_buffer, 0), true, "interactive_kill_buffer", 23, "Interactively kill an open buffer.", 34, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 398 }, +{ PROC_LINKS(interactive_open_or_new, 0), true, "interactive_open_or_new", 23, "Interactively open a file out of the file system.", 49, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 473 }, +{ PROC_LINKS(interactive_new, 0), true, "interactive_new", 15, "Interactively creates a new file.", 33, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 512 }, +{ PROC_LINKS(interactive_open, 0), true, "interactive_open", 16, "Interactively opens a file.", 27, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 545 }, +{ PROC_LINKS(command_lister, 0), true, "command_lister", 14, "Opens an interactive list of all registered commands.", 53, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 608 }, { PROC_LINKS(auto_indent_whole_file, 0), false, "auto_indent_whole_file", 22, "Audo-indents the entire current buffer.", 39, "w:\\4ed\\code\\custom\\4coder_auto_indent.cpp", 41, 368 }, { PROC_LINKS(auto_indent_line_at_cursor, 0), false, "auto_indent_line_at_cursor", 26, "Auto-indents the line on which the cursor sits.", 47, "w:\\4ed\\code\\custom\\4coder_auto_indent.cpp", 41, 377 }, { PROC_LINKS(auto_indent_range, 0), false, "auto_indent_range", 17, "Auto-indents the range between the cursor and the mark.", 55, "w:\\4ed\\code\\custom\\4coder_auto_indent.cpp", 41, 387 }, @@ -401,27 +403,29 @@ static Command_Metadata fcoder_metacmd_table[211] = { { PROC_LINKS(build_in_build_panel, 0), false, "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, "w:\\4ed\\code\\custom\\4coder_build_commands.cpp", 44, 163 }, { PROC_LINKS(close_build_panel, 0), false, "close_build_panel", 17, "If the special build panel is open, closes it.", 46, "w:\\4ed\\code\\custom\\4coder_build_commands.cpp", 44, 178 }, { PROC_LINKS(change_to_build_panel, 0), false, "change_to_build_panel", 21, "If the special build panel is open, makes the build panel the active panel.", 75, "w:\\4ed\\code\\custom\\4coder_build_commands.cpp", 44, 184 }, -{ PROC_LINKS(close_all_code, 0), false, "close_all_code", 14, "Closes any buffer with a filename ending with an extension configured to be recognized as a code file type.", 107, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 918 }, -{ PROC_LINKS(open_all_code, 0), false, "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, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 924 }, -{ PROC_LINKS(open_all_code_recursive, 0), false, "open_all_code_recursive", 23, "Works as open_all_code but also runs in all subdirectories.", 59, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 930 }, -{ PROC_LINKS(load_project, 0), false, "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, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 938 }, -{ PROC_LINKS(project_fkey_command, 0), false, "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, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 946 }, -{ PROC_LINKS(project_go_to_root_directory, 0), false, "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, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 972 }, -{ PROC_LINKS(setup_new_project, 0), false, "setup_new_project", 17, "Queries the user for several configuration options and initializes a new 4coder project with build scripts for every OS.", 120, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 1306 }, -{ PROC_LINKS(setup_build_bat, 0), false, "setup_build_bat", 15, "Queries the user for several configuration options and initializes a new build batch script.", 92, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 1313 }, -{ PROC_LINKS(setup_build_sh, 0), false, "setup_build_sh", 14, "Queries the user for several configuration options and initializes a new build shell script.", 92, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 1319 }, -{ PROC_LINKS(setup_build_bat_and_sh, 0), false, "setup_build_bat_and_sh", 22, "Queries the user for several configuration options and initializes a new build batch script.", 92, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 1325 }, -{ PROC_LINKS(project_command_lister, 0), false, "project_command_lister", 22, "Open a lister of all commands in the currently loaded project.", 62, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 1341 }, +{ PROC_LINKS(close_all_code, 0), false, "close_all_code", 14, "Closes any buffer with a filename ending with an extension configured to be recognized as a code file type.", 107, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 931 }, +{ PROC_LINKS(open_all_code, 0), false, "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, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 937 }, +{ PROC_LINKS(open_all_code_recursive, 0), false, "open_all_code_recursive", 23, "Works as open_all_code but also runs in all subdirectories.", 59, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 943 }, +{ PROC_LINKS(load_project, 0), false, "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, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 951 }, +{ PROC_LINKS(project_fkey_command, 0), false, "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, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 959 }, +{ PROC_LINKS(project_go_to_root_directory, 0), false, "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, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 985 }, +{ PROC_LINKS(setup_new_project, 0), false, "setup_new_project", 17, "Queries the user for several configuration options and initializes a new 4coder project with build scripts for every OS.", 120, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 1319 }, +{ PROC_LINKS(setup_build_bat, 0), false, "setup_build_bat", 15, "Queries the user for several configuration options and initializes a new build batch script.", 92, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 1326 }, +{ PROC_LINKS(setup_build_sh, 0), false, "setup_build_sh", 14, "Queries the user for several configuration options and initializes a new build shell script.", 92, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 1332 }, +{ PROC_LINKS(setup_build_bat_and_sh, 0), false, "setup_build_bat_and_sh", 22, "Queries the user for several configuration options and initializes a new build batch script.", 92, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 1338 }, +{ PROC_LINKS(project_command_lister, 0), false, "project_command_lister", 22, "Open a lister of all commands in the currently loaded project.", 62, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 1354 }, { PROC_LINKS(list_all_functions_current_buffer, 0), false, "list_all_functions_current_buffer", 33, "Creates a jump list of lines of the current buffer that appear to define or declare functions.", 94, "w:\\4ed\\code\\custom\\4coder_function_list.cpp", 43, 267 }, { PROC_LINKS(list_all_functions_current_buffer_lister, 0), false, "list_all_functions_current_buffer_lister", 40, "Creates a lister of locations that look like function definitions and declarations in the buffer.", 97, "w:\\4ed\\code\\custom\\4coder_function_list.cpp", 43, 277 }, { PROC_LINKS(list_all_functions_all_buffers, 0), false, "list_all_functions_all_buffers", 30, "Creates a jump list of lines from all buffers that appear to define or declare functions.", 89, "w:\\4ed\\code\\custom\\4coder_function_list.cpp", 43, 289 }, { PROC_LINKS(list_all_functions_all_buffers_lister, 0), false, "list_all_functions_all_buffers_lister", 37, "Creates a lister of locations that look like function definitions and declarations all buffers.", 95, "w:\\4ed\\code\\custom\\4coder_function_list.cpp", 43, 295 }, -{ PROC_LINKS(select_surrounding_scope, 0), false, "select_surrounding_scope", 24, "Finds the scope enclosed by '{' '}' surrounding the cursor and puts the cursor and mark on the '{' and '}'.", 107, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 7 }, -{ PROC_LINKS(select_next_scope_absolute, 0), false, "select_next_scope_absolute", 26, "Finds the first scope started by '{' after the cursor and puts the cursor and mark on the '{' and '}'.", 102, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 32 }, -{ PROC_LINKS(select_next_scope_after_current, 0), false, "select_next_scope_after_current", 31, "Finds the first scope started by '{' after the mark and puts the cursor and mark on the '{' and '}'. This command is meant to be used after a scope is already selected so that it will have the effect of selecting the next scope after the current scope.", 253, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 41 }, -{ PROC_LINKS(select_prev_scope_absolute, 0), false, "select_prev_scope_absolute", 26, "Finds the first scope started by '{' before the cursor and puts the cursor and mark on the '{' and '}'.", 103, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 50 }, -{ PROC_LINKS(place_in_scope, 0), false, "place_in_scope", 14, "Wraps the code contained in the range between cursor and mark with a new curly brace scope.", 91, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 67 }, -{ PROC_LINKS(delete_current_scope, 0), false, "delete_current_scope", 20, "Deletes the braces surrounding the currently selected scope. Leaves the contents within the scope.", 99, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 73 }, +{ PROC_LINKS(select_surrounding_scope, 0), false, "select_surrounding_scope", 24, "Finds the scope enclosed by '{' '}' surrounding the cursor and puts the cursor and mark on the '{' and '}'.", 107, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 21 }, +{ PROC_LINKS(select_surrounding_scope_maximal, 0), false, "select_surrounding_scope_maximal", 32, "Selects the top-most scope that surrounds the cursor.", 53, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 33 }, +{ PROC_LINKS(select_next_scope_absolute, 0), false, "select_next_scope_absolute", 26, "Finds the first scope started by '{' after the cursor and puts the cursor and mark on the '{' and '}'.", 102, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 51 }, +{ PROC_LINKS(select_next_scope_after_current, 0), false, "select_next_scope_after_current", 31, "Finds the first scope started by '{' after the mark and puts the cursor and mark on the '{' and '}'. This command is meant to be used after a scope is already selected so that it will have the effect of selecting the next scope after the current scope.", 253, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 60 }, +{ PROC_LINKS(select_prev_scope_absolute, 0), false, "select_prev_scope_absolute", 26, "Finds the first scope started by '{' before the cursor and puts the cursor and mark on the '{' and '}'.", 103, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 69 }, +{ PROC_LINKS(select_prev_top_most_scope, 0), false, "select_prev_top_most_scope", 26, "Finds the first scope that starts before the cursor, then finds the top most scope that contains that scope.", 108, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 86 }, +{ PROC_LINKS(place_in_scope, 0), false, "place_in_scope", 14, "Wraps the code contained in the range between cursor and mark with a new curly brace scope.", 91, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 93 }, +{ PROC_LINKS(delete_current_scope, 0), false, "delete_current_scope", 20, "Deletes the braces surrounding the currently selected scope. Leaves the contents within the scope.", 99, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 99 }, { PROC_LINKS(open_long_braces, 0), false, "open_long_braces", 16, "At the cursor, insert a '{' and '}' separated by a blank line.", 62, "w:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 46 }, { PROC_LINKS(open_long_braces_semicolon, 0), false, "open_long_braces_semicolon", 26, "At the cursor, insert a '{' and '};' separated by a blank line.", 63, "w:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 54 }, { PROC_LINKS(open_long_braces_break, 0), false, "open_long_braces_break", 22, "At the cursor, insert a '{' and '}break;' separated by a blank line.", 68, "w:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 62 }, @@ -441,9 +445,9 @@ static Command_Metadata fcoder_metacmd_table[211] = { { PROC_LINKS(miblo_decrement_time_stamp, 0), false, "miblo_decrement_time_stamp", 26, "Decrement a time stamp under the cursor by one second. (format [m]m:ss or h:mm:ss", 81, "w:\\4ed\\code\\custom\\4coder_miblo_numbers.cpp", 43, 237 }, { PROC_LINKS(miblo_increment_time_stamp_minute, 0), false, "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, "w:\\4ed\\code\\custom\\4coder_miblo_numbers.cpp", 43, 243 }, { PROC_LINKS(miblo_decrement_time_stamp_minute, 0), false, "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, "w:\\4ed\\code\\custom\\4coder_miblo_numbers.cpp", 43, 249 }, -{ PROC_LINKS(profile_inspect, 0), true, "profile_inspect", 15, "Inspect all currently collected profiling information in 4coder's self profiler.", 80, "w:\\4ed\\code\\custom\\4coder_profile_inspect.cpp", 45, 774 }, +{ PROC_LINKS(profile_inspect, 0), true, "profile_inspect", 15, "Inspect all currently collected profiling information in 4coder's self profiler.", 80, "w:\\4ed\\code\\custom\\4coder_profile_inspect.cpp", 45, 777 }, { PROC_LINKS(default_startup, 0), false, "default_startup", 15, "Default command for responding to a startup event", 49, "w:\\4ed\\code\\custom\\4coder_default_hooks.cpp", 43, 7 }, -{ PROC_LINKS(default_try_exit, 0), false, "default_try_exit", 16, "Default command for responding to a try-exit event", 50, "w:\\4ed\\code\\custom\\4coder_default_hooks.cpp", 43, 21 }, +{ PROC_LINKS(default_try_exit, 0), false, "default_try_exit", 16, "Default command for responding to a try-exit event", 50, "w:\\4ed\\code\\custom\\4coder_default_hooks.cpp", 43, 22 }, }; static i32 fcoder_metacmd_ID_default_view_input_handler = 0; static i32 fcoder_metacmd_ID_profile_enable = 1; @@ -629,31 +633,33 @@ static i32 fcoder_metacmd_ID_list_all_functions_current_buffer_lister = 180; static i32 fcoder_metacmd_ID_list_all_functions_all_buffers = 181; static i32 fcoder_metacmd_ID_list_all_functions_all_buffers_lister = 182; static i32 fcoder_metacmd_ID_select_surrounding_scope = 183; -static i32 fcoder_metacmd_ID_select_next_scope_absolute = 184; -static i32 fcoder_metacmd_ID_select_next_scope_after_current = 185; -static i32 fcoder_metacmd_ID_select_prev_scope_absolute = 186; -static i32 fcoder_metacmd_ID_place_in_scope = 187; -static i32 fcoder_metacmd_ID_delete_current_scope = 188; -static i32 fcoder_metacmd_ID_open_long_braces = 189; -static i32 fcoder_metacmd_ID_open_long_braces_semicolon = 190; -static i32 fcoder_metacmd_ID_open_long_braces_break = 191; -static i32 fcoder_metacmd_ID_if0_off = 192; -static i32 fcoder_metacmd_ID_write_todo = 193; -static i32 fcoder_metacmd_ID_write_hack = 194; -static i32 fcoder_metacmd_ID_write_note = 195; -static i32 fcoder_metacmd_ID_write_block = 196; -static i32 fcoder_metacmd_ID_write_zero_struct = 197; -static i32 fcoder_metacmd_ID_comment_line = 198; -static i32 fcoder_metacmd_ID_uncomment_line = 199; -static i32 fcoder_metacmd_ID_comment_line_toggle = 200; -static i32 fcoder_metacmd_ID_snippet_lister = 201; -static i32 fcoder_metacmd_ID_miblo_increment_basic = 202; -static i32 fcoder_metacmd_ID_miblo_decrement_basic = 203; -static i32 fcoder_metacmd_ID_miblo_increment_time_stamp = 204; -static i32 fcoder_metacmd_ID_miblo_decrement_time_stamp = 205; -static i32 fcoder_metacmd_ID_miblo_increment_time_stamp_minute = 206; -static i32 fcoder_metacmd_ID_miblo_decrement_time_stamp_minute = 207; -static i32 fcoder_metacmd_ID_profile_inspect = 208; -static i32 fcoder_metacmd_ID_default_startup = 209; -static i32 fcoder_metacmd_ID_default_try_exit = 210; +static i32 fcoder_metacmd_ID_select_surrounding_scope_maximal = 184; +static i32 fcoder_metacmd_ID_select_next_scope_absolute = 185; +static i32 fcoder_metacmd_ID_select_next_scope_after_current = 186; +static i32 fcoder_metacmd_ID_select_prev_scope_absolute = 187; +static i32 fcoder_metacmd_ID_select_prev_top_most_scope = 188; +static i32 fcoder_metacmd_ID_place_in_scope = 189; +static i32 fcoder_metacmd_ID_delete_current_scope = 190; +static i32 fcoder_metacmd_ID_open_long_braces = 191; +static i32 fcoder_metacmd_ID_open_long_braces_semicolon = 192; +static i32 fcoder_metacmd_ID_open_long_braces_break = 193; +static i32 fcoder_metacmd_ID_if0_off = 194; +static i32 fcoder_metacmd_ID_write_todo = 195; +static i32 fcoder_metacmd_ID_write_hack = 196; +static i32 fcoder_metacmd_ID_write_note = 197; +static i32 fcoder_metacmd_ID_write_block = 198; +static i32 fcoder_metacmd_ID_write_zero_struct = 199; +static i32 fcoder_metacmd_ID_comment_line = 200; +static i32 fcoder_metacmd_ID_uncomment_line = 201; +static i32 fcoder_metacmd_ID_comment_line_toggle = 202; +static i32 fcoder_metacmd_ID_snippet_lister = 203; +static i32 fcoder_metacmd_ID_miblo_increment_basic = 204; +static i32 fcoder_metacmd_ID_miblo_decrement_basic = 205; +static i32 fcoder_metacmd_ID_miblo_increment_time_stamp = 206; +static i32 fcoder_metacmd_ID_miblo_decrement_time_stamp = 207; +static i32 fcoder_metacmd_ID_miblo_increment_time_stamp_minute = 208; +static i32 fcoder_metacmd_ID_miblo_decrement_time_stamp_minute = 209; +static i32 fcoder_metacmd_ID_profile_inspect = 210; +static i32 fcoder_metacmd_ID_default_startup = 211; +static i32 fcoder_metacmd_ID_default_try_exit = 212; #endif diff --git a/custom/generated/remapping.h b/custom/generated/remapping.h index 84ef4274..771ce3a5 100644 --- a/custom/generated/remapping.h +++ b/custom/generated/remapping.h @@ -138,7 +138,9 @@ setup_default_mapping(Mapping *mapping){ Bind(open_long_braces_semicolon, KeyCode_LeftBracket, KeyCode_Control, KeyCode_Shift); Bind(open_long_braces_break, KeyCode_RightBracket, KeyCode_Control, KeyCode_Shift); Bind(select_surrounding_scope, KeyCode_LeftBracket, KeyCode_Alt); + Bind(select_surrounding_scope_maximal, KeyCode_LeftBracket, KeyCode_Alt, KeyCode_Shift); Bind(select_prev_scope_absolute, KeyCode_RightBracket, KeyCode_Alt); + Bind(select_prev_top_most_scope, KeyCode_RightBracket, KeyCode_Alt, KeyCode_Shift); Bind(select_next_scope_absolute, KeyCode_Quote, KeyCode_Alt); Bind(select_next_scope_after_current, KeyCode_Quote, KeyCode_Alt, KeyCode_Shift); Bind(place_in_scope, KeyCode_ForwardSlash, KeyCode_Alt);