From bdf1d57eb5e3bc552879456908cf0f369d2854b7 Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Thu, 4 Apr 2019 01:25:16 -0700 Subject: [PATCH] Progress towards removing Buffer_Summary --- 4coder_api_transition_30_31_helpers.cpp | 275 ++++++++++++++ 4coder_auto_indent.cpp | 122 +++--- 4coder_base_commands.cpp | 29 +- 4coder_combined_write_commands.cpp | 61 +-- 4coder_default_hooks.cpp | 232 ++++++------ 4coder_function_list.cpp | 114 +++--- 4coder_generated/command_metadata.h | 468 ++++++++++++------------ 4coder_helper.cpp | 128 ++++--- 4coder_jump_direct.cpp | 10 +- 4coder_jump_lister.cpp | 4 +- 4coder_jump_sticky.cpp | 38 +- 4coder_jumping.cpp | 32 +- 4coder_scope_commands.cpp | 150 +++----- 4coder_scope_commands.h | 2 +- 4coder_search.cpp | 19 +- 15 files changed, 962 insertions(+), 722 deletions(-) diff --git a/4coder_api_transition_30_31_helpers.cpp b/4coder_api_transition_30_31_helpers.cpp index e918f195..f14b6c4f 100644 --- a/4coder_api_transition_30_31_helpers.cpp +++ b/4coder_api_transition_30_31_helpers.cpp @@ -55,6 +55,7 @@ read_line(Application_Links *app, Partition *part, Buffer_Summary *buffer, i32 l return(buffer==0?0:read_line(app, part, buffer->buffer_id, line, str)); } + static b32 init_stream_chunk(Stream_Chunk *chunk, Application_Links *app, Buffer_Summary *buffer, i32 pos, char *data, u32 size){ return(buffer==0?0:init_stream_chunk(chunk, app, buffer->buffer_id, pos, data, size)); @@ -65,6 +66,33 @@ init_stream_tokens(Stream_Tokens_DEP *stream, Application_Links *app, Buffer_Sum return(buffer==0?0:init_stream_tokens(stream, app, buffer->buffer_id, pos, data, count)); } +static String +token_get_lexeme(Application_Links *app, Buffer_Summary *buffer, Cpp_Token *token, char *out_buffer, i32 out_buffer_size){ + String result = {}; + if (buffer != 0){ + result = token_get_lexeme(app, buffer->buffer_id, token, out_buffer, out_buffer_size); + } + return(result); +} + +static String +token_get_lexeme(Application_Links *app, Partition *part, Buffer_Summary *buffer, Cpp_Token *token){ + String result = {}; + if (buffer != 0){ + result = token_get_lexeme(app, part, buffer->buffer_id, token); + } + return(result); +} + +static String +get_token_or_word_under_pos(Application_Links *app, Buffer_Summary *buffer, i32 pos, char *space, i32 capacity){ + String result = {}; + if (buffer != 0){ + result = get_token_or_word_under_pos(app, buffer->buffer_id, pos, space, capacity); + } + return(result); +} + static i32 seek_line_end(Application_Links *app, Buffer_Summary *buffer, i32 pos){ return(buffer==0?0:seek_line_end(app, buffer->buffer_id, pos)); @@ -261,6 +289,253 @@ query_replace_base(Application_Links *app, View_Summary *view, Buffer_Summary *b } } +static Statement_Parser +make_statement_parser(Application_Links *app, Buffer_Summary *buffer, i32 token_index){ + Statement_Parser parser = {}; + if (buffer != 0){ + parser = make_statement_parser(app, buffer->buffer_id, token_index); + } + return(parser); +} + +static b32 +find_whole_statement_down(Application_Links *app, Buffer_Summary *buffer, i32 pos, i32 *start_out, i32 *end_out){ + return(buffer==0?false:find_whole_statement_down(app, buffer->buffer_id, pos, start_out, end_out)); +} + +static b32 +find_scope_top(Application_Links *app, Buffer_Summary *buffer, i32 start_pos, u32 flags, i32 *end_pos_out){ + return(buffer==0?false:find_scope_top(app, buffer->buffer_id, start_pos, flags, end_pos_out)); +} + +static b32 +find_scope_bottom(Application_Links *app, Buffer_Summary *buffer, i32 start_pos, u32 flags, i32 *end_pos_out){ + return(buffer==0?false:find_scope_bottom(app, buffer->buffer_id, start_pos, flags, end_pos_out)); +} + +static b32 +find_scope_range(Application_Links *app, Buffer_Summary *buffer, i32 start_pos, Range *range_out, u32 flags){ + return(buffer==0?false:find_scope_range(app, buffer->buffer_id, start_pos, range_out, flags)); +} + +static b32 +find_next_scope(Application_Links *app, Buffer_Summary *buffer, i32 start_pos, u32 flags, i32 *end_pos_out){ + return(buffer==0?false:find_next_scope(app, buffer->buffer_id, start_pos, flags, end_pos_out)); +} + +static b32 +find_prev_scope(Application_Links *app, Buffer_Summary *buffer, i32 start_pos, u32 flags, i32 *end_pos_out){ + return(buffer==0?false:find_prev_scope(app, buffer->buffer_id, start_pos, flags, end_pos_out)); +} + +static Range_Array +get_enclosure_ranges(Application_Links *app, Partition *part, Buffer_Summary *buffer, i32 pos, u32 flags){ + Range_Array result = {}; + if (buffer != 0){ + result = get_enclosure_ranges(app, part, buffer->buffer_id, pos, flags); + } + return(result); +} + +static void +mark_enclosures(Application_Links *app, Partition *scratch, Managed_Scope render_scope, Buffer_Summary *buffer, i32 pos, u32 flags, Marker_Visual_Type type, int_color *back_colors, int_color *fore_colors, i32 color_count){ + if (buffer != 0){ + mark_enclosures(app, scratch, render_scope, buffer->buffer_id, pos, flags, type, back_colors, fore_colors, color_count); + } +} + +static Hard_Start_Result +buffer_find_hard_start(Application_Links *app, Buffer_Summary *buffer, i32 line_start, i32 tab_width){ + Hard_Start_Result result = {}; + if (buffer != 0){ + buffer_find_hard_start(app, buffer->buffer_id, line_start, tab_width); + } + return(result); +} + +static Buffer_Batch_Edit +make_batch_from_indent_marks(Application_Links *app, Partition *arena, Buffer_Summary *buffer, i32 first_line, i32 one_past_last_line, i32 *indent_marks, Indent_Options opts){ + Buffer_Batch_Edit result = {}; + if (buffer != 0){ + make_batch_from_indent_marks(app, arena, buffer->buffer_id, first_line, one_past_last_line, indent_marks, opts); + } + return(result); +} + +static void +set_line_indents(Application_Links *app, Partition *part, Buffer_Summary *buffer, i32 first_line, i32 one_past_last_line, i32 *indent_marks, Indent_Options opts){ + if (buffer != 0){ + set_line_indents(app, part, buffer->buffer_id, first_line, one_past_last_line, indent_marks, opts); + } +} + +static Indent_Anchor_Position +find_anchor_token(Application_Links *app, Buffer_Summary *buffer, Cpp_Token_Array tokens, i32 line_start, i32 tab_width){ + Indent_Anchor_Position result = {}; + if (buffer != 0){ + result = find_anchor_token(app, buffer->buffer_id, tokens, line_start, tab_width); + } + return(result); +} + +static i32* +get_indentation_marks(Application_Links *app, Partition *arena, Buffer_Summary *buffer, + Cpp_Token_Array tokens, i32 first_line, i32 one_past_last_line, + b32 exact_align, i32 tab_width){ + return(buffer==0?0:get_indentation_marks(app, arena, buffer->buffer_id, tokens, first_line, one_past_last_line, exact_align, tab_width)); +} + +static i32 +buffer_get_line_number(Application_Links *app, Buffer_Summary *buffer, i32 pos){ + return(buffer==0?0:buffer_get_line_number(app, buffer->buffer_id, pos)); +} + +static void +get_indent_lines_minimum(Application_Links *app, Buffer_Summary *buffer, i32 start_pos, i32 end_pos, i32 *line_start_out, i32 *line_end_out){ + if (buffer != 0){ + get_indent_lines_minimum(app, buffer->buffer_id, start_pos, end_pos, line_start_out, line_end_out); + } +} + +static void +get_indent_lines_whole_tokens(Application_Links *app, Buffer_Summary *buffer, Cpp_Token_Array tokens, i32 start_pos, i32 end_pos, i32 *line_start_out, i32 *line_end_out){ + if (buffer != 0){ + get_indent_lines_whole_tokens(app, buffer->buffer_id, tokens, start_pos, end_pos, line_start_out, line_end_out); + } +} + +static b32 +buffer_auto_indent(Application_Links *app, Partition *part, Buffer_Summary *buffer, i32 start, i32 end, i32 tab_width, Auto_Indent_Flag flags){ + return(buffer==0?0:buffer_auto_indent(app, part, buffer->buffer_id, start, end, tab_width, flags)); +} + +static b32 +buffer_auto_indent(Application_Links *app, Buffer_Summary *buffer, i32 start, i32 end, i32 tab_width, Auto_Indent_Flag flags){ + return(buffer==0?0:buffer_auto_indent(app, buffer->buffer_id, start, end, tab_width, flags)); +} + +static void +print_positions_buffered(Application_Links *app, Buffer_Summary *buffer, Function_Positions *positions_array, i32 positions_count, Buffered_Write_Stream *stream){ + if (buffer != 0){ + print_positions_buffered(app, buffer->buffer_id, positions_array, positions_count, stream); + } +} + +static Get_Positions_Results +get_function_positions(Application_Links *app, Buffer_Summary *buffer, i32 first_token_index, Function_Positions *positions_array, i32 positions_max){ + Get_Positions_Results result = {}; + if (buffer != 0){ + result = get_function_positions(app, buffer->buffer_id, first_token_index, positions_array, positions_max); + } + return(result); +} + +static void +list_all_functions(Application_Links *app, Partition *part, Buffer_Summary *optional_target_buffer){ + if (optional_target_buffer != 0){ + list_all_functions(app, part, optional_target_buffer->buffer_id); + } +} + +static i32 +get_start_of_line_at_cursor(Application_Links *app, View_Summary *view, Buffer_Summary *buffer){ + return(buffer==0?0:get_start_of_line_at_cursor(app, view, buffer->buffer_id)); +} + +static b32 +c_line_comment_starts_at_position(Application_Links *app, Buffer_Summary *buffer, i32 pos){ + return(buffer==0?0:c_line_comment_starts_at_position(app, buffer->buffer_id, pos)); +} + +static void +write_string(Application_Links *app, View_Summary *view, Buffer_Summary *buffer, String string){ + if (buffer != 0){ + write_string(app, view, buffer->buffer_id, string); + } +} + +static b32 +open_file(Application_Links *app, Buffer_Summary *buffer_out, char *filename, i32 filename_len, b32 background, b32 never_new){ + b32 result = false; + Buffer_ID id_out = 0; + result = open_file(app, &id_out, filename, filename_len, background, never_new); + if (result && buffer_out != 0){ + get_buffer_summary(app, id_out, AccessAll, buffer_out); + } + return(result); +} + +static b32 +get_cpp_matching_file(Application_Links *app, Buffer_Summary buffer, Buffer_Summary *buffer_out){ + b32 result = false; + if (buffer.exists){ + Buffer_ID id_out = 0; + result = get_cpp_matching_file(app, buffer.buffer_id, &id_out); + if (result && buffer_out != 0){ + get_buffer_summary(app, id_out, AccessAll, buffer_out); + } + } + return(result); +} + +static b32 +get_jump_buffer(Application_Links *app, Buffer_Summary *buffer, Name_Line_Column_Location *location){ + Buffer_ID id = 0; + b32 result = get_jump_buffer(app, &id, location); + if (result){ + get_buffer_summary(app, id, AccessAll, buffer); + } + return(result); +} + +static b32 +get_jump_buffer(Application_Links *app, Buffer_Summary *buffer, ID_Pos_Jump_Location *location, Access_Flag access){ + Buffer_ID id = 0; + b32 result = get_jump_buffer(app, &id, location, access); + if (result){ + get_buffer_summary(app, id, AccessAll, buffer); + } + return(result); +} + +static b32 +get_jump_buffer(Application_Links *app, Buffer_Summary *buffer, ID_Pos_Jump_Location *location){ + Buffer_ID id = 0; + b32 result = get_jump_buffer(app, &id, location); + if (result){ + get_buffer_summary(app, id, AccessAll, buffer); + } + return(result); +} + +static void +switch_to_existing_view(Application_Links *app, View_Summary *view, Buffer_Summary *buffer){ + if (buffer != 0){ + switch_to_existing_view(app, view, buffer->buffer_id); + } +} + +static void +set_view_to_location(Application_Links *app, View_Summary *view, Buffer_Summary *buffer, Buffer_Seek seek){ + if (buffer != 0){ + set_view_to_location(app, view, buffer->buffer_id, seek); + } +} + +static void +jump_to_location(Application_Links *app, View_Summary *view, Buffer_Summary *buffer, Name_Line_Column_Location location){ + if (buffer != 0){ + jump_to_location(app, view, buffer->buffer_id, location); + } +} + +static void +jump_to_location(Application_Links *app, View_Summary *view, Buffer_Summary *buffer, ID_Pos_Jump_Location location){ + if (buffer != 0){ + jump_to_location(app, view, buffer->buffer_id, location); + } +} + #endif // BOTTOM diff --git a/4coder_auto_indent.cpp b/4coder_auto_indent.cpp index ebb5618b..0774fbd1 100644 --- a/4coder_auto_indent.cpp +++ b/4coder_auto_indent.cpp @@ -5,7 +5,7 @@ // TOP static Hard_Start_Result -buffer_find_hard_start(Application_Links *app, Buffer_Summary *buffer, i32 line_start, i32 tab_width){ +buffer_find_hard_start(Application_Links *app, Buffer_ID buffer, i32 line_start, i32 tab_width){ i32 tab_additional_width = tab_width - 1; Hard_Start_Result result = {}; @@ -16,7 +16,7 @@ buffer_find_hard_start(Application_Links *app, Buffer_Summary *buffer, i32 line_ char data_chunk[1024]; Stream_Chunk stream = {}; stream.add_null = true; - if (init_stream_chunk(&stream, app, buffer->buffer_id, line_start, data_chunk, sizeof(data_chunk))){ + if (init_stream_chunk(&stream, app, buffer, line_start, data_chunk, sizeof(data_chunk))){ b32 still_looping = true; do{ for (; result.char_pos < stream.end; ++result.char_pos){ @@ -49,8 +49,9 @@ buffer_find_hard_start(Application_Links *app, Buffer_Summary *buffer, i32 line_ return(result); } +// TODO(allen): rewrite with arena and linked list batch. static Buffer_Batch_Edit -make_batch_from_indent_marks(Application_Links *app, Partition *arena, Buffer_Summary *buffer, +make_batch_from_indent_marks(Application_Links *app, Partition *arena, Buffer_ID buffer, i32 first_line, i32 one_past_last_line, i32 *indent_marks, Indent_Options opts){ i32 *shifted_indent_marks = indent_marks - first_line; @@ -64,7 +65,7 @@ make_batch_from_indent_marks(Application_Links *app, Partition *arena, Buffer_Su for (i32 line_number = first_line; line_number < one_past_last_line; ++line_number){ - i32 line_start_pos = buffer_get_line_start(app, buffer->buffer_id, line_number); + i32 line_start_pos = buffer_get_line_start(app, buffer, line_number); Hard_Start_Result hard_start = buffer_find_hard_start(app, buffer, line_start_pos, opts.tab_width); i32 correct_indentation = shifted_indent_marks[line_number]; @@ -99,7 +100,7 @@ make_batch_from_indent_marks(Application_Links *app, Partition *arena, Buffer_Su } } - Buffer_Edit new_edit; + Buffer_Edit new_edit = {}; new_edit.str_start = (i32)(str - str_base); new_edit.len = str_size; new_edit.start = line_start_pos; @@ -119,15 +120,10 @@ make_batch_from_indent_marks(Application_Links *app, Partition *arena, Buffer_Su } static void -set_line_indents(Application_Links *app, Partition *part, Buffer_Summary *buffer, - i32 first_line, i32 one_past_last_line, - i32 *indent_marks, Indent_Options opts){ - Buffer_Batch_Edit batch = make_batch_from_indent_marks(app, part, buffer, - first_line, one_past_last_line, - indent_marks, opts); +set_line_indents(Application_Links *app, Partition *part, Buffer_ID buffer, i32 first_line, i32 one_past_last_line, i32 *indent_marks, Indent_Options opts){ + Buffer_Batch_Edit batch = make_batch_from_indent_marks(app, part, buffer, first_line, one_past_last_line, indent_marks, opts); if (batch.edit_count > 0){ - buffer_batch_edit(app, buffer, batch.str, batch.str_len, batch.edits, batch.edit_count, - BatchEdit_PreserveTokens); + buffer_batch_edit(app, buffer, batch.str, batch.str_len, batch.edits, batch.edit_count, BatchEdit_PreserveTokens); } } @@ -159,20 +155,16 @@ seek_matching_token_backwards(Cpp_Token_Array tokens, Cpp_Token *token, } static Indent_Anchor_Position -find_anchor_token(Application_Links *app, Buffer_Summary *buffer, Cpp_Token_Array tokens, - i32 line_start, i32 tab_width){ - // NOTE(allen): New implementation of find_anchor_token (4.0.26) revert if it is a problem. +find_anchor_token(Application_Links *app, Buffer_ID buffer, Cpp_Token_Array tokens, i32 line_start, i32 tab_width){ Indent_Anchor_Position anchor = {}; - if (tokens.count > 0){ - Cpp_Token *first_invalid_token = get_first_token_at_line(app, buffer->buffer_id, tokens, line_start); + Cpp_Token *first_invalid_token = get_first_token_at_line(app, buffer, tokens, line_start); if (first_invalid_token <= tokens.tokens){ anchor.token = tokens.tokens; } else{ i32 stack[256]; i32 top = -1; - Cpp_Token *token_it = tokens.tokens; i32 highest_checked_line_number = -1; for (; token_it < first_invalid_token; ++token_it){ @@ -240,7 +232,7 @@ find_anchor_token(Application_Links *app, Buffer_Summary *buffer, Cpp_Token_Arra } static i32* -get_indentation_marks(Application_Links *app, Partition *arena, Buffer_Summary *buffer, +get_indentation_marks(Application_Links *app, Partition *arena, Buffer_ID buffer, Cpp_Token_Array tokens, i32 first_line, i32 one_past_last_line, b32 exact_align, i32 tab_width){ i32 indent_mark_count = one_past_last_line - first_line; @@ -269,7 +261,7 @@ get_indentation_marks(Application_Links *app, Partition *arena, Buffer_Summary * indent.current_indent = 0; } - i32 next_line_start_pos = buffer_get_line_start(app, buffer->buffer_id, line_number); + i32 next_line_start_pos = buffer_get_line_start(app, buffer, line_number); indent.previous_line_indent = indent.current_indent; Cpp_Token prev_token = {}; Cpp_Token token = {}; @@ -295,17 +287,17 @@ get_indentation_marks(Application_Links *app, Partition *arena, Buffer_Summary * } else{ token.type = CPP_TOKEN_EOF; - token.start = buffer->size; + buffer_get_size(app, buffer, &token.start); token.flags = 0; } for (;token.start >= next_line_start_pos && line_number < one_past_last_line;){ - next_line_start_pos = buffer_get_line_start(app, buffer->buffer_id, line_number + 1); + next_line_start_pos = buffer_get_line_start(app, buffer, line_number + 1); i32 this_indent = 0; i32 previous_indent = indent.previous_line_indent; - i32 this_line_start = buffer_get_line_start(app, buffer->buffer_id, line_number); + i32 this_line_start = buffer_get_line_start(app, buffer, line_number); i32 next_line_start = next_line_start_pos; b32 did_multi_line_behavior = false; @@ -460,7 +452,7 @@ get_indentation_marks(Application_Links *app, Partition *arena, Buffer_Summary * case CPP_TOKEN_STRING_CONSTANT: { i32 line = buffer_get_line_number(app, buffer, token.start); - i32 start = buffer_get_line_start(app, buffer->buffer_id, line); + i32 start = buffer_get_line_start(app, buffer, line); Hard_Start_Result hard_start = buffer_find_hard_start(app, buffer, start, tab_width); i32 old_dist_to_token = (token.start - start); @@ -477,7 +469,7 @@ get_indentation_marks(Application_Links *app, Partition *arena, Buffer_Summary * if (!(token.flags & CPP_TFLAG_PP_BODY)){ if (indent.paren_nesting < ArrayCount(indent.paren_anchor_indent)){ i32 line = buffer_get_line_number(app, buffer, token.start); - i32 start = buffer_get_line_start(app, buffer->buffer_id, line); + i32 start = buffer_get_line_start(app, buffer, line); i32 char_pos = token.start - start; Hard_Start_Result hard_start = buffer_find_hard_start(app, buffer, start, tab_width); @@ -508,22 +500,21 @@ get_indentation_marks(Application_Links *app, Partition *arena, Buffer_Summary * } static void -get_indent_lines_minimum(Application_Links *app, Buffer_Summary *buffer, i32 start_pos, i32 end_pos, i32 *line_start_out, i32 *line_end_out){ +get_indent_lines_minimum(Application_Links *app, Buffer_ID buffer, i32 start_pos, i32 end_pos, i32 *line_start_out, i32 *line_end_out){ i32 line_start = buffer_get_line_number(app, buffer, start_pos); i32 line_end = buffer_get_line_number(app, buffer, end_pos) + 1; - *line_start_out = line_start; *line_end_out = line_end; } static void -get_indent_lines_whole_tokens(Application_Links *app, Buffer_Summary *buffer, Cpp_Token_Array tokens, i32 start_pos, i32 end_pos, i32 *line_start_out, i32 *line_end_out){ +get_indent_lines_whole_tokens(Application_Links *app, Buffer_ID buffer, Cpp_Token_Array tokens, i32 start_pos, i32 end_pos, i32 *line_start_out, i32 *line_end_out){ i32 line_start = buffer_get_line_number(app, buffer, start_pos); i32 line_end = buffer_get_line_number(app, buffer, end_pos); for (;line_start > 1;){ i32 line_start_pos = 0; - Cpp_Token *token = get_first_token_at_line(app, buffer->buffer_id, tokens, line_start, &line_start_pos); + Cpp_Token *token = get_first_token_at_line(app, buffer, tokens, line_start, &line_start_pos); if (token && token->start < line_start_pos){ line_start = buffer_get_line_number(app, buffer, token->start); } @@ -532,19 +523,22 @@ get_indent_lines_whole_tokens(Application_Links *app, Buffer_Summary *buffer, Cp } } - for (;line_end < buffer->line_count;){ + i32 line_count = 0; + buffer_get_line_count(app, buffer, &line_count); + + for (;line_end < line_count;){ i32 next_line_start_pos = 0; - Cpp_Token *token = get_first_token_at_line(app, buffer->buffer_id, tokens, line_end+1, &next_line_start_pos); - if (token && token->start < next_line_start_pos){ - line_end = buffer_get_line_number(app, buffer, token->start+token->size); + Cpp_Token *token = get_first_token_at_line(app, buffer, tokens, line_end + 1, &next_line_start_pos); + if (token != 0 && token->start < next_line_start_pos){ + line_end = buffer_get_line_number(app, buffer, token->start + token->size); } else{ break; } } - if (line_end > buffer->line_count){ - line_end = buffer->line_count + 1; + if (line_end > line_count){ + line_end = line_count + 1; } else{ line_end += 1; @@ -555,17 +549,16 @@ get_indent_lines_whole_tokens(Application_Links *app, Buffer_Summary *buffer, Cp } static b32 -buffer_auto_indent(Application_Links *app, Partition *part, Buffer_Summary *buffer, i32 start, i32 end, i32 tab_width, Auto_Indent_Flag flags){ - +buffer_auto_indent(Application_Links *app, Partition *part, Buffer_ID buffer, i32 start, i32 end, i32 tab_width, Auto_Indent_Flag flags){ b32 result = false; - if (buffer->exists && buffer->tokens_are_ready){ + if (buffer_exists(app, buffer) && buffer_tokens_are_ready(app, buffer)){ result = true; Temp_Memory temp = begin_temp_memory(part); // Stage 1: Read the tokens to be used for indentation. - Cpp_Token_Array tokens; - tokens.count = buffer_token_count(app, buffer); + Cpp_Token_Array tokens = {}; + buffer_token_count(app, buffer, &tokens.count); tokens.max_count = tokens.count; tokens.tokens = push_array(part, Cpp_Token, tokens.count); buffer_read_tokens(app, buffer, 0, tokens.count, tokens.tokens); @@ -600,7 +593,7 @@ buffer_auto_indent(Application_Links *app, Partition *part, Buffer_Summary *buff } static b32 -buffer_auto_indent(Application_Links *app, Buffer_Summary *buffer, i32 start, i32 end, i32 tab_width, Auto_Indent_Flag flags){ +buffer_auto_indent(Application_Links *app, Buffer_ID buffer, i32 start, i32 end, i32 tab_width, Auto_Indent_Flag flags){ return(buffer_auto_indent(app, &global_part, buffer, start, end, tab_width, flags)); } @@ -619,52 +612,49 @@ buffer_auto_indent(Application_Links *app, Buffer_Summary *buffer, i32 start, i3 CUSTOM_COMMAND_SIG(auto_tab_whole_file) CUSTOM_DOC("Audo-indents the entire current buffer.") { - u32 access = AccessOpen; - View_Summary view = get_active_view(app, access); - Buffer_Summary buffer = get_buffer(app, view.buffer_id, access); - - buffer_auto_indent(app, &global_part, &buffer, 0, buffer.size, DEF_TAB_WIDTH, DEFAULT_INDENT_FLAGS | AutoIndent_FullTokens); + View_Summary view = get_active_view(app, AccessOpen); + Buffer_ID buffer = 0; + view_get_buffer(app, view.view_id, AccessOpen, &buffer); + i32 buffer_size = 0; + buffer_get_size(app, buffer, &buffer_size); + buffer_auto_indent(app, &global_part, buffer, 0, buffer_size, DEF_TAB_WIDTH, DEFAULT_INDENT_FLAGS | AutoIndent_FullTokens); } CUSTOM_COMMAND_SIG(auto_tab_line_at_cursor) CUSTOM_DOC("Auto-indents the line on which the cursor sits.") { - u32 access = AccessOpen; - View_Summary view = get_active_view(app, access); - Buffer_Summary buffer = get_buffer(app, view.buffer_id, access); - - buffer_auto_indent(app, &global_part, &buffer, view.cursor.pos, view.cursor.pos, DEF_TAB_WIDTH, DEFAULT_INDENT_FLAGS | AutoIndent_FullTokens); - move_past_lead_whitespace(app, &view, buffer.buffer_id); + View_Summary view = get_active_view(app, AccessOpen); + Buffer_ID buffer = 0; + view_get_buffer(app, view.view_id, AccessOpen, &buffer); + buffer_auto_indent(app, &global_part, buffer, view.cursor.pos, view.cursor.pos, DEF_TAB_WIDTH, DEFAULT_INDENT_FLAGS | AutoIndent_FullTokens); + move_past_lead_whitespace(app, &view, buffer); } CUSTOM_COMMAND_SIG(auto_tab_range) CUSTOM_DOC("Auto-indents the range between the cursor and the mark.") { - u32 access = AccessOpen; - View_Summary view = get_active_view(app, access); - Buffer_Summary buffer = get_buffer(app, view.buffer_id, access); + View_Summary view = get_active_view(app, AccessOpen); + Buffer_ID buffer = 0; + view_get_buffer(app, view.view_id, AccessOpen, &buffer); Range range = get_view_range(&view); - - buffer_auto_indent(app, &global_part, &buffer, range.min, range.max, DEF_TAB_WIDTH, DEFAULT_INDENT_FLAGS | AutoIndent_FullTokens); - move_past_lead_whitespace(app, &view, buffer.buffer_id); + buffer_auto_indent(app, &global_part, buffer, range.min, range.max, DEF_TAB_WIDTH, DEFAULT_INDENT_FLAGS | AutoIndent_FullTokens); + move_past_lead_whitespace(app, &view, buffer); } CUSTOM_COMMAND_SIG(write_and_auto_tab) CUSTOM_DOC("Inserts a character and auto-indents the line on which the cursor sits.") { exec_command(app, write_character); - - u32 access = AccessOpen; - View_Summary view = get_active_view(app, access); - Buffer_Summary buffer = get_buffer(app, view.buffer_id, access); - + View_Summary view = get_active_view(app, AccessOpen); + Buffer_ID buffer = 0; + view_get_buffer(app, view.view_id, AccessOpen, &buffer); u32 flags = DEFAULT_INDENT_FLAGS; User_Input in = get_command_input(app); if (in.key.character == '\n'){ flags |= AutoIndent_ExactAlignBlock; } - buffer_auto_indent(app, &global_part, &buffer, view.cursor.pos, view.cursor.pos, DEF_TAB_WIDTH, flags); - move_past_lead_whitespace(app, &view, buffer.buffer_id); + buffer_auto_indent(app, &global_part, buffer, view.cursor.pos, view.cursor.pos, DEF_TAB_WIDTH, flags); + move_past_lead_whitespace(app, &view, buffer); } // BOTTOM diff --git a/4coder_base_commands.cpp b/4coder_base_commands.cpp index d71a1c01..7f79e949 100644 --- a/4coder_base_commands.cpp +++ b/4coder_base_commands.cpp @@ -1474,18 +1474,20 @@ CUSTOM_DOC("Delete the line the on which the cursor sits.") //////////////////////////////// static b32 -get_cpp_matching_file(Application_Links *app, Buffer_Summary buffer, Buffer_Summary *buffer_out){ +get_cpp_matching_file(Application_Links *app, Buffer_ID buffer, Buffer_ID *buffer_out){ b32 result = false; - - if (buffer.file_name != 0){ - char space[512]; - String file_name = make_string_cap(space, 0, sizeof(space)); - append(&file_name, make_string(buffer.file_name, buffer.file_name_len)); - + Arena *scratch = context_get_arena(app); + Temp_Memory_Arena temp = begin_temp_memory(scratch); + String file_name = {}; + buffer_get_file_name(app, buffer, 0, &file_name.memory_size); + file_name.memory_size += 4; + file_name.str = push_array(scratch, char, file_name.memory_size); + buffer_get_file_name(app, buffer, &file_name, 0); + buffer_push_file_name(app, buffer, scratch); + if (file_name.size > 0){ String extension = file_extension(file_name); String new_extensions[2] = {}; i32 new_extensions_count = 0; - if (match(extension, "cpp") || match(extension, "cc")){ new_extensions[0] = make_lit_string("h"); new_extensions[1] = make_lit_string("hpp"); @@ -1504,7 +1506,6 @@ get_cpp_matching_file(Application_Links *app, Buffer_Summary buffer, Buffer_Summ new_extensions[0] = make_lit_string("cpp"); new_extensions_count = 1; } - remove_extension(&file_name); i32 base_pos = file_name.size; for (i32 i = 0; i < new_extensions_count; ++i){ @@ -1519,6 +1520,8 @@ get_cpp_matching_file(Application_Links *app, Buffer_Summary buffer, Buffer_Summ } } + end_temp_memory(temp); + return(result); } @@ -1569,12 +1572,12 @@ CUSTOM_COMMAND_SIG(open_matching_file_cpp) CUSTOM_DOC("If the current file is a *.cpp or *.h, attempts to open the corresponding *.h or *.cpp file in the other view.") { View_Summary view = get_active_view(app, AccessAll); - Buffer_Summary buffer = get_buffer(app, view.buffer_id, AccessAll); - - Buffer_Summary new_buffer = {}; + Buffer_ID buffer = 0; + view_get_buffer(app, view.view_id, AccessAll, &buffer); + Buffer_ID new_buffer = 0; if (get_cpp_matching_file(app, buffer, &new_buffer)){ get_next_view_looped_primary_panels(app, &view, AccessAll); - view_set_buffer(app, &view, new_buffer.buffer_id, 0); + view_set_buffer(app, &view, new_buffer, 0); set_active_view(app, &view); } } diff --git a/4coder_combined_write_commands.cpp b/4coder_combined_write_commands.cpp index 5ae95410..5569cb50 100644 --- a/4coder_combined_write_commands.cpp +++ b/4coder_combined_write_commands.cpp @@ -5,17 +5,17 @@ // TOP static void -write_string(Application_Links *app, View_Summary *view, Buffer_Summary *buffer, String string){ - buffer_replace_range(app, buffer, view->cursor.pos, view->cursor.pos, string.str, string.size); +write_string(Application_Links *app, View_Summary *view, Buffer_ID buffer, String string){ + buffer_replace_range(app, buffer, view->cursor.pos, view->cursor.pos, string); view_set_cursor(app, view, seek_pos(view->cursor.pos + string.size), 1); } static void write_string(Application_Links *app, String string){ - u32 access = AccessOpen; - View_Summary view = get_active_view(app, access); - Buffer_Summary buffer = get_buffer(app, view.buffer_id, access); - write_string(app, &view, &buffer, string); + View_Summary view = get_active_view(app, AccessOpen); + Buffer_ID buffer = 0; + view_get_buffer(app, view.view_id, AccessOpen, &buffer); + write_string(app, &view, buffer, string); } static void @@ -43,13 +43,13 @@ write_named_comment_string(Application_Links *app, char *type_string){ static void long_braces(Application_Links *app, char *text, i32 size){ View_Summary view = get_active_view(app, AccessOpen); - Buffer_Summary buffer = get_buffer(app, view.buffer_id, AccessOpen); + Buffer_ID buffer = 0; + view_get_buffer(app, view.view_id, AccessOpen, &buffer); i32 pos = view.cursor.pos; - buffer_replace_range(app, &buffer, pos, pos, text, size); + buffer_replace_range(app, buffer, pos, pos, make_string(text, size)); view_set_cursor(app, &view, seek_pos(pos + 2), true); - - buffer_auto_indent(app, &global_part, &buffer, pos, pos + size, DEF_TAB_WIDTH, DEFAULT_INDENT_FLAGS | AutoIndent_FullTokens); - move_past_lead_whitespace(app, &view, buffer.buffer_id); + buffer_auto_indent(app, &global_part, buffer, pos, pos + size, DEF_TAB_WIDTH, DEFAULT_INDENT_FLAGS | AutoIndent_FullTokens); + move_past_lead_whitespace(app, &view, buffer); } CUSTOM_COMMAND_SIG(open_long_braces) @@ -113,7 +113,7 @@ CUSTOM_DOC("At the cursor, insert a ' = {};'.") } static i32 -get_start_of_line_at_cursor(Application_Links *app, View_Summary *view, Buffer_Summary *buffer){ +get_start_of_line_at_cursor(Application_Links *app, View_Summary *view, Buffer_ID buffer){ Full_Cursor cursor = {}; view_compute_cursor(app, view, seek_line_char(view->cursor.line, 1), &cursor); Hard_Start_Result hard_start = buffer_find_hard_start(app, buffer, cursor.pos, DEF_TAB_WIDTH); @@ -121,7 +121,7 @@ get_start_of_line_at_cursor(Application_Links *app, View_Summary *view, Buffer_S } static b32 -c_line_comment_starts_at_position(Application_Links *app, Buffer_Summary *buffer, i32 pos){ +c_line_comment_starts_at_position(Application_Links *app, Buffer_ID buffer, i32 pos){ b32 alread_has_comment = false; char check_buffer[2]; if (buffer_read_range(app, buffer, pos, pos + 2, check_buffer)){ @@ -136,11 +136,12 @@ CUSTOM_COMMAND_SIG(comment_line) CUSTOM_DOC("Insert '//' at the beginning of the line after leading whitespace.") { View_Summary view = get_active_view(app, AccessOpen); - Buffer_Summary buffer = get_buffer(app, view.buffer_id, AccessOpen); - i32 pos = get_start_of_line_at_cursor(app, &view, &buffer); - b32 alread_has_comment = c_line_comment_starts_at_position(app, &buffer, pos); + Buffer_ID buffer = 0; + view_get_buffer(app, view.view_id, AccessOpen, &buffer); + i32 pos = get_start_of_line_at_cursor(app, &view, buffer); + b32 alread_has_comment = c_line_comment_starts_at_position(app, buffer, pos); if (!alread_has_comment){ - buffer_replace_range(app, &buffer, pos, pos, "//", 2); + buffer_replace_range(app, buffer, pos, pos, make_lit_string("//")); } } @@ -148,11 +149,12 @@ CUSTOM_COMMAND_SIG(uncomment_line) CUSTOM_DOC("If present, delete '//' at the beginning of the line after leading whitespace.") { View_Summary view = get_active_view(app, AccessOpen); - Buffer_Summary buffer = get_buffer(app, view.buffer_id, AccessOpen); - i32 pos = get_start_of_line_at_cursor(app, &view, &buffer); - b32 alread_has_comment = c_line_comment_starts_at_position(app, &buffer, pos); + Buffer_ID buffer = 0; + view_get_buffer(app, view.view_id, AccessOpen, &buffer); + i32 pos = get_start_of_line_at_cursor(app, &view, buffer); + b32 alread_has_comment = c_line_comment_starts_at_position(app, buffer, pos); if (alread_has_comment){ - buffer_replace_range(app, &buffer, pos, pos + 2, 0, 0); + buffer_replace_range(app, buffer, pos, pos + 2, make_lit_string("")); } } @@ -160,14 +162,15 @@ CUSTOM_COMMAND_SIG(comment_line_toggle) CUSTOM_DOC("Turns uncommented lines into commented lines and vice versa for comments starting with '//'.") { View_Summary view = get_active_view(app, AccessOpen); - Buffer_Summary buffer = get_buffer(app, view.buffer_id, AccessOpen); - i32 pos = get_start_of_line_at_cursor(app, &view, &buffer); - b32 alread_has_comment = c_line_comment_starts_at_position(app, &buffer, pos); + Buffer_ID buffer = 0; + view_get_buffer(app, view.view_id, AccessOpen, &buffer); + i32 pos = get_start_of_line_at_cursor(app, &view, buffer); + b32 alread_has_comment = c_line_comment_starts_at_position(app, buffer, pos); if (alread_has_comment){ - buffer_replace_range(app, &buffer, pos, pos + 2, 0, 0); + buffer_replace_range(app, buffer, pos, pos + 2, make_lit_string("")); } else{ - buffer_replace_range(app, &buffer, pos, pos, "//", 2); + buffer_replace_range(app, buffer, pos, pos, make_lit_string("//")); } } @@ -212,10 +215,10 @@ activate_snippet(Application_Links *app, Partition *scratch, Heap *heap, if (0 <= index && index < snippets.count){ Snippet snippet = snippets.snippets[index]; lister_default(app, scratch, heap, view, state, ListerActivation_Finished); - Buffer_Summary buffer = get_buffer(app, view->buffer_id, AccessOpen); + Buffer_ID buffer = 0; + view_get_buffer(app, view->view_id, AccessOpen, &buffer); i32 pos = view->cursor.pos; - i32 len = str_size(snippet.text); - buffer_replace_range(app, &buffer, pos, pos, snippet.text, len); + buffer_replace_range(app, buffer, pos, pos, make_string_slowly(snippet.text)); view_set_cursor(app, view, seek_pos(pos + snippet.cursor_offset), true); view_set_mark(app, view, seek_pos(pos + snippet.mark_offset)); } diff --git a/4coder_default_hooks.cpp b/4coder_default_hooks.cpp index 7a9011ca..f811fa18 100644 --- a/4coder_default_hooks.cpp +++ b/4coder_default_hooks.cpp @@ -140,8 +140,7 @@ sort_highlight_record(Highlight_Record *records, i32 first, i32 one_past_last){ } static Range_Array -get_enclosure_ranges(Application_Links *app, Partition *part, - Buffer_Summary *buffer, i32 pos, u32 flags){ +get_enclosure_ranges(Application_Links *app, Partition *part, Buffer_ID buffer, i32 pos, u32 flags){ Range_Array array = {}; array.ranges = push_array(part, Range, 0); for (;;){ @@ -160,10 +159,8 @@ get_enclosure_ranges(Application_Links *app, Partition *part, } static void -mark_enclosures(Application_Links *app, Partition *scratch, Managed_Scope render_scope, - Buffer_Summary *buffer, i32 pos, u32 flags, - Marker_Visual_Type type, - int_color *back_colors, int_color *fore_colors, i32 color_count){ +mark_enclosures(Application_Links *app, Partition *scratch, Managed_Scope render_scope, Buffer_ID buffer, i32 pos, u32 flags, + Marker_Visual_Type type, int_color *back_colors, int_color *fore_colors, i32 color_count){ Temp_Memory temp = begin_temp_memory(scratch); Range_Array ranges = get_enclosure_ranges(app, scratch, buffer, pos, flags); @@ -178,7 +175,7 @@ mark_enclosures(Application_Links *app, Partition *scratch, Managed_Scope render marker[0].pos = range->first; marker[1].pos = range->one_past_last - 1; } - Managed_Object o = alloc_buffer_markers_on_buffer(app, buffer->buffer_id, marker_count, &render_scope); + Managed_Object o = alloc_buffer_markers_on_buffer(app, buffer, marker_count, &render_scope); managed_object_store_data(app, o, 0, marker_count, markers); Marker_Visual_Take_Rule take_rule = {}; @@ -301,14 +298,16 @@ GET_VIEW_BUFFER_REGION_SIG(default_view_buffer_region){ // line number margins if (global_config.show_line_number_margins){ - Buffer_Summary buffer = {}; - get_buffer_summary(app, view.buffer_id, AccessAll, &buffer); - i32 line_count_digit_count = int_to_str_size(buffer.line_count); - Face_ID font_id = 0; - get_face_id(app, view.buffer_id, &font_id); - // TODO(allen): I need a "digit width" - f32 zero = get_string_advance(app, font_id, make_lit_string("0")); - i32 margin_width = ceil32((f32)line_count_digit_count*zero); + Buffer_ID buffer = 0; + view_get_buffer(app, view.view_id, AccessAll, &buffer); + i32 line_count = 0; + buffer_get_line_count(app, buffer, &line_count); + i32 line_count_digit_count = int_to_str_size(line_count); + Face_ID face_id = 0; + get_face_id(app, buffer, &face_id); + Face_Metrics metrics = {}; + get_face_metrics(app, face_id, &metrics); + i32 margin_width = ceil32((f32)line_count_digit_count*metrics.typical_character_width); sub_region.x0 += margin_width + 2; } @@ -362,8 +361,9 @@ default_buffer_render_caller(Application_Links *app, Frame_Info frame_info, View text_layout_free(app, text_layout_id); View_Summary view = get_view(app, view_id, AccessAll); - Buffer_Summary buffer = get_buffer(app, view.buffer_id, AccessAll); View_Summary active_view = get_active_view(app, AccessAll); + Buffer_ID buffer = 0; + view_get_buffer(app, view_id, AccessAll, &buffer); b32 is_active_view = (active_view.view_id == view_id); f32 line_height = view.line_height; @@ -385,7 +385,7 @@ default_buffer_render_caller(Application_Links *app, Frame_Info frame_info, View if (view_get_setting(app, view_id, ViewSetting_ShowFileBar, &showing_file_bar)){ if (showing_file_bar){ Face_ID face_id = 0; - get_face_id(app, view.buffer_id, &face_id); + get_face_id(app, buffer, &face_id); Rect_f32 bar = r_cursor; bar.y1 = bar.y0 + line_height + 2.f; @@ -399,7 +399,7 @@ default_buffer_render_caller(Application_Links *app, Frame_Info frame_info, View Temp_Memory_Arena temp = begin_temp_memory(arena); Fancy_String_List list = {}; - push_fancy_string(arena, &list, base_color, make_string(buffer.buffer_name, buffer.buffer_name_len)); + push_fancy_string(arena, &list, base_color, buffer_push_unique_buffer_name(app, buffer, arena)); push_fancy_stringf(arena, &list, base_color, " - L#%d C#%d -", view.cursor.line, view.cursor.character); Face_Metrics face_metrics = {}; @@ -408,7 +408,7 @@ default_buffer_render_caller(Application_Links *app, Frame_Info frame_info, View face_metrics.line_height, face_metrics.typical_character_width); b32 is_dos_mode = false; - if (buffer_get_setting(app, buffer.buffer_id, BufferSetting_Eol, &is_dos_mode)){ + if (buffer_get_setting(app, buffer, BufferSetting_Eol, &is_dos_mode)){ if (is_dos_mode){ push_fancy_string(arena, &list, base_color, make_lit_string(" dos")); } @@ -421,7 +421,8 @@ default_buffer_render_caller(Application_Links *app, Frame_Info frame_info, View } { - Dirty_State dirty = buffer.dirty; + Dirty_State dirty = 0; + buffer_get_dirty_state(app, buffer, &dirty); char space[3]; String str = make_fixed_width_string(space); if (dirty != 0){ @@ -478,7 +479,9 @@ default_buffer_render_caller(Application_Links *app, Frame_Info frame_info, View // NOTE(allen): Line Numbers if (global_config.show_line_number_margins){ - i32 line_count_digit_count = int_to_str_size(buffer.line_count); + i32 line_count = 0; + buffer_get_line_count(app, buffer, &line_count); + i32 line_count_digit_count = int_to_str_size(line_count); Face_ID font_id = 0; get_face_id(app, view.buffer_id, &font_id); // TODO(allen): I need a "digit width" @@ -522,7 +525,7 @@ default_buffer_render_caller(Application_Links *app, Frame_Info frame_info, View Temp_Memory temp = begin_temp_memory(scratch); i32 text_size = on_screen_range.one_past_last - on_screen_range.first; char *text = push_array(scratch, char, text_size); - buffer_read_range(app, &buffer, on_screen_range.first, on_screen_range.one_past_last, text); + buffer_read_range(app, buffer, on_screen_range.first, on_screen_range.one_past_last, text); Highlight_Record *records = push_array(scratch, Highlight_Record, 0); String tail = make_string(text, text_size); @@ -563,7 +566,7 @@ default_buffer_render_caller(Application_Links *app, Frame_Info frame_info, View b32 do_emit = i == record_count || (records[i].color != current_color); if (do_emit){ i32 marker_count = (i32)(push_array(scratch, Marker, 0) - markers); - Managed_Object o = alloc_buffer_markers_on_buffer(app, buffer.buffer_id, marker_count, &render_scope); + Managed_Object o = alloc_buffer_markers_on_buffer(app, buffer, marker_count, &render_scope); managed_object_store_data(app, o, 0, marker_count, markers); Marker_Visual v = create_marker_visual(app, o); marker_visual_set_effect(app, v, VisualType_CharacterHighlightRanges, SymbolicColor_Default, current_color, 0); @@ -582,7 +585,7 @@ default_buffer_render_caller(Application_Links *app, Frame_Info frame_info, View } // NOTE(allen): Cursor and mark - Managed_Object cursor_and_mark = alloc_buffer_markers_on_buffer(app, buffer.buffer_id, 2, &render_scope); + Managed_Object cursor_and_mark = alloc_buffer_markers_on_buffer(app, buffer, 2, &render_scope); Marker cm_markers[2] = {}; cm_markers[0].pos = view.cursor.pos; cm_markers[1].pos = view.mark.pos; @@ -662,11 +665,13 @@ default_buffer_render_caller(Application_Links *app, Frame_Info frame_info, View u32 token_flags = BoundaryToken|BoundaryWhitespace; i32 pos0 = view.cursor.pos; - i32 pos1 = buffer_boundary_seek(app, buffer.buffer_id, pos0, DirLeft , token_flags); + i32 pos1 = buffer_boundary_seek(app, buffer, pos0, DirLeft , token_flags); if (pos1 >= 0){ - i32 pos2 = buffer_boundary_seek(app, buffer.buffer_id, pos1, DirRight, token_flags); - if (pos2 <= buffer.size){ - Managed_Object token_highlight = alloc_buffer_markers_on_buffer(app, buffer.buffer_id, 2, &render_scope); + i32 pos2 = buffer_boundary_seek(app, buffer, pos1, DirRight, token_flags); + i32 buffer_size = 0; + buffer_get_size(app, buffer, &buffer_size); + if (pos2 <= buffer_size){ + Managed_Object token_highlight = alloc_buffer_markers_on_buffer(app, buffer, 2, &render_scope); Marker range_markers[2] = {}; range_markers[0].pos = pos1; range_markers[1].pos = pos2; @@ -684,15 +689,15 @@ default_buffer_render_caller(Application_Links *app, Frame_Info frame_info, View for (u16 i = 0; i < color_count; i += 1){ colors[i] = Stag_Back_Cycle_1 + i; } - mark_enclosures(app, scratch, render_scope, &buffer, view.cursor.pos, FindScope_Brace, VisualType_LineHighlightRanges, colors, 0, color_count); + mark_enclosures(app, scratch, render_scope, buffer, view.cursor.pos, FindScope_Brace, VisualType_LineHighlightRanges, colors, 0, color_count); } if (do_matching_paren_highlight){ i32 pos = view.cursor.pos; - if (buffer_get_char(app, buffer.buffer_id, pos) == '('){ + if (buffer_get_char(app, buffer, pos) == '('){ pos += 1; } else if (pos > 0){ - if (buffer_get_char(app, buffer.buffer_id, pos - 1) == ')'){ + if (buffer_get_char(app, buffer, pos - 1) == ')'){ pos -= 1; } } @@ -700,7 +705,7 @@ default_buffer_render_caller(Application_Links *app, Frame_Info frame_info, View for (u16 i = 0; i < color_count; i += 1){ colors[i] = Stag_Text_Cycle_1 + i; } - mark_enclosures(app, scratch, render_scope, &buffer, pos, FindScope_Paren, VisualType_CharacterBlocks, 0, colors, color_count); + mark_enclosures(app, scratch, render_scope, buffer, pos, FindScope_Paren, VisualType_CharacterBlocks, 0, colors, color_count); } draw_clip_push(app, buffer_rect); @@ -903,29 +908,30 @@ RENDER_CALLER_SIG(default_render_caller){ } HOOK_SIG(default_exit){ + i32 result = 1; + // If this returns zero it cancels the exit. - if (allow_immediate_close_without_checking_for_changes){ - return(1); - } - - b32 has_unsaved_changes = false; - - for (Buffer_Summary buffer = get_buffer_first(app, AccessAll); - buffer.exists; - get_buffer_next(app, &buffer, AccessAll)){ - if (HasFlag(buffer.dirty, DirtyState_UnsavedChanges)){ - has_unsaved_changes = true; - break; + if (!allow_immediate_close_without_checking_for_changes){ + b32 has_unsaved_changes = false; + Buffer_ID buffer = 0; + for (get_buffer_next(app, 0, AccessAll, &buffer); + buffer != 0; + get_buffer_next(app, buffer, AccessAll, &buffer)){ + Dirty_State dirty = 0; + buffer_get_dirty_state(app, buffer, &dirty); + if (HasFlag(dirty, DirtyState_UnsavedChanges)){ + has_unsaved_changes = true; + break; + } + } + if (has_unsaved_changes){ + View_Summary view = get_active_view(app, AccessAll); + do_gui_sure_to_close_4coder(app, &view); + result = 0; } } - if (has_unsaved_changes){ - View_Summary view = get_active_view(app, AccessAll); - do_gui_sure_to_close_4coder(app, &view); - return(0); - } - - return(1); + return(result); } // TODO(allen): how to deal with multiple sizes on a single view @@ -934,7 +940,8 @@ HOOK_SIG(default_view_adjust){ for (View_Summary view = get_view_first(app, AccessAll); view.exists; get_view_next(app, &view, AccessAll)){ - Buffer_Summary buffer = get_buffer(app, view.buffer_id, AccessAll); + Buffer_ID buffer = 0; + view_get_buffer(app, view.view_id, AccessAll, &buffer); i32 view_width = view.render_region.x1 - view.render_region.x0; Face_ID face_id = get_default_font_for_view(app, view.view_id); f32 em = get_string_advance(app, face_id, make_lit_string("m")); @@ -946,8 +953,8 @@ HOOK_SIG(default_view_adjust){ } f32 min_base_width = 20.0f*em; - buffer_set_setting(app, &buffer, BufferSetting_WrapPosition, (i32)(wrap_width)); - buffer_set_setting(app, &buffer, BufferSetting_MinimumBaseWrapPosition, (i32)(min_base_width)); + buffer_set_setting(app, buffer, BufferSetting_WrapPosition, (i32)(wrap_width)); + buffer_set_setting(app, buffer, BufferSetting_MinimumBaseWrapPosition, (i32)(min_base_width)); } return(0); } @@ -1074,12 +1081,6 @@ BUFFER_NAME_RESOLVER_SIG(default_buffer_name_resolution){ } OPEN_FILE_HOOK_SIG(default_file_settings){ - // NOTE(allen|a4.0.8): The get_parameter_buffer was eliminated - // and instead the buffer is passed as an explicit parameter through - // the function call. That is where buffer_id comes from here. - Buffer_Summary buffer = get_buffer(app, buffer_id, AccessAll); - Assert(buffer.exists); - b32 treat_as_code = false; b32 treat_as_todo = false; b32 lex_without_strings = false; @@ -1088,9 +1089,15 @@ OPEN_FILE_HOOK_SIG(default_file_settings){ Parse_Context_ID parse_context_id = 0; - if (buffer.file_name != 0 && buffer.size < (16 << 20)){ - String name = make_string(buffer.file_name, buffer.file_name_len); - String ext = file_extension(name); + Arena *scratch = context_get_arena(app); + Temp_Memory_Arena temp = begin_temp_memory(scratch); + + String file_name = buffer_push_file_name(app, buffer_id, scratch); + i32 buffer_size = 0; + buffer_get_size(app, buffer_id, &buffer_size); + + if (file_name.size > 0 && buffer_size < (32 << 20)){ + String ext = file_extension(file_name); for (i32 i = 0; i < extensions.count; ++i){ if (match(ext, extensions.strings[i])){ treat_as_code = true; @@ -1145,23 +1152,23 @@ OPEN_FILE_HOOK_SIG(default_file_settings){ } if (!treat_as_code){ - treat_as_todo = match_insensitive(front_of_directory(name), "todo.txt"); + treat_as_todo = match_insensitive(front_of_directory(file_name), "todo.txt"); } } i32 map_id = (treat_as_code)?((i32)default_code_map):((i32)mapid_file); i32 map_id_query = 0; - buffer_set_setting(app, &buffer, BufferSetting_MapID, default_lister_ui_map); - buffer_get_setting(app, &buffer, BufferSetting_MapID, &map_id_query); + buffer_set_setting(app, buffer_id, BufferSetting_MapID, default_lister_ui_map); + buffer_get_setting(app, buffer_id, BufferSetting_MapID, &map_id_query); Assert(map_id_query == default_lister_ui_map); - buffer_set_setting(app, &buffer, BufferSetting_WrapPosition, global_config.default_wrap_width); - buffer_set_setting(app, &buffer, BufferSetting_MinimumBaseWrapPosition, global_config.default_min_base_width); - buffer_set_setting(app, &buffer, BufferSetting_MapID, map_id); - buffer_get_setting(app, &buffer, BufferSetting_MapID, &map_id_query); + buffer_set_setting(app, buffer_id, BufferSetting_WrapPosition, global_config.default_wrap_width); + buffer_set_setting(app, buffer_id, BufferSetting_MinimumBaseWrapPosition, global_config.default_min_base_width); + buffer_set_setting(app, buffer_id, BufferSetting_MapID, map_id); + buffer_get_setting(app, buffer_id, BufferSetting_MapID, &map_id_query); Assert(map_id_query == map_id); - buffer_set_setting(app, &buffer, BufferSetting_ParserContext, parse_context_id); + buffer_set_setting(app, buffer_id, BufferSetting_ParserContext, parse_context_id); // NOTE(allen): Decide buffer settings b32 wrap_lines = true; @@ -1178,11 +1185,12 @@ OPEN_FILE_HOOK_SIG(default_file_settings){ use_virtual_whitespace = global_config.enable_virtual_whitespace; use_lexer = true; } - if (match(make_string(buffer.buffer_name, buffer.buffer_name_len), "*compilation*")){ + + String buffer_name = buffer_push_base_buffer_name(app, buffer_id, scratch); + if (match(buffer_name, "*compilation*")){ wrap_lines = false; } - //if (buffer.size >= (192 << 10)){ - if (buffer.size >= (128 << 10)){ + if (buffer_size >= (1 << 20)){ wrap_lines = false; use_virtual_whitespace = false; } @@ -1193,101 +1201,65 @@ OPEN_FILE_HOOK_SIG(default_file_settings){ // Unfortunantely without tokens virtual whitespace doesn't really make sense. // So for now I have it automatically turning on lexing when virtual whitespace is turned on. // Cleaning some of that up is a goal for future versions. - buffer_set_setting(app, &buffer, BufferSetting_LexWithoutStrings, lex_without_strings); - buffer_set_setting(app, &buffer, BufferSetting_WrapLine, wrap_lines); - buffer_set_setting(app, &buffer, BufferSetting_VirtualWhitespace, use_virtual_whitespace); - buffer_set_setting(app, &buffer, BufferSetting_Lex, use_lexer); + buffer_set_setting(app, buffer_id, BufferSetting_LexWithoutStrings, lex_without_strings); + buffer_set_setting(app, buffer_id, BufferSetting_WrapLine, wrap_lines); + buffer_set_setting(app, buffer_id, BufferSetting_VirtualWhitespace, use_virtual_whitespace); + buffer_set_setting(app, buffer_id, BufferSetting_Lex, use_lexer); + + end_temp_memory(temp); // no meaning for return return(0); } OPEN_FILE_HOOK_SIG(default_new_file){ -#if 0 - Buffer_Summary buffer = get_buffer(app, buffer_id, AccessOpen); - char str[] = "/*\nNew File\n*/\n\n\n"; - buffer_replace_range(app, &buffer, 0, 0, str, sizeof(str)-1); -#endif - // no meaning for return + // buffer_id return(0); } OPEN_FILE_HOOK_SIG(default_file_save){ - Buffer_Summary buffer = get_buffer(app, buffer_id, AccessAll); - Assert(buffer.exists); - i32 is_virtual = 0; if (global_config.automatically_indent_text_on_save && - buffer_get_setting(app, &buffer, BufferSetting_VirtualWhitespace, &is_virtual)){ + buffer_get_setting(app, buffer_id, BufferSetting_VirtualWhitespace, &is_virtual)){ if (is_virtual){ - buffer_auto_indent(app, &global_part, &buffer, 0, buffer.size, DEF_TAB_WIDTH, DEFAULT_INDENT_FLAGS | AutoIndent_FullTokens); + i32 buffer_size = 0; + buffer_get_size(app, buffer_id, &buffer_size); + buffer_auto_indent(app, &global_part, buffer_id, 0, buffer_size, DEF_TAB_WIDTH, DEFAULT_INDENT_FLAGS | AutoIndent_FullTokens); } } - // no meaning for return return(0); } FILE_EDIT_RANGE_SIG(default_file_edit_range){ -#if 0 - Buffer_Summary buffer_summary = {}; - if (get_buffer_summary(app, buffer_id, AccessAll, &buffer_summary)){ - if (!match(make_string(buffer_summary.buffer_name, buffer_summary.buffer_name_len), make_lit_string("*messages*"))){ - char space[1024]; - String str = make_fixed_width_string(space); - append(&str, "'"); - append(&str, make_string(buffer_summary.buffer_name, buffer_summary.buffer_name_len)); - append(&str, "' ["); - append_int_to_str(&str, range.first); - append(&str, ", "); - append_int_to_str(&str, range.one_past_last); - append(&str, ") '"); - append(&str, substr(text, 0, 32)); - append(&str, "'\n"); - print_message(app, str.str, str.size); - } - } -#endif - // no meaning for return + // buffer_id, range, text return(0); } FILE_EDIT_FINISHED_SIG(default_file_edit_finished){ - for (i32 i = 0; i < buffer_id_count; i += 1){ #if 0 - // NOTE(allen|4.0.31): This code is example usage, it's not a particularly nice feature to actually have. - - Buffer_Summary buffer = get_buffer(app, buffer_ids[i], AccessAll); - Assert(buffer.exists); - - String buffer_name = make_string(buffer.buffer_name, buffer.buffer_name_len); - char space[256]; - String str = make_fixed_width_string(space); - append(&str, "edit finished: "); - append(&str, buffer_name); - append(&str, "\n"); - print_message(app, str.str, str.size); -#endif + for (i32 i = 0; i < buffer_id_count; i += 1){ + // buffer_ids[i] } +#endif // no meaning for return return(0); } OPEN_FILE_HOOK_SIG(default_end_file){ - Buffer_Summary buffer = get_buffer(app, buffer_id, AccessAll); - Assert(buffer.exists); - + Arena *scratch = context_get_arena(app); + Temp_Memory_Arena temp = begin_temp_memory(scratch); char space[1024]; + String buffer_name = buffer_push_unique_buffer_name(app, buffer_id, scratch); String str = make_fixed_width_string(space); append(&str, "Ending file: "); - append(&str, make_string(buffer.buffer_name, buffer.buffer_name_len)); + append(&str, buffer_name); append(&str, "\n"); - print_message(app, str.str, str.size); - + end_temp_memory(temp); // no meaning for return return(0); } diff --git a/4coder_function_list.cpp b/4coder_function_list.cpp index a06f6bcf..194cfda6 100644 --- a/4coder_function_list.cpp +++ b/4coder_function_list.cpp @@ -21,10 +21,12 @@ make_buffered_write_stream(Buffer_ID output_buffer_id, Partition *buffering_aren static void buffered_write_stream_flush(Application_Links *app, Buffered_Write_Stream *stream){ - Buffer_Summary buffer = get_buffer(app, stream->output_buffer_id, AccessProtected); - i32 buffer_size = (i32)(push_array(stream->buffering_arena, char, 0) - stream->buffer); - buffer_replace_range(app, &buffer, buffer.size, buffer.size, stream->buffer, buffer_size); - stream->buffering_arena->pos -= buffer_size; + Buffer_ID buffer = stream->output_buffer_id; + i32 buffer_size = 0; + buffer_get_size(app, buffer, &buffer_size); + i32 stream_size = (i32)(push_array(stream->buffering_arena, char, 0) - stream->buffer); + buffer_replace_range(app, buffer, buffer_size, buffer_size, make_string(stream->buffer, stream_size)); + stream->buffering_arena->pos -= stream_size; } static void @@ -56,10 +58,10 @@ buffered_write_stream_write_int(Application_Links *app, Buffered_Write_Stream *s } static Get_Positions_Results -get_function_positions(Application_Links *app, Buffer_Summary *buffer, i32 first_token_index, Function_Positions *positions_array, i32 positions_max){ +get_function_positions(Application_Links *app, Buffer_ID buffer, i32 first_token_index, Function_Positions *positions_array, i32 positions_max){ Get_Positions_Results result = {}; - Token_Range token_range = buffer_get_token_range(app, buffer->buffer_id); + Token_Range token_range = buffer_get_token_range(app, buffer); if (token_range.first != 0){ Token_Iterator token_it = make_token_iterator(token_range, first_token_index); @@ -186,9 +188,11 @@ get_function_positions(Application_Links *app, Buffer_Summary *buffer, i32 first } static void -print_positions_buffered(Application_Links *app, Buffer_Summary *buffer, Function_Positions *positions_array, i32 positions_count, Buffered_Write_Stream *stream){ +print_positions_buffered(Application_Links *app, Buffer_ID buffer, Function_Positions *positions_array, i32 positions_count, Buffered_Write_Stream *stream){ + Arena *scratch = context_get_arena(app); + Temp_Memory_Arena temp = begin_temp_memory(scratch); - String buffer_name = make_string(buffer->buffer_name, buffer->buffer_name_len); + String buffer_name = buffer_push_unique_buffer_name(app, buffer, scratch); for (i32 i = 0; i < positions_count; ++i){ Function_Positions *positions = &positions_array[i]; @@ -200,7 +204,7 @@ print_positions_buffered(Application_Links *app, Buffer_Summary *buffer, Functio Assert(end_index > start_index); - Token_Range token_range = buffer_get_token_range(app, buffer->buffer_id); + Token_Range token_range = buffer_get_token_range(app, buffer); if (token_range.first != 0){ buffered_write_stream_write(app, stream, buffer_name); buffered_write_stream_write(app, stream, make_lit_string(":")); @@ -241,21 +245,26 @@ print_positions_buffered(Application_Links *app, Buffer_Summary *buffer, Functio buffered_write_stream_write(app, stream, make_lit_string("\n")); } } + + end_temp_memory(temp); } static void -list_all_functions(Application_Links *app, Partition *part, Buffer_Summary *optional_target_buffer){ +list_all_functions(Application_Links *app, Partition *part, Buffer_ID optional_target_buffer){ String decls_name = make_lit_string("*decls*"); - Buffer_Summary decls_buffer = get_buffer_by_name(app, decls_name.str, decls_name.size, AccessAll); - if (!decls_buffer.exists){ - decls_buffer = create_buffer(app, decls_name.str, decls_name.size, BufferCreate_AlwaysNew); - buffer_set_setting(app, &decls_buffer, BufferSetting_Unimportant, true); - buffer_set_setting(app, &decls_buffer, BufferSetting_ReadOnly, true); - buffer_set_setting(app, &decls_buffer, BufferSetting_WrapLine, false); + Buffer_ID decls_buffer = 0; + get_buffer_by_name(app, decls_name, AccessAll, &decls_buffer); + if (!buffer_exists(app, decls_buffer)){ + create_buffer(app, decls_name, BufferCreate_AlwaysNew, &decls_buffer); + buffer_set_setting(app, decls_buffer, BufferSetting_Unimportant, true); + buffer_set_setting(app, decls_buffer, BufferSetting_ReadOnly, true); + buffer_set_setting(app, decls_buffer, BufferSetting_WrapLine, false); } else{ - buffer_send_end_signal(app, &decls_buffer); - buffer_replace_range(app, &decls_buffer, 0, decls_buffer.size, 0, 0); + buffer_send_end_signal(app, decls_buffer); + i32 size = 0; + buffer_get_size(app, decls_buffer, &size); + buffer_replace_range(app, decls_buffer, 0, size, make_lit_string("")); } Temp_Memory temp = begin_temp_memory(part); @@ -263,42 +272,44 @@ list_all_functions(Application_Links *app, Partition *part, Buffer_Summary *opti i32 positions_max = (4<<10)/sizeof(Function_Positions); Function_Positions *positions_array = push_array(part, Function_Positions, positions_max); - Buffered_Write_Stream buffered_write_stream = make_buffered_write_stream(decls_buffer.buffer_id, part); + Buffered_Write_Stream buffered_write_stream = make_buffered_write_stream(decls_buffer, part); - for (Buffer_Summary buffer_it = get_buffer_first(app, AccessAll); - buffer_it.exists; - get_buffer_next(app, &buffer_it, AccessAll)){ - Buffer_Summary buffer = buffer_it; + Buffer_ID buffer_it = 0; + for (get_buffer_next(app, 0, AccessAll, &buffer_it); + buffer_it != 0; + get_buffer_next(app, buffer_it, AccessAll, &buffer_it)){ + Buffer_ID buffer = buffer_it; if (optional_target_buffer != 0){ - buffer = *optional_target_buffer; + buffer = optional_target_buffer; } - if (!buffer.tokens_are_ready){ + if (buffer_tokens_are_ready(app, buffer)){ + i32 token_index = 0; + b32 still_looping = false; + do{ + Get_Positions_Results get_positions_results = get_function_positions(app, buffer, token_index, positions_array, positions_max); + + i32 positions_count = get_positions_results.positions_count; + token_index = get_positions_results.next_token_index; + still_looping = get_positions_results.still_looping; + + print_positions_buffered(app, buffer, positions_array, positions_count, &buffered_write_stream); + //print_positions(app, &buffer, positions_array, positions_count, &decls_buffer, part); + }while(still_looping); + + if (optional_target_buffer != 0){ + break; + } + } + else{ continue; } - - i32 token_index = 0; - b32 still_looping = false; - do{ - Get_Positions_Results get_positions_results = get_function_positions(app, &buffer, token_index, positions_array, positions_max); - - i32 positions_count = get_positions_results.positions_count; - token_index = get_positions_results.next_token_index; - still_looping = get_positions_results.still_looping; - - print_positions_buffered(app, &buffer, positions_array, positions_count, &buffered_write_stream); - //print_positions(app, &buffer, positions_array, positions_count, &decls_buffer, part); - }while(still_looping); - - if (optional_target_buffer != 0){ - break; - } } buffered_write_stream_flush(app, &buffered_write_stream); View_Summary view = get_active_view(app, AccessAll); - view_set_buffer(app, &view, decls_buffer.buffer_id, 0); + view_set_buffer(app, &view, decls_buffer, 0); lock_jump_buffer(decls_name.str, decls_name.size); @@ -310,9 +321,10 @@ CUSTOM_COMMAND_SIG(list_all_functions_current_buffer) CUSTOM_DOC("Creates a jump list of lines of the current buffer that appear to define or declare functions.") { View_Summary view = get_active_view(app, AccessProtected); - Buffer_Summary buffer = get_buffer(app, view.buffer_id, AccessProtected); - if (buffer.exists){ - list_all_functions(app, &global_part, &buffer); + Buffer_ID buffer = 0; + view_get_buffer(app, view.view_id, AccessProtected, &buffer); + if (buffer_exists(app, buffer)){ + list_all_functions(app, &global_part, buffer); } } @@ -320,12 +332,12 @@ CUSTOM_COMMAND_SIG(list_all_functions_current_buffer_lister) CUSTOM_DOC("Creates a lister of locations that look like function definitions and declarations in the buffer.") { View_Summary view = get_active_view(app, AccessProtected); - Buffer_Summary buffer = get_buffer(app, view.buffer_id, AccessProtected); - if (buffer.exists){ - list_all_functions(app, &global_part, &buffer); + Buffer_ID buffer = 0; + view_get_buffer(app, view.view_id, AccessProtected, &buffer); + if (buffer_exists(app, buffer)){ + list_all_functions(app, &global_part, buffer); view = get_active_view(app, AccessAll); - open_jump_lister(app, &global_part, &global_heap, - &view, view.buffer_id, JumpListerActivation_OpenInUIView, 0); + open_jump_lister(app, &global_part, &global_heap, &view, buffer, JumpListerActivation_OpenInUIView, 0); } } diff --git a/4coder_generated/command_metadata.h b/4coder_generated/command_metadata.h index 3faf7f2a..b9c50ee4 100644 --- a/4coder_generated/command_metadata.h +++ b/4coder_generated/command_metadata.h @@ -255,240 +255,240 @@ int32_t source_name_len; int32_t line_number; }; static Command_Metadata fcoder_metacmd_table[234] = { -{ PROC_LINKS(allow_mouse, 0), "allow_mouse", 11, "Shows the mouse and causes all mouse input to be processed normally.", 68, "c:\\4ed\\code\\4coder_default_framework.cpp", 40, 331 }, -{ PROC_LINKS(auto_tab_line_at_cursor, 0), "auto_tab_line_at_cursor", 23, "Auto-indents the line on which the cursor sits.", 47, "c:\\4ed\\code\\4coder_auto_indent.cpp", 34, 629 }, -{ PROC_LINKS(auto_tab_range, 0), "auto_tab_range", 14, "Auto-indents the range between the cursor and the mark.", 55, "c:\\4ed\\code\\4coder_auto_indent.cpp", 34, 640 }, -{ PROC_LINKS(auto_tab_whole_file, 0), "auto_tab_whole_file", 19, "Audo-indents the entire current buffer.", 39, "c:\\4ed\\code\\4coder_auto_indent.cpp", 34, 619 }, -{ PROC_LINKS(backspace_char, 0), "backspace_char", 14, "Deletes the character to the left of the cursor.", 48, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 101 }, -{ PROC_LINKS(backspace_word, 0), "backspace_word", 14, "Delete characters between the cursor position and the first alphanumeric boundary to the left.", 94, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1215 }, -{ PROC_LINKS(basic_change_active_panel, 0), "basic_change_active_panel", 25, "Change the currently active panel, moving to the panel with the next highest view_id. Will not skipe the build panel if it is open.", 132, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 510 }, -{ PROC_LINKS(build_in_build_panel, 0), "build_in_build_panel", 20, "Looks for a build.bat, build.sh, or makefile in the current and parent directories. Runs the first that it finds and prints the output to *compilation*. Puts the *compilation* buffer in a panel at the footer of the current view.", 230, "c:\\4ed\\code\\4coder_build_commands.cpp", 37, 187 }, -{ PROC_LINKS(build_search, 0), "build_search", 12, "Looks for a build.bat, build.sh, or makefile in the current and parent directories. Runs the first that it finds and prints the output to *compilation*.", 153, "c:\\4ed\\code\\4coder_build_commands.cpp", 37, 155 }, -{ PROC_LINKS(center_view, 0), "center_view", 11, "Centers the view vertically on the line on which the cursor sits.", 65, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 151 }, -{ PROC_LINKS(change_active_panel, 0), "change_active_panel", 19, "Change the currently active panel, moving to the panel with the next highest view_id.", 85, "c:\\4ed\\code\\4coder_default_framework.cpp", 40, 234 }, -{ PROC_LINKS(change_active_panel_backwards, 0), "change_active_panel_backwards", 29, "Change the currently active panel, moving to the panel with the next lowest view_id.", 84, "c:\\4ed\\code\\4coder_default_framework.cpp", 40, 244 }, -{ PROC_LINKS(change_to_build_panel, 0), "change_to_build_panel", 21, "If the special build panel is open, makes the build panel the active panel.", 75, "c:\\4ed\\code\\4coder_build_commands.cpp", 37, 209 }, -{ PROC_LINKS(clean_all_lines, 0), "clean_all_lines", 15, "Removes trailing whitespace from all lines in the current buffer.", 65, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 441 }, -{ PROC_LINKS(click_set_cursor, 0), "click_set_cursor", 16, "Sets the cursor position to the mouse position.", 47, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 210 }, -{ PROC_LINKS(click_set_cursor_and_mark, 0), "click_set_cursor_and_mark", 25, "Sets the cursor position and mark to the mouse position.", 56, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 196 }, -{ PROC_LINKS(click_set_cursor_if_lbutton, 0), "click_set_cursor_if_lbutton", 27, "If the mouse left button is pressed, sets the cursor position to the mouse position.", 84, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 224 }, -{ PROC_LINKS(click_set_mark, 0), "click_set_mark", 14, "Sets the mark position to the mouse position.", 45, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 240 }, -{ PROC_LINKS(close_all_code, 0), "close_all_code", 14, "Closes any buffer with a filename ending with an extension configured to be recognized as a code file type.", 107, "c:\\4ed\\code\\4coder_project_commands.cpp", 39, 1060 }, -{ PROC_LINKS(close_build_panel, 0), "close_build_panel", 17, "If the special build panel is open, closes it.", 46, "c:\\4ed\\code\\4coder_build_commands.cpp", 37, 203 }, -{ PROC_LINKS(close_panel, 0), "close_panel", 11, "Closes the currently active panel if it is not the only panel open.", 67, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 518 }, -{ PROC_LINKS(command_lister, 0), "command_lister", 14, "Opens an interactive list of all registered commands.", 53, "c:\\4ed\\code\\4coder_lists.cpp", 28, 1000 }, -{ PROC_LINKS(comment_line, 0), "comment_line", 12, "Insert '//' at the beginning of the line after leading whitespace.", 66, "c:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 135 }, -{ PROC_LINKS(comment_line_toggle, 0), "comment_line_toggle", 19, "Turns uncommented lines into commented lines and vice versa for comments starting with '//'.", 92, "c:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 159 }, -{ PROC_LINKS(copy, 0), "copy", 4, "Copy the text in the range from the cursor to the mark onto the clipboard.", 74, "c:\\4ed\\code\\4coder_clipboard.cpp", 32, 26 }, -{ PROC_LINKS(cursor_mark_swap, 0), "cursor_mark_swap", 16, "Swaps the position of the cursor and the mark.", 46, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 129 }, -{ PROC_LINKS(cut, 0), "cut", 3, "Cut the text in the range from the cursor to the mark onto the clipboard.", 73, "c:\\4ed\\code\\4coder_clipboard.cpp", 32, 35 }, -{ PROC_LINKS(decrease_face_size, 0), "decrease_face_size", 18, "Decrease the size of the face used by the current buffer.", 57, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 613 }, -{ PROC_LINKS(decrease_line_wrap, 0), "decrease_line_wrap", 18, "Decrases the current buffer's width for line wrapping.", 54, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 590 }, -{ PROC_LINKS(delete_char, 0), "delete_char", 11, "Deletes the character to the right of the cursor.", 49, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 83 }, -{ PROC_LINKS(delete_current_scope, 0), "delete_current_scope", 20, "Deletes the braces surrounding the currently selected scope. Leaves the contents within the scope.", 99, "c:\\4ed\\code\\4coder_scope_commands.cpp", 37, 515 }, -{ PROC_LINKS(delete_file_query, 0), "delete_file_query", 17, "Deletes the file of the current buffer if 4coder has the appropriate access rights. Will ask the user for confirmation first.", 125, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1191 }, -{ PROC_LINKS(delete_line, 0), "delete_line", 11, "Delete the line the on which the cursor sits.", 45, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1444 }, -{ PROC_LINKS(delete_range, 0), "delete_range", 12, "Deletes the text in the range between the cursor and the mark.", 62, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 139 }, -{ PROC_LINKS(delete_word, 0), "delete_word", 11, "Delete characters between the cursor position and the first alphanumeric boundary to the right.", 95, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1221 }, -{ PROC_LINKS(duplicate_line, 0), "duplicate_line", 14, "Create a copy of the line on which the cursor sits.", 51, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1421 }, -{ PROC_LINKS(eol_dosify, 0), "eol_dosify", 10, "Puts the buffer in DOS line ending mode.", 40, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 666 }, -{ PROC_LINKS(eol_nixify, 0), "eol_nixify", 10, "Puts the buffer in NIX line ending mode.", 40, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 674 }, -{ PROC_LINKS(execute_any_cli, 0), "execute_any_cli", 15, "Queries for an output buffer name and system command, runs the system command as a CLI and prints the output to the specified buffer.", 133, "c:\\4ed\\code\\4coder_system_command.cpp", 37, 23 }, -{ PROC_LINKS(execute_previous_cli, 0), "execute_previous_cli", 20, "If the command execute_any_cli has already been used, this will execute a CLI reusing the most recent buffer name and command.", 126, "c:\\4ed\\code\\4coder_system_command.cpp", 37, 7 }, -{ PROC_LINKS(exit_4coder, 0), "exit_4coder", 11, "Attempts to close 4coder.", 25, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 682 }, -{ PROC_LINKS(goto_beginning_of_file, 0), "goto_beginning_of_file", 22, "Sets the cursor to the beginning of the file.", 45, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1131 }, -{ PROC_LINKS(goto_end_of_file, 0), "goto_end_of_file", 16, "Sets the cursor to the end of the file.", 39, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1139 }, -{ PROC_LINKS(goto_first_jump_direct, 0), "goto_first_jump_direct", 22, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer.", 95, "c:\\4ed\\code\\4coder_jump_direct.cpp", 34, 82 }, -{ PROC_LINKS(goto_first_jump_same_panel_sticky, 0), "goto_first_jump_same_panel_sticky", 33, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer and views the buffer in the panel where the jump list was.", 153, "c:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 545 }, -{ PROC_LINKS(goto_first_jump_sticky, 0), "goto_first_jump_sticky", 22, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer.", 95, "c:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 527 }, -{ PROC_LINKS(goto_jump_at_cursor_direct, 0), "goto_jump_at_cursor_direct", 26, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in another view and changes the active panel to the view containing the jump.", 187, "c:\\4ed\\code\\4coder_jump_direct.cpp", 34, 8 }, -{ PROC_LINKS(goto_jump_at_cursor_same_panel_direct, 0), "goto_jump_at_cursor_same_panel_direct", 37, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in this view, losing the compilation output or jump list..", 168, "c:\\4ed\\code\\4coder_jump_direct.cpp", 34, 28 }, -{ PROC_LINKS(goto_jump_at_cursor_same_panel_sticky, 0), "goto_jump_at_cursor_same_panel_sticky", 37, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in this view, losing the compilation output or jump list.", 167, "c:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 371 }, -{ PROC_LINKS(goto_jump_at_cursor_sticky, 0), "goto_jump_at_cursor_sticky", 26, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in another view and changes the active panel to the view containing the jump.", 187, "c:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 343 }, -{ PROC_LINKS(goto_line, 0), "goto_line", 9, "Queries the user for a number, and jumps the cursor to the corresponding line.", 78, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 690 }, -{ PROC_LINKS(goto_next_jump_direct, 0), "goto_next_jump_direct", 21, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, skipping sub jump locations.", 123, "c:\\4ed\\code\\4coder_jump_direct.cpp", 34, 46 }, -{ PROC_LINKS(goto_next_jump_no_skips_direct, 0), "goto_next_jump_no_skips_direct", 30, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, and does not skip sub jump locations.", 132, "c:\\4ed\\code\\4coder_jump_direct.cpp", 34, 64 }, -{ PROC_LINKS(goto_next_jump_no_skips_sticky, 0), "goto_next_jump_no_skips_sticky", 30, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, and does not skip sub jump locations.", 132, "c:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 496 }, -{ PROC_LINKS(goto_next_jump_sticky, 0), "goto_next_jump_sticky", 21, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, skipping sub jump locations.", 123, "c:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 466 }, -{ PROC_LINKS(goto_prev_jump_direct, 0), "goto_prev_jump_direct", 21, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, skipping sub jump locations.", 127, "c:\\4ed\\code\\4coder_jump_direct.cpp", 34, 55 }, -{ PROC_LINKS(goto_prev_jump_no_skips_direct, 0), "goto_prev_jump_no_skips_direct", 30, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, and does not skip sub jump locations.", 136, "c:\\4ed\\code\\4coder_jump_direct.cpp", 34, 73 }, -{ PROC_LINKS(goto_prev_jump_no_skips_sticky, 0), "goto_prev_jump_no_skips_sticky", 30, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, and does not skip sub jump locations.", 136, "c:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 512 }, -{ PROC_LINKS(goto_prev_jump_sticky, 0), "goto_prev_jump_sticky", 21, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, skipping sub jump locations.", 127, "c:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 482 }, -{ PROC_LINKS(hide_filebar, 0), "hide_filebar", 12, "Sets the current view to hide it's filebar.", 43, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 548 }, -{ PROC_LINKS(hide_scrollbar, 0), "hide_scrollbar", 14, "Sets the current view to hide it's scrollbar.", 45, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 534 }, -{ PROC_LINKS(if0_off, 0), "if0_off", 7, "Surround the range between the cursor and mark with an '#if 0' and an '#endif'", 78, "c:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 79 }, -{ PROC_LINKS(increase_face_size, 0), "increase_face_size", 18, "Increase the size of the face used by the current buffer.", 57, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 601 }, -{ PROC_LINKS(increase_line_wrap, 0), "increase_line_wrap", 18, "Increases the current buffer's width for line wrapping.", 55, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 579 }, -{ PROC_LINKS(interactive_kill_buffer, 0), "interactive_kill_buffer", 23, "Interactively kill an open buffer.", 34, "c:\\4ed\\code\\4coder_lists.cpp", 28, 774 }, -{ PROC_LINKS(interactive_new, 0), "interactive_new", 15, "Interactively creates a new file.", 33, "c:\\4ed\\code\\4coder_lists.cpp", 28, 886 }, -{ PROC_LINKS(interactive_open, 0), "interactive_open", 16, "Interactively opens a file.", 27, "c:\\4ed\\code\\4coder_lists.cpp", 28, 918 }, -{ PROC_LINKS(interactive_open_or_new, 0), "interactive_open_or_new", 23, "Interactively open a file out of the file system.", 49, "c:\\4ed\\code\\4coder_lists.cpp", 28, 848 }, -{ PROC_LINKS(interactive_switch_buffer, 0), "interactive_switch_buffer", 25, "Interactively switch to an open buffer.", 39, "c:\\4ed\\code\\4coder_lists.cpp", 28, 755 }, -{ PROC_LINKS(kill_buffer, 0), "kill_buffer", 11, "Kills the current buffer.", 25, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1625 }, -{ PROC_LINKS(kill_rect, 0), "kill_rect", 9, "Delete characters in a rectangular region. Range testing is done by unwrapped-xy coordinates.", 93, "c:\\4ed\\code\\4coder_experiments.cpp", 34, 26 }, -{ PROC_LINKS(left_adjust_view, 0), "left_adjust_view", 16, "Sets the left size of the view near the x position of the cursor.", 65, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 167 }, -{ PROC_LINKS(list_all_functions_all_buffers, 0), "list_all_functions_all_buffers", 30, "Creates a jump list of lines from all buffers that appear to define or declare functions.", 89, "c:\\4ed\\code\\4coder_function_list.cpp", 36, 332 }, -{ PROC_LINKS(list_all_functions_all_buffers_lister, 0), "list_all_functions_all_buffers_lister", 37, "Creates a lister of locations that look like function definitions and declarations all buffers.", 95, "c:\\4ed\\code\\4coder_function_list.cpp", 36, 338 }, -{ PROC_LINKS(list_all_functions_current_buffer, 0), "list_all_functions_current_buffer", 33, "Creates a jump list of lines of the current buffer that appear to define or declare functions.", 94, "c:\\4ed\\code\\4coder_function_list.cpp", 36, 309 }, -{ PROC_LINKS(list_all_functions_current_buffer_lister, 0), "list_all_functions_current_buffer_lister", 40, "Creates a lister of locations that look like function definitions and declarations in the buffer.", 97, "c:\\4ed\\code\\4coder_function_list.cpp", 36, 319 }, -{ PROC_LINKS(list_all_locations, 0), "list_all_locations", 18, "Queries the user for a string and lists all exact case-sensitive matches found in all open buffers.", 99, "c:\\4ed\\code\\4coder_search.cpp", 29, 810 }, -{ PROC_LINKS(list_all_locations_case_insensitive, 0), "list_all_locations_case_insensitive", 35, "Queries the user for a string and lists all exact case-insensitive matches found in all open buffers.", 101, "c:\\4ed\\code\\4coder_search.cpp", 29, 824 }, -{ PROC_LINKS(list_all_locations_of_identifier, 0), "list_all_locations_of_identifier", 32, "Reads a token or word under the cursor and lists all exact case-sensitive mathces in all open buffers.", 102, "c:\\4ed\\code\\4coder_search.cpp", 29, 838 }, -{ PROC_LINKS(list_all_locations_of_identifier_case_insensitive, 0), "list_all_locations_of_identifier_case_insensitive", 49, "Reads a token or word under the cursor and lists all exact case-insensitive mathces in all open buffers.", 104, "c:\\4ed\\code\\4coder_search.cpp", 29, 845 }, -{ PROC_LINKS(list_all_locations_of_selection, 0), "list_all_locations_of_selection", 31, "Reads the string in the selected range and lists all exact case-sensitive mathces in all open buffers.", 102, "c:\\4ed\\code\\4coder_search.cpp", 29, 852 }, -{ PROC_LINKS(list_all_locations_of_selection_case_insensitive, 0), "list_all_locations_of_selection_case_insensitive", 48, "Reads the string in the selected range and lists all exact case-insensitive mathces in all open buffers.", 104, "c:\\4ed\\code\\4coder_search.cpp", 29, 859 }, -{ PROC_LINKS(list_all_locations_of_type_definition, 0), "list_all_locations_of_type_definition", 37, "Queries user for string, lists all locations of strings that appear to define a type whose name matches the input string.", 121, "c:\\4ed\\code\\4coder_search.cpp", 29, 866 }, -{ PROC_LINKS(list_all_locations_of_type_definition_of_identifier, 0), "list_all_locations_of_type_definition_of_identifier", 51, "Reads a token or word under the cursor and lists all locations of strings that appear to define a type whose name matches it.", 125, "c:\\4ed\\code\\4coder_search.cpp", 29, 877 }, -{ PROC_LINKS(list_all_substring_locations, 0), "list_all_substring_locations", 28, "Queries the user for a string and lists all case-sensitive substring matches found in all open buffers.", 103, "c:\\4ed\\code\\4coder_search.cpp", 29, 817 }, -{ PROC_LINKS(list_all_substring_locations_case_insensitive, 0), "list_all_substring_locations_case_insensitive", 45, "Queries the user for a string and lists all case-insensitive substring matches found in all open buffers.", 105, "c:\\4ed\\code\\4coder_search.cpp", 29, 831 }, -{ PROC_LINKS(lister__activate, 0), "lister__activate", 16, "A lister mode command that activates the list's action on the highlighted item.", 79, "c:\\4ed\\code\\4coder_lists.cpp", 28, 15 }, -{ PROC_LINKS(lister__backspace_text_field, 0), "lister__backspace_text_field", 28, "A lister mode command that dispatches to the lister's backspace text field handler.", 83, "c:\\4ed\\code\\4coder_lists.cpp", 28, 41 }, -{ PROC_LINKS(lister__backspace_text_field__default, 0), "lister__backspace_text_field__default", 37, "A lister mode command that backspaces one character from the text field.", 72, "c:\\4ed\\code\\4coder_lists.cpp", 28, 145 }, -{ PROC_LINKS(lister__backspace_text_field__file_path, 0), "lister__backspace_text_field__file_path", 39, "A lister mode command that backspaces one character from the text field of a file system list.", 94, "c:\\4ed\\code\\4coder_lists.cpp", 28, 217 }, -{ PROC_LINKS(lister__mouse_press, 0), "lister__mouse_press", 19, "A lister mode command that beings a click interaction with a list item under the mouse.", 87, "c:\\4ed\\code\\4coder_lists.cpp", 28, 86 }, -{ PROC_LINKS(lister__mouse_release, 0), "lister__mouse_release", 21, "A lister mode command that ends a click interaction with a list item under the mouse, possibly activating it.", 109, "c:\\4ed\\code\\4coder_lists.cpp", 28, 98 }, -{ PROC_LINKS(lister__move_down, 0), "lister__move_down", 17, "A lister mode command that dispatches to the lister's navigate down handler.", 76, "c:\\4ed\\code\\4coder_lists.cpp", 28, 61 }, -{ PROC_LINKS(lister__move_down__default, 0), "lister__move_down__default", 26, "A lister mode command that moves the highlighted item one down in the list.", 75, "c:\\4ed\\code\\4coder_lists.cpp", 28, 176 }, -{ PROC_LINKS(lister__move_up, 0), "lister__move_up", 15, "A lister mode command that dispatches to the lister's navigate up handler.", 74, "c:\\4ed\\code\\4coder_lists.cpp", 28, 51 }, -{ PROC_LINKS(lister__move_up__default, 0), "lister__move_up__default", 24, "A lister mode command that moves the highlighted item one up in the list.", 73, "c:\\4ed\\code\\4coder_lists.cpp", 28, 160 }, -{ PROC_LINKS(lister__quit, 0), "lister__quit", 12, "A lister mode command that quits the list without executing any actions.", 72, "c:\\4ed\\code\\4coder_lists.cpp", 28, 8 }, -{ PROC_LINKS(lister__repaint, 0), "lister__repaint", 15, "A lister mode command that updates the lists UI data.", 53, "c:\\4ed\\code\\4coder_lists.cpp", 28, 114 }, -{ PROC_LINKS(lister__wheel_scroll, 0), "lister__wheel_scroll", 20, "A lister mode command that scrolls the list in response to the mouse wheel.", 75, "c:\\4ed\\code\\4coder_lists.cpp", 28, 71 }, -{ PROC_LINKS(lister__write_character, 0), "lister__write_character", 23, "A lister mode command that dispatches to the lister's write character handler.", 78, "c:\\4ed\\code\\4coder_lists.cpp", 28, 31 }, -{ PROC_LINKS(lister__write_character__default, 0), "lister__write_character__default", 32, "A lister mode command that inserts a new character to the text field.", 69, "c:\\4ed\\code\\4coder_lists.cpp", 28, 125 }, -{ PROC_LINKS(lister__write_character__file_path, 0), "lister__write_character__file_path", 34, "A lister mode command that inserts a character into the text field of a file system list.", 89, "c:\\4ed\\code\\4coder_lists.cpp", 28, 192 }, -{ PROC_LINKS(lister__write_character__fixed_list, 0), "lister__write_character__fixed_list", 35, "A lister mode command that handles input for the fixed sure to kill list.", 73, "c:\\4ed\\code\\4coder_lists.cpp", 28, 256 }, -{ PROC_LINKS(load_project, 0), "load_project", 12, "Looks for a project.4coder file in the current directory and tries to load it. Looks in parent directories until a project file is found or there are no more parents.", 167, "c:\\4ed\\code\\4coder_project_commands.cpp", 39, 1083 }, -{ PROC_LINKS(make_directory_query, 0), "make_directory_query", 20, "Queries the user for a name and creates a new directory with the given name.", 76, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1301 }, -{ PROC_LINKS(miblo_decrement_basic, 0), "miblo_decrement_basic", 21, "Decrement an integer under the cursor by one.", 45, "c:\\4ed\\code\\4coder_miblo_numbers.cpp", 36, 110 }, -{ PROC_LINKS(miblo_decrement_time_stamp, 0), "miblo_decrement_time_stamp", 26, "Decrement a time stamp under the cursor by one second. (format [m]m:ss or h:mm:ss", 81, "c:\\4ed\\code\\4coder_miblo_numbers.cpp", 36, 383 }, -{ PROC_LINKS(miblo_decrement_time_stamp_minute, 0), "miblo_decrement_time_stamp_minute", 33, "Decrement a time stamp under the cursor by one minute. (format [m]m:ss or h:mm:ss", 81, "c:\\4ed\\code\\4coder_miblo_numbers.cpp", 36, 395 }, -{ PROC_LINKS(miblo_increment_basic, 0), "miblo_increment_basic", 21, "Increment an integer under the cursor by one.", 45, "c:\\4ed\\code\\4coder_miblo_numbers.cpp", 36, 94 }, -{ PROC_LINKS(miblo_increment_time_stamp, 0), "miblo_increment_time_stamp", 26, "Increment a time stamp under the cursor by one second. (format [m]m:ss or h:mm:ss", 81, "c:\\4ed\\code\\4coder_miblo_numbers.cpp", 36, 377 }, -{ PROC_LINKS(miblo_increment_time_stamp_minute, 0), "miblo_increment_time_stamp_minute", 33, "Increment a time stamp under the cursor by one minute. (format [m]m:ss or h:mm:ss", 81, "c:\\4ed\\code\\4coder_miblo_numbers.cpp", 36, 389 }, -{ PROC_LINKS(mouse_wheel_change_face_size, 0), "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, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 625 }, -{ PROC_LINKS(mouse_wheel_scroll, 0), "mouse_wheel_scroll", 18, "Reads the scroll wheel value from the mouse state and scrolls accordingly.", 74, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 254 }, -{ PROC_LINKS(move_down, 0), "move_down", 9, "Moves the cursor down one line.", 31, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 320 }, -{ PROC_LINKS(move_down_10, 0), "move_down_10", 12, "Moves the cursor down ten lines.", 32, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 332 }, -{ PROC_LINKS(move_down_textual, 0), "move_down_textual", 17, "Moves down to the next line of actual text, regardless of line wrapping.", 72, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 338 }, -{ PROC_LINKS(move_left, 0), "move_left", 9, "Moves the cursor one character to the left.", 43, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 369 }, -{ PROC_LINKS(move_line_down, 0), "move_line_down", 14, "Swaps the line under the cursor with the line below it, and moves the cursor down with it.", 90, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1398 }, -{ PROC_LINKS(move_line_up, 0), "move_line_up", 12, "Swaps the line under the cursor with the line above it, and moves the cursor up with it.", 88, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1334 }, -{ PROC_LINKS(move_right, 0), "move_right", 10, "Moves the cursor one character to the right.", 44, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 379 }, -{ PROC_LINKS(move_up, 0), "move_up", 7, "Moves the cursor up one line.", 29, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 314 }, -{ PROC_LINKS(move_up_10, 0), "move_up_10", 10, "Moves the cursor up ten lines.", 30, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 326 }, -{ PROC_LINKS(multi_line_edit, 0), "multi_line_edit", 15, "Begin multi-line mode. In multi-line mode characters are inserted at every line between the mark and cursor. All characters are inserted at the same character offset into the line. This mode uses line_char coordinates.", 221, "c:\\4ed\\code\\4coder_experiments.cpp", 34, 117 }, -{ PROC_LINKS(newline_or_goto_position_direct, 0), "newline_or_goto_position_direct", 31, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor.", 106, "c:\\4ed\\code\\4coder_jump_direct.cpp", 34, 99 }, -{ PROC_LINKS(newline_or_goto_position_same_panel_direct, 0), "newline_or_goto_position_same_panel_direct", 42, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor_same_panel.", 117, "c:\\4ed\\code\\4coder_jump_direct.cpp", 34, 114 }, -{ PROC_LINKS(newline_or_goto_position_same_panel_sticky, 0), "newline_or_goto_position_same_panel_sticky", 42, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor_same_panel.", 117, "c:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 582 }, -{ PROC_LINKS(newline_or_goto_position_sticky, 0), "newline_or_goto_position_sticky", 31, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor.", 106, "c:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 568 }, -{ PROC_LINKS(open_all_code, 0), "open_all_code", 13, "Open all code in the current directory. File types are determined by extensions. An extension is considered code based on the extensions specified in 4coder.config.", 164, "c:\\4ed\\code\\4coder_project_commands.cpp", 39, 1067 }, -{ PROC_LINKS(open_all_code_recursive, 0), "open_all_code_recursive", 23, "Works as open_all_code but also runs in all subdirectories.", 59, "c:\\4ed\\code\\4coder_project_commands.cpp", 39, 1074 }, -{ PROC_LINKS(open_file_in_quotes, 0), "open_file_in_quotes", 19, "Reads a filename from surrounding '\"' characters and attempts to open the corresponding file.", 94, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1525 }, -{ PROC_LINKS(open_in_other, 0), "open_in_other", 13, "Interactively opens a file in the other panel.", 46, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1915 }, -{ PROC_LINKS(open_long_braces, 0), "open_long_braces", 16, "At the cursor, insert a '{' and '}' separated by a blank line.", 62, "c:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 55 }, -{ PROC_LINKS(open_long_braces_break, 0), "open_long_braces_break", 22, "At the cursor, insert a '{' and '}break;' separated by a blank line.", 68, "c:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 71 }, -{ PROC_LINKS(open_long_braces_semicolon, 0), "open_long_braces_semicolon", 26, "At the cursor, insert a '{' and '};' separated by a blank line.", 63, "c:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 63 }, -{ PROC_LINKS(open_matching_file_cpp, 0), "open_matching_file_cpp", 22, "If the current file is a *.cpp or *.h, attempts to open the corresponding *.h or *.cpp file in the other view.", 110, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1568 }, -{ PROC_LINKS(open_panel_hsplit, 0), "open_panel_hsplit", 17, "Create a new panel by horizontally splitting the active panel.", 62, "c:\\4ed\\code\\4coder_default_framework.cpp", 40, 263 }, -{ PROC_LINKS(open_panel_vsplit, 0), "open_panel_vsplit", 17, "Create a new panel by vertically splitting the active panel.", 60, "c:\\4ed\\code\\4coder_default_framework.cpp", 40, 254 }, -{ PROC_LINKS(page_down, 0), "page_down", 9, "Scrolls the view down one view height and moves the cursor down one view height.", 80, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 358 }, -{ PROC_LINKS(page_up, 0), "page_up", 7, "Scrolls the view up one view height and moves the cursor up one view height.", 76, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 349 }, -{ PROC_LINKS(paste, 0), "paste", 5, "At the cursor, insert the text at the top of the clipboard.", 59, "c:\\4ed\\code\\4coder_clipboard.cpp", 32, 46 }, -{ PROC_LINKS(paste_and_indent, 0), "paste_and_indent", 16, "Paste from the top of clipboard and run auto-indent on the newly pasted text.", 77, "c:\\4ed\\code\\4coder_clipboard.cpp", 32, 134 }, -{ PROC_LINKS(paste_next, 0), "paste_next", 10, "If the previous command was paste or paste_next, replaces the paste range with the next text down on the clipboard, otherwise operates as the paste command.", 156, "c:\\4ed\\code\\4coder_clipboard.cpp", 32, 85 }, -{ PROC_LINKS(paste_next_and_indent, 0), "paste_next_and_indent", 21, "Paste the next item on the clipboard and run auto-indent on the newly pasted text.", 82, "c:\\4ed\\code\\4coder_clipboard.cpp", 32, 141 }, -{ PROC_LINKS(place_in_scope, 0), "place_in_scope", 14, "Wraps the code contained in the range between cursor and mark with a new curly brace scope.", 91, "c:\\4ed\\code\\4coder_scope_commands.cpp", 37, 509 }, -{ PROC_LINKS(project_command_lister, 0), "project_command_lister", 22, "Open a lister of all commands in the currently loaded project.", 62, "c:\\4ed\\code\\4coder_project_commands.cpp", 39, 1527 }, -{ PROC_LINKS(project_fkey_command, 0), "project_fkey_command", 20, "Run an 'fkey command' configured in a project.4coder file. Determines the index of the 'fkey command' by which function key or numeric key was pressed to trigger the command.", 175, "c:\\4ed\\code\\4coder_project_commands.cpp", 39, 1090 }, -{ PROC_LINKS(project_go_to_root_directory, 0), "project_go_to_root_directory", 28, "Changes 4coder's hot directory to the root directory of the currently loaded project. With no loaded project nothing hapepns.", 125, "c:\\4ed\\code\\4coder_project_commands.cpp", 39, 1113 }, -{ PROC_LINKS(query_replace, 0), "query_replace", 13, "Queries the user for two strings, and incrementally replaces every occurence of the first string with the second string.", 120, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1074 }, -{ PROC_LINKS(query_replace_identifier, 0), "query_replace_identifier", 24, "Queries the user for a string, and incrementally replace every occurence of the word or token found at the cursor with the specified string.", 140, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1098 }, -{ PROC_LINKS(query_replace_selection, 0), "query_replace_selection", 23, "Queries the user for a string, and incrementally replace every occurence of the string found in the selected range with the specified string.", 141, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1117 }, -{ PROC_LINKS(redo, 0), "redo", 4, "Advances forward through the undo history in the buffer containing the most recent regular edit.", 96, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1808 }, -{ PROC_LINKS(redo_this_buffer, 0), "redo_this_buffer", 16, "Advances forwards through the undo history of the current buffer.", 65, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1716 }, -{ PROC_LINKS(remap_interactive, 0), "remap_interactive", 17, "Switch to a named key binding map.", 34, "c:\\4ed\\code\\4coder_default_framework.cpp", 40, 381 }, -{ PROC_LINKS(rename_file_query, 0), "rename_file_query", 17, "Queries the user for a new name and renames the file of the current buffer, altering the buffer's name too.", 107, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1257 }, -{ PROC_LINKS(rename_parameter, 0), "rename_parameter", 16, "If the cursor is found to be on the name of a function parameter in the signature of a function definition, all occurences within the scope of the function will be replaced with a new provided string.", 200, "c:\\4ed\\code\\4coder_experiments.cpp", 34, 383 }, -{ PROC_LINKS(reopen, 0), "reopen", 6, "Reopen the current buffer from the hard drive.", 46, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1640 }, -{ PROC_LINKS(replace_all_occurrences, 0), "replace_all_occurrences", 23, "Queries the user for two strings, and replaces all occurrences of the first string with the second string in all open buffers.", 126, "c:\\4ed\\code\\4coder_experiments.cpp", 34, 780 }, -{ PROC_LINKS(replace_in_range, 0), "replace_in_range", 16, "Queries the user for two strings, and replaces all occurences of the first string in the range between the cursor and the mark with the second string.", 150, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 948 }, -{ PROC_LINKS(reverse_search, 0), "reverse_search", 14, "Begins an incremental search up through the current buffer for a user specified string.", 87, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 919 }, -{ PROC_LINKS(reverse_search_identifier, 0), "reverse_search_identifier", 25, "Begins an incremental search up through the current buffer for the word or token under the cursor.", 98, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 937 }, -{ PROC_LINKS(save, 0), "save", 4, "Saves the current buffer.", 25, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1632 }, -{ PROC_LINKS(save_all_dirty_buffers, 0), "save_all_dirty_buffers", 22, "Saves all buffers marked dirty (showing the '*' indicator).", 59, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1161 }, -{ PROC_LINKS(save_to_query, 0), "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, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1217 }, -{ PROC_LINKS(scope_absorb_down, 0), "scope_absorb_down", 17, "If a scope is currently selected, and a statement or block statement is present below the current scope, the statement is moved into the scope.", 143, "c:\\4ed\\code\\4coder_scope_commands.cpp", 37, 751 }, -{ PROC_LINKS(search, 0), "search", 6, "Begins an incremental search down through the current buffer for a user specified string.", 89, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 912 }, -{ PROC_LINKS(search_identifier, 0), "search_identifier", 17, "Begins an incremental search down through the current buffer for the word or token under the cursor.", 100, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 926 }, -{ PROC_LINKS(seek_alphanumeric_left, 0), "seek_alphanumeric_left", 22, "Seek left for boundary between alphanumeric characters and non-alphanumeric characters.", 87, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1195 }, -{ PROC_LINKS(seek_alphanumeric_or_camel_left, 0), "seek_alphanumeric_or_camel_left", 31, "Seek left for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 106, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1207 }, -{ PROC_LINKS(seek_alphanumeric_or_camel_right, 0), "seek_alphanumeric_or_camel_right", 32, "Seek right for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 107, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1201 }, -{ PROC_LINKS(seek_alphanumeric_right, 0), "seek_alphanumeric_right", 23, "Seek right for boundary between alphanumeric characters and non-alphanumeric characters.", 88, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1189 }, -{ PROC_LINKS(seek_beginning_of_line, 0), "seek_beginning_of_line", 22, "Seeks the cursor to the beginning of the visual line.", 53, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1083 }, -{ PROC_LINKS(seek_beginning_of_textual_line, 0), "seek_beginning_of_textual_line", 30, "Seeks the cursor to the beginning of the line across all text.", 62, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1061 }, -{ PROC_LINKS(seek_end_of_line, 0), "seek_end_of_line", 16, "Seeks the cursor to the end of the visual line.", 47, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1095 }, -{ PROC_LINKS(seek_end_of_textual_line, 0), "seek_end_of_textual_line", 24, "Seeks the cursor to the end of the line across all text.", 56, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1072 }, -{ PROC_LINKS(seek_token_left, 0), "seek_token_left", 15, "Seek left for the next beginning of a token.", 44, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1171 }, -{ PROC_LINKS(seek_token_right, 0), "seek_token_right", 16, "Seek right for the next end of a token.", 39, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1165 }, -{ PROC_LINKS(seek_white_or_token_left, 0), "seek_white_or_token_left", 24, "Seek left for the next end of a token or boundary between whitespace and non-whitespace.", 88, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1183 }, -{ PROC_LINKS(seek_white_or_token_right, 0), "seek_white_or_token_right", 25, "Seek right for the next end of a token or boundary between whitespace and non-whitespace.", 89, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1177 }, -{ PROC_LINKS(seek_whitespace_down, 0), "seek_whitespace_down", 20, "Seeks the cursor down to the next blank line.", 45, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1050 }, -{ PROC_LINKS(seek_whitespace_down_end_line, 0), "seek_whitespace_down_end_line", 29, "Seeks the cursor down to the next blank line and places it at the end of the line.", 82, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1119 }, -{ PROC_LINKS(seek_whitespace_left, 0), "seek_whitespace_left", 20, "Seek left for the next boundary between whitespace and non-whitespace.", 70, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1159 }, -{ PROC_LINKS(seek_whitespace_right, 0), "seek_whitespace_right", 21, "Seek right for the next boundary between whitespace and non-whitespace.", 71, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1153 }, -{ PROC_LINKS(seek_whitespace_up, 0), "seek_whitespace_up", 18, "Seeks the cursor up to the next blank line.", 43, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1039 }, -{ PROC_LINKS(seek_whitespace_up_end_line, 0), "seek_whitespace_up_end_line", 27, "Seeks the cursor up to the next blank line and places it at the end of the line.", 80, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1107 }, -{ PROC_LINKS(select_all, 0), "select_all", 10, "Puts the cursor at the top of the file, and the mark at the bottom of the file.", 79, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 389 }, -{ PROC_LINKS(select_next_scope_absolute, 0), "select_next_scope_absolute", 26, "Finds the first scope started by '{' after the cursor and puts the cursor and mark on the '{' and '}'.", 102, "c:\\4ed\\code\\4coder_scope_commands.cpp", 37, 390 }, -{ PROC_LINKS(select_prev_scope_absolute, 0), "select_prev_scope_absolute", 26, "Finds the first scope started by '{' before the cursor and puts the cursor and mark on the '{' and '}'.", 103, "c:\\4ed\\code\\4coder_scope_commands.cpp", 37, 410 }, -{ PROC_LINKS(select_surrounding_scope, 0), "select_surrounding_scope", 24, "Finds the scope enclosed by '{' '}' surrounding the cursor and puts the cursor and mark on the '{' and '}'.", 107, "c:\\4ed\\code\\4coder_scope_commands.cpp", 37, 374 }, -{ PROC_LINKS(set_bindings_choose, 0), "set_bindings_choose", 19, "Remap keybindings using the 'choose' mapping rule.", 50, "c:\\4ed\\code\\4coder_remapping_commands.cpp", 41, 47 }, -{ PROC_LINKS(set_bindings_default, 0), "set_bindings_default", 20, "Remap keybindings using the 'default' mapping rule.", 51, "c:\\4ed\\code\\4coder_remapping_commands.cpp", 41, 61 }, -{ PROC_LINKS(set_bindings_mac_default, 0), "set_bindings_mac_default", 24, "Remap keybindings using the 'mac-default' mapping rule.", 55, "c:\\4ed\\code\\4coder_remapping_commands.cpp", 41, 75 }, -{ PROC_LINKS(set_mark, 0), "set_mark", 8, "Sets the mark to the current position of the cursor.", 52, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 121 }, -{ PROC_LINKS(set_mode_to_notepad_like, 0), "set_mode_to_notepad_like", 24, "Sets the edit mode to Notepad like.", 35, "c:\\4ed\\code\\4coder_default_framework.cpp", 40, 349 }, -{ PROC_LINKS(set_mode_to_original, 0), "set_mode_to_original", 20, "Sets the edit mode to 4coder original.", 38, "c:\\4ed\\code\\4coder_default_framework.cpp", 40, 343 }, -{ PROC_LINKS(setup_build_bat, 0), "setup_build_bat", 15, "Queries the user for several configuration options and initializes a new build batch script.", 92, "c:\\4ed\\code\\4coder_project_commands.cpp", 39, 1498 }, -{ PROC_LINKS(setup_build_bat_and_sh, 0), "setup_build_bat_and_sh", 22, "Queries the user for several configuration options and initializes a new build batch script.", 92, "c:\\4ed\\code\\4coder_project_commands.cpp", 39, 1510 }, -{ PROC_LINKS(setup_build_sh, 0), "setup_build_sh", 14, "Queries the user for several configuration options and initializes a new build shell script.", 92, "c:\\4ed\\code\\4coder_project_commands.cpp", 39, 1504 }, -{ PROC_LINKS(setup_new_project, 0), "setup_new_project", 17, "Queries the user for several configuration options and initializes a new 4coder project with build scripts for every OS.", 120, "c:\\4ed\\code\\4coder_project_commands.cpp", 39, 1491 }, -{ PROC_LINKS(show_filebar, 0), "show_filebar", 12, "Sets the current view to show it's filebar.", 43, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 541 }, -{ PROC_LINKS(show_scrollbar, 0), "show_scrollbar", 14, "Sets the current view to show it's scrollbar.", 45, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 527 }, -{ PROC_LINKS(snipe_token_or_word, 0), "snipe_token_or_word", 19, "Delete a single, whole token on or to the left of the cursor and post it to the clipboard.", 90, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1227 }, -{ PROC_LINKS(snipe_token_or_word_right, 0), "snipe_token_or_word_right", 25, "Delete a single, whole token on or to the right of the cursor and post it to the clipboard.", 91, "c:\\4ed\\code\\4coder_seek.cpp", 27, 1233 }, -{ PROC_LINKS(snippet_lister, 0), "snippet_lister", 14, "Opens a snippet lister for inserting whole pre-written snippets of text.", 72, "c:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 248 }, -{ PROC_LINKS(suppress_mouse, 0), "suppress_mouse", 14, "Hides the mouse and causes all mosue input (clicks, position, wheel) to be ignored.", 83, "c:\\4ed\\code\\4coder_default_framework.cpp", 40, 325 }, -{ PROC_LINKS(swap_buffers_between_panels, 0), "swap_buffers_between_panels", 27, "Set the other non-active panel to view the buffer that the active panel views, and switch to that panel.", 104, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1592 }, -{ PROC_LINKS(to_lowercase, 0), "to_lowercase", 12, "Converts all ascii text in the range between the cursor and the mark to lowercase.", 82, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 421 }, -{ PROC_LINKS(to_uppercase, 0), "to_uppercase", 12, "Converts all ascii text in the range between the cursor and the mark to uppercase.", 82, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 401 }, -{ PROC_LINKS(toggle_filebar, 0), "toggle_filebar", 14, "Toggles the visibility status of the current view's filebar.", 60, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 555 }, -{ PROC_LINKS(toggle_fps_meter, 0), "toggle_fps_meter", 16, "Toggles the visibility of the FPS performance meter", 51, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 573 }, -{ PROC_LINKS(toggle_fullscreen, 0), "toggle_fullscreen", 17, "Toggle fullscreen mode on or off. The change(s) do not take effect until the next frame.", 89, "c:\\4ed\\code\\4coder_default_framework.cpp", 40, 373 }, -{ PROC_LINKS(toggle_highlight_enclosing_scopes, 0), "toggle_highlight_enclosing_scopes", 33, "In code files scopes surrounding the cursor are highlighted with distinguishing colors.", 87, "c:\\4ed\\code\\4coder_default_framework.cpp", 40, 361 }, -{ PROC_LINKS(toggle_highlight_line_at_cursor, 0), "toggle_highlight_line_at_cursor", 31, "Toggles the line highlight at the cursor.", 41, "c:\\4ed\\code\\4coder_default_framework.cpp", 40, 355 }, -{ PROC_LINKS(toggle_line_numbers, 0), "toggle_line_numbers", 19, "Toggles the left margin line numbers.", 37, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 660 }, -{ PROC_LINKS(toggle_line_wrap, 0), "toggle_line_wrap", 16, "Toggles the current buffer's line wrapping status.", 50, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 564 }, -{ PROC_LINKS(toggle_mouse, 0), "toggle_mouse", 12, "Toggles the mouse suppression mode, see suppress_mouse and allow_mouse.", 71, "c:\\4ed\\code\\4coder_default_framework.cpp", 40, 337 }, -{ PROC_LINKS(toggle_paren_matching_helper, 0), "toggle_paren_matching_helper", 28, "In code files matching parentheses pairs are colored with distinguishing colors.", 80, "c:\\4ed\\code\\4coder_default_framework.cpp", 40, 367 }, -{ PROC_LINKS(toggle_show_whitespace, 0), "toggle_show_whitespace", 22, "Toggles the current buffer's whitespace visibility status.", 58, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 653 }, -{ PROC_LINKS(toggle_virtual_whitespace, 0), "toggle_virtual_whitespace", 25, "Toggles the current buffer's virtual whitespace status.", 55, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 642 }, -{ PROC_LINKS(uncomment_line, 0), "uncomment_line", 14, "If present, delete '//' at the beginning of the line after leading whitespace.", 78, "c:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 147 }, -{ PROC_LINKS(undo, 0), "undo", 4, "Advances backward through the undo history in the buffer containing the most recent regular edit.", 97, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1732 }, -{ PROC_LINKS(undo_this_buffer, 0), "undo_this_buffer", 16, "Advances backwards through the undo history of the current buffer.", 66, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1702 }, -{ PROC_LINKS(view_buffer_other_panel, 0), "view_buffer_other_panel", 23, "Set the other non-active panel to view the buffer that the active panel views, and switch to that panel.", 104, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 1582 }, -{ PROC_LINKS(view_jump_list_with_lister, 0), "view_jump_list_with_lister", 26, "When executed on a buffer with jumps, creates a persistent lister for all the jumps", 83, "c:\\4ed\\code\\4coder_jump_lister.cpp", 34, 106 }, -{ PROC_LINKS(word_complete, 0), "word_complete", 13, "Iteratively tries completing the word to the left of the cursor with other words in open buffers that have the same prefix string.", 130, "c:\\4ed\\code\\4coder_search.cpp", 29, 897 }, -{ PROC_LINKS(write_and_auto_tab, 0), "write_and_auto_tab", 18, "Inserts a character and auto-indents the line on which the cursor sits.", 71, "c:\\4ed\\code\\4coder_auto_indent.cpp", 34, 652 }, -{ PROC_LINKS(write_block, 0), "write_block", 11, "At the cursor, insert a block comment.", 38, "c:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 103 }, -{ PROC_LINKS(write_character, 0), "write_character", 15, "Inserts whatever character was used to trigger this command.", 60, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 67 }, -{ PROC_LINKS(write_explicit_enum_flags, 0), "write_explicit_enum_flags", 25, "If the cursor is found to be on the '{' of an enum definition, the values of the enum will be filled in to give each a unique power of 2 value, starting from 1. Existing values are overwritten.", 194, "c:\\4ed\\code\\4coder_experiments.cpp", 34, 705 }, -{ PROC_LINKS(write_explicit_enum_values, 0), "write_explicit_enum_values", 26, "If the cursor is found to be on the '{' of an enum definition, the values of the enum will be filled in sequentially starting from zero. Existing values are overwritten.", 170, "c:\\4ed\\code\\4coder_experiments.cpp", 34, 699 }, -{ PROC_LINKS(write_hack, 0), "write_hack", 10, "At the cursor, insert a '// HACK' comment, includes user name if it was specified in config.4coder.", 99, "c:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 91 }, -{ PROC_LINKS(write_note, 0), "write_note", 10, "At the cursor, insert a '// NOTE' comment, includes user name if it was specified in config.4coder.", 99, "c:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 97 }, -{ PROC_LINKS(write_todo, 0), "write_todo", 10, "At the cursor, insert a '// TODO' comment, includes user name if it was specified in config.4coder.", 99, "c:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 85 }, -{ PROC_LINKS(write_underscore, 0), "write_underscore", 16, "Inserts an underscore.", 22, "c:\\4ed\\code\\4coder_base_commands.cpp", 36, 76 }, -{ PROC_LINKS(write_zero_struct, 0), "write_zero_struct", 17, "At the cursor, insert a ' = {};'.", 33, "c:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 109 }, +{ PROC_LINKS(allow_mouse, 0), "allow_mouse", 11, "Shows the mouse and causes all mouse input to be processed normally.", 68, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 331 }, +{ PROC_LINKS(auto_tab_line_at_cursor, 0), "auto_tab_line_at_cursor", 23, "Auto-indents the line on which the cursor sits.", 47, "w:\\4ed\\code\\4coder_auto_indent.cpp", 34, 623 }, +{ PROC_LINKS(auto_tab_range, 0), "auto_tab_range", 14, "Auto-indents the range between the cursor and the mark.", 55, "w:\\4ed\\code\\4coder_auto_indent.cpp", 34, 633 }, +{ PROC_LINKS(auto_tab_whole_file, 0), "auto_tab_whole_file", 19, "Audo-indents the entire current buffer.", 39, "w:\\4ed\\code\\4coder_auto_indent.cpp", 34, 612 }, +{ PROC_LINKS(backspace_char, 0), "backspace_char", 14, "Deletes the character to the left of the cursor.", 48, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 101 }, +{ PROC_LINKS(backspace_word, 0), "backspace_word", 14, "Delete characters between the cursor position and the first alphanumeric boundary to the left.", 94, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1215 }, +{ PROC_LINKS(basic_change_active_panel, 0), "basic_change_active_panel", 25, "Change the currently active panel, moving to the panel with the next highest view_id. Will not skipe the build panel if it is open.", 132, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 510 }, +{ PROC_LINKS(build_in_build_panel, 0), "build_in_build_panel", 20, "Looks for a build.bat, build.sh, or makefile in the current and parent directories. Runs the first that it finds and prints the output to *compilation*. Puts the *compilation* buffer in a panel at the footer of the current view.", 230, "w:\\4ed\\code\\4coder_build_commands.cpp", 37, 187 }, +{ PROC_LINKS(build_search, 0), "build_search", 12, "Looks for a build.bat, build.sh, or makefile in the current and parent directories. Runs the first that it finds and prints the output to *compilation*.", 153, "w:\\4ed\\code\\4coder_build_commands.cpp", 37, 155 }, +{ PROC_LINKS(center_view, 0), "center_view", 11, "Centers the view vertically on the line on which the cursor sits.", 65, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 151 }, +{ PROC_LINKS(change_active_panel, 0), "change_active_panel", 19, "Change the currently active panel, moving to the panel with the next highest view_id.", 85, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 234 }, +{ PROC_LINKS(change_active_panel_backwards, 0), "change_active_panel_backwards", 29, "Change the currently active panel, moving to the panel with the next lowest view_id.", 84, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 244 }, +{ PROC_LINKS(change_to_build_panel, 0), "change_to_build_panel", 21, "If the special build panel is open, makes the build panel the active panel.", 75, "w:\\4ed\\code\\4coder_build_commands.cpp", 37, 209 }, +{ PROC_LINKS(clean_all_lines, 0), "clean_all_lines", 15, "Removes trailing whitespace from all lines in the current buffer.", 65, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 441 }, +{ PROC_LINKS(click_set_cursor, 0), "click_set_cursor", 16, "Sets the cursor position to the mouse position.", 47, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 210 }, +{ PROC_LINKS(click_set_cursor_and_mark, 0), "click_set_cursor_and_mark", 25, "Sets the cursor position and mark to the mouse position.", 56, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 196 }, +{ PROC_LINKS(click_set_cursor_if_lbutton, 0), "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\\4coder_base_commands.cpp", 36, 224 }, +{ PROC_LINKS(click_set_mark, 0), "click_set_mark", 14, "Sets the mark position to the mouse position.", 45, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 240 }, +{ PROC_LINKS(close_all_code, 0), "close_all_code", 14, "Closes any buffer with a filename ending with an extension configured to be recognized as a code file type.", 107, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1060 }, +{ PROC_LINKS(close_build_panel, 0), "close_build_panel", 17, "If the special build panel is open, closes it.", 46, "w:\\4ed\\code\\4coder_build_commands.cpp", 37, 203 }, +{ PROC_LINKS(close_panel, 0), "close_panel", 11, "Closes the currently active panel if it is not the only panel open.", 67, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 518 }, +{ PROC_LINKS(command_lister, 0), "command_lister", 14, "Opens an interactive list of all registered commands.", 53, "w:\\4ed\\code\\4coder_lists.cpp", 28, 1000 }, +{ PROC_LINKS(comment_line, 0), "comment_line", 12, "Insert '//' at the beginning of the line after leading whitespace.", 66, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 135 }, +{ PROC_LINKS(comment_line_toggle, 0), "comment_line_toggle", 19, "Turns uncommented lines into commented lines and vice versa for comments starting with '//'.", 92, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 161 }, +{ PROC_LINKS(copy, 0), "copy", 4, "Copy the text in the range from the cursor to the mark onto the clipboard.", 74, "w:\\4ed\\code\\4coder_clipboard.cpp", 32, 26 }, +{ PROC_LINKS(cursor_mark_swap, 0), "cursor_mark_swap", 16, "Swaps the position of the cursor and the mark.", 46, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 129 }, +{ PROC_LINKS(cut, 0), "cut", 3, "Cut the text in the range from the cursor to the mark onto the clipboard.", 73, "w:\\4ed\\code\\4coder_clipboard.cpp", 32, 35 }, +{ PROC_LINKS(decrease_face_size, 0), "decrease_face_size", 18, "Decrease the size of the face used by the current buffer.", 57, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 613 }, +{ PROC_LINKS(decrease_line_wrap, 0), "decrease_line_wrap", 18, "Decrases the current buffer's width for line wrapping.", 54, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 590 }, +{ PROC_LINKS(delete_char, 0), "delete_char", 11, "Deletes the character to the right of the cursor.", 49, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 83 }, +{ PROC_LINKS(delete_current_scope, 0), "delete_current_scope", 20, "Deletes the braces surrounding the currently selected scope. Leaves the contents within the scope.", 99, "w:\\4ed\\code\\4coder_scope_commands.cpp", 37, 481 }, +{ PROC_LINKS(delete_file_query, 0), "delete_file_query", 17, "Deletes the file of the current buffer if 4coder has the appropriate access rights. Will ask the user for confirmation first.", 125, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1191 }, +{ PROC_LINKS(delete_line, 0), "delete_line", 11, "Delete the line the on which the cursor sits.", 45, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1444 }, +{ PROC_LINKS(delete_range, 0), "delete_range", 12, "Deletes the text in the range between the cursor and the mark.", 62, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 139 }, +{ PROC_LINKS(delete_word, 0), "delete_word", 11, "Delete characters between the cursor position and the first alphanumeric boundary to the right.", 95, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1221 }, +{ PROC_LINKS(duplicate_line, 0), "duplicate_line", 14, "Create a copy of the line on which the cursor sits.", 51, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1421 }, +{ PROC_LINKS(eol_dosify, 0), "eol_dosify", 10, "Puts the buffer in DOS line ending mode.", 40, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 666 }, +{ PROC_LINKS(eol_nixify, 0), "eol_nixify", 10, "Puts the buffer in NIX line ending mode.", 40, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 674 }, +{ PROC_LINKS(execute_any_cli, 0), "execute_any_cli", 15, "Queries for an output buffer name and system command, runs the system command as a CLI and prints the output to the specified buffer.", 133, "w:\\4ed\\code\\4coder_system_command.cpp", 37, 23 }, +{ PROC_LINKS(execute_previous_cli, 0), "execute_previous_cli", 20, "If the command execute_any_cli has already been used, this will execute a CLI reusing the most recent buffer name and command.", 126, "w:\\4ed\\code\\4coder_system_command.cpp", 37, 7 }, +{ PROC_LINKS(exit_4coder, 0), "exit_4coder", 11, "Attempts to close 4coder.", 25, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 682 }, +{ PROC_LINKS(goto_beginning_of_file, 0), "goto_beginning_of_file", 22, "Sets the cursor to the beginning of the file.", 45, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1131 }, +{ PROC_LINKS(goto_end_of_file, 0), "goto_end_of_file", 16, "Sets the cursor to the end of the file.", 39, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1139 }, +{ PROC_LINKS(goto_first_jump_direct, 0), "goto_first_jump_direct", 22, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer.", 95, "w:\\4ed\\code\\4coder_jump_direct.cpp", 34, 82 }, +{ PROC_LINKS(goto_first_jump_same_panel_sticky, 0), "goto_first_jump_same_panel_sticky", 33, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer and views the buffer in the panel where the jump list was.", 153, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 545 }, +{ PROC_LINKS(goto_first_jump_sticky, 0), "goto_first_jump_sticky", 22, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer.", 95, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 527 }, +{ PROC_LINKS(goto_jump_at_cursor_direct, 0), "goto_jump_at_cursor_direct", 26, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in another view and changes the active panel to the view containing the jump.", 187, "w:\\4ed\\code\\4coder_jump_direct.cpp", 34, 8 }, +{ PROC_LINKS(goto_jump_at_cursor_same_panel_direct, 0), "goto_jump_at_cursor_same_panel_direct", 37, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in this view, losing the compilation output or jump list..", 168, "w:\\4ed\\code\\4coder_jump_direct.cpp", 34, 28 }, +{ PROC_LINKS(goto_jump_at_cursor_same_panel_sticky, 0), "goto_jump_at_cursor_same_panel_sticky", 37, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in this view, losing the compilation output or jump list.", 167, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 371 }, +{ PROC_LINKS(goto_jump_at_cursor_sticky, 0), "goto_jump_at_cursor_sticky", 26, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in another view and changes the active panel to the view containing the jump.", 187, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 343 }, +{ PROC_LINKS(goto_line, 0), "goto_line", 9, "Queries the user for a number, and jumps the cursor to the corresponding line.", 78, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 690 }, +{ PROC_LINKS(goto_next_jump_direct, 0), "goto_next_jump_direct", 21, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, skipping sub jump locations.", 123, "w:\\4ed\\code\\4coder_jump_direct.cpp", 34, 46 }, +{ PROC_LINKS(goto_next_jump_no_skips_direct, 0), "goto_next_jump_no_skips_direct", 30, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, and does not skip sub jump locations.", 132, "w:\\4ed\\code\\4coder_jump_direct.cpp", 34, 64 }, +{ PROC_LINKS(goto_next_jump_no_skips_sticky, 0), "goto_next_jump_no_skips_sticky", 30, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, and does not skip sub jump locations.", 132, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 496 }, +{ PROC_LINKS(goto_next_jump_sticky, 0), "goto_next_jump_sticky", 21, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, skipping sub jump locations.", 123, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 466 }, +{ PROC_LINKS(goto_prev_jump_direct, 0), "goto_prev_jump_direct", 21, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, skipping sub jump locations.", 127, "w:\\4ed\\code\\4coder_jump_direct.cpp", 34, 55 }, +{ PROC_LINKS(goto_prev_jump_no_skips_direct, 0), "goto_prev_jump_no_skips_direct", 30, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, and does not skip sub jump locations.", 136, "w:\\4ed\\code\\4coder_jump_direct.cpp", 34, 73 }, +{ PROC_LINKS(goto_prev_jump_no_skips_sticky, 0), "goto_prev_jump_no_skips_sticky", 30, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, and does not skip sub jump locations.", 136, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 512 }, +{ PROC_LINKS(goto_prev_jump_sticky, 0), "goto_prev_jump_sticky", 21, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, skipping sub jump locations.", 127, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 482 }, +{ PROC_LINKS(hide_filebar, 0), "hide_filebar", 12, "Sets the current view to hide it's filebar.", 43, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 548 }, +{ PROC_LINKS(hide_scrollbar, 0), "hide_scrollbar", 14, "Sets the current view to hide it's scrollbar.", 45, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 534 }, +{ PROC_LINKS(if0_off, 0), "if0_off", 7, "Surround the range between the cursor and mark with an '#if 0' and an '#endif'", 78, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 79 }, +{ PROC_LINKS(increase_face_size, 0), "increase_face_size", 18, "Increase the size of the face used by the current buffer.", 57, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 601 }, +{ PROC_LINKS(increase_line_wrap, 0), "increase_line_wrap", 18, "Increases the current buffer's width for line wrapping.", 55, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 579 }, +{ PROC_LINKS(interactive_kill_buffer, 0), "interactive_kill_buffer", 23, "Interactively kill an open buffer.", 34, "w:\\4ed\\code\\4coder_lists.cpp", 28, 774 }, +{ PROC_LINKS(interactive_new, 0), "interactive_new", 15, "Interactively creates a new file.", 33, "w:\\4ed\\code\\4coder_lists.cpp", 28, 886 }, +{ PROC_LINKS(interactive_open, 0), "interactive_open", 16, "Interactively opens a file.", 27, "w:\\4ed\\code\\4coder_lists.cpp", 28, 918 }, +{ PROC_LINKS(interactive_open_or_new, 0), "interactive_open_or_new", 23, "Interactively open a file out of the file system.", 49, "w:\\4ed\\code\\4coder_lists.cpp", 28, 848 }, +{ PROC_LINKS(interactive_switch_buffer, 0), "interactive_switch_buffer", 25, "Interactively switch to an open buffer.", 39, "w:\\4ed\\code\\4coder_lists.cpp", 28, 755 }, +{ PROC_LINKS(kill_buffer, 0), "kill_buffer", 11, "Kills the current buffer.", 25, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1628 }, +{ PROC_LINKS(kill_rect, 0), "kill_rect", 9, "Delete characters in a rectangular region. Range testing is done by unwrapped-xy coordinates.", 93, "w:\\4ed\\code\\4coder_experiments.cpp", 34, 26 }, +{ PROC_LINKS(left_adjust_view, 0), "left_adjust_view", 16, "Sets the left size of the view near the x position of the cursor.", 65, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 167 }, +{ PROC_LINKS(list_all_functions_all_buffers, 0), "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\\4coder_function_list.cpp", 36, 344 }, +{ PROC_LINKS(list_all_functions_all_buffers_lister, 0), "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\\4coder_function_list.cpp", 36, 350 }, +{ PROC_LINKS(list_all_functions_current_buffer, 0), "list_all_functions_current_buffer", 33, "Creates a jump list of lines of the current buffer that appear to define or declare functions.", 94, "w:\\4ed\\code\\4coder_function_list.cpp", 36, 320 }, +{ PROC_LINKS(list_all_functions_current_buffer_lister, 0), "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\\4coder_function_list.cpp", 36, 331 }, +{ PROC_LINKS(list_all_locations, 0), "list_all_locations", 18, "Queries the user for a string and lists all exact case-sensitive matches found in all open buffers.", 99, "w:\\4ed\\code\\4coder_search.cpp", 29, 812 }, +{ PROC_LINKS(list_all_locations_case_insensitive, 0), "list_all_locations_case_insensitive", 35, "Queries the user for a string and lists all exact case-insensitive matches found in all open buffers.", 101, "w:\\4ed\\code\\4coder_search.cpp", 29, 826 }, +{ PROC_LINKS(list_all_locations_of_identifier, 0), "list_all_locations_of_identifier", 32, "Reads a token or word under the cursor and lists all exact case-sensitive mathces in all open buffers.", 102, "w:\\4ed\\code\\4coder_search.cpp", 29, 840 }, +{ PROC_LINKS(list_all_locations_of_identifier_case_insensitive, 0), "list_all_locations_of_identifier_case_insensitive", 49, "Reads a token or word under the cursor and lists all exact case-insensitive mathces in all open buffers.", 104, "w:\\4ed\\code\\4coder_search.cpp", 29, 847 }, +{ PROC_LINKS(list_all_locations_of_selection, 0), "list_all_locations_of_selection", 31, "Reads the string in the selected range and lists all exact case-sensitive mathces in all open buffers.", 102, "w:\\4ed\\code\\4coder_search.cpp", 29, 854 }, +{ PROC_LINKS(list_all_locations_of_selection_case_insensitive, 0), "list_all_locations_of_selection_case_insensitive", 48, "Reads the string in the selected range and lists all exact case-insensitive mathces in all open buffers.", 104, "w:\\4ed\\code\\4coder_search.cpp", 29, 861 }, +{ PROC_LINKS(list_all_locations_of_type_definition, 0), "list_all_locations_of_type_definition", 37, "Queries user for string, lists all locations of strings that appear to define a type whose name matches the input string.", 121, "w:\\4ed\\code\\4coder_search.cpp", 29, 868 }, +{ PROC_LINKS(list_all_locations_of_type_definition_of_identifier, 0), "list_all_locations_of_type_definition_of_identifier", 51, "Reads a token or word under the cursor and lists all locations of strings that appear to define a type whose name matches it.", 125, "w:\\4ed\\code\\4coder_search.cpp", 29, 879 }, +{ PROC_LINKS(list_all_substring_locations, 0), "list_all_substring_locations", 28, "Queries the user for a string and lists all case-sensitive substring matches found in all open buffers.", 103, "w:\\4ed\\code\\4coder_search.cpp", 29, 819 }, +{ PROC_LINKS(list_all_substring_locations_case_insensitive, 0), "list_all_substring_locations_case_insensitive", 45, "Queries the user for a string and lists all case-insensitive substring matches found in all open buffers.", 105, "w:\\4ed\\code\\4coder_search.cpp", 29, 833 }, +{ PROC_LINKS(lister__activate, 0), "lister__activate", 16, "A lister mode command that activates the list's action on the highlighted item.", 79, "w:\\4ed\\code\\4coder_lists.cpp", 28, 15 }, +{ PROC_LINKS(lister__backspace_text_field, 0), "lister__backspace_text_field", 28, "A lister mode command that dispatches to the lister's backspace text field handler.", 83, "w:\\4ed\\code\\4coder_lists.cpp", 28, 41 }, +{ PROC_LINKS(lister__backspace_text_field__default, 0), "lister__backspace_text_field__default", 37, "A lister mode command that backspaces one character from the text field.", 72, "w:\\4ed\\code\\4coder_lists.cpp", 28, 145 }, +{ PROC_LINKS(lister__backspace_text_field__file_path, 0), "lister__backspace_text_field__file_path", 39, "A lister mode command that backspaces one character from the text field of a file system list.", 94, "w:\\4ed\\code\\4coder_lists.cpp", 28, 217 }, +{ PROC_LINKS(lister__mouse_press, 0), "lister__mouse_press", 19, "A lister mode command that beings a click interaction with a list item under the mouse.", 87, "w:\\4ed\\code\\4coder_lists.cpp", 28, 86 }, +{ PROC_LINKS(lister__mouse_release, 0), "lister__mouse_release", 21, "A lister mode command that ends a click interaction with a list item under the mouse, possibly activating it.", 109, "w:\\4ed\\code\\4coder_lists.cpp", 28, 98 }, +{ PROC_LINKS(lister__move_down, 0), "lister__move_down", 17, "A lister mode command that dispatches to the lister's navigate down handler.", 76, "w:\\4ed\\code\\4coder_lists.cpp", 28, 61 }, +{ PROC_LINKS(lister__move_down__default, 0), "lister__move_down__default", 26, "A lister mode command that moves the highlighted item one down in the list.", 75, "w:\\4ed\\code\\4coder_lists.cpp", 28, 176 }, +{ PROC_LINKS(lister__move_up, 0), "lister__move_up", 15, "A lister mode command that dispatches to the lister's navigate up handler.", 74, "w:\\4ed\\code\\4coder_lists.cpp", 28, 51 }, +{ PROC_LINKS(lister__move_up__default, 0), "lister__move_up__default", 24, "A lister mode command that moves the highlighted item one up in the list.", 73, "w:\\4ed\\code\\4coder_lists.cpp", 28, 160 }, +{ PROC_LINKS(lister__quit, 0), "lister__quit", 12, "A lister mode command that quits the list without executing any actions.", 72, "w:\\4ed\\code\\4coder_lists.cpp", 28, 8 }, +{ PROC_LINKS(lister__repaint, 0), "lister__repaint", 15, "A lister mode command that updates the lists UI data.", 53, "w:\\4ed\\code\\4coder_lists.cpp", 28, 114 }, +{ PROC_LINKS(lister__wheel_scroll, 0), "lister__wheel_scroll", 20, "A lister mode command that scrolls the list in response to the mouse wheel.", 75, "w:\\4ed\\code\\4coder_lists.cpp", 28, 71 }, +{ PROC_LINKS(lister__write_character, 0), "lister__write_character", 23, "A lister mode command that dispatches to the lister's write character handler.", 78, "w:\\4ed\\code\\4coder_lists.cpp", 28, 31 }, +{ PROC_LINKS(lister__write_character__default, 0), "lister__write_character__default", 32, "A lister mode command that inserts a new character to the text field.", 69, "w:\\4ed\\code\\4coder_lists.cpp", 28, 125 }, +{ PROC_LINKS(lister__write_character__file_path, 0), "lister__write_character__file_path", 34, "A lister mode command that inserts a character into the text field of a file system list.", 89, "w:\\4ed\\code\\4coder_lists.cpp", 28, 192 }, +{ PROC_LINKS(lister__write_character__fixed_list, 0), "lister__write_character__fixed_list", 35, "A lister mode command that handles input for the fixed sure to kill list.", 73, "w:\\4ed\\code\\4coder_lists.cpp", 28, 256 }, +{ PROC_LINKS(load_project, 0), "load_project", 12, "Looks for a project.4coder file in the current directory and tries to load it. Looks in parent directories until a project file is found or there are no more parents.", 167, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1083 }, +{ PROC_LINKS(make_directory_query, 0), "make_directory_query", 20, "Queries the user for a name and creates a new directory with the given name.", 76, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1301 }, +{ PROC_LINKS(miblo_decrement_basic, 0), "miblo_decrement_basic", 21, "Decrement an integer under the cursor by one.", 45, "w:\\4ed\\code\\4coder_miblo_numbers.cpp", 36, 110 }, +{ PROC_LINKS(miblo_decrement_time_stamp, 0), "miblo_decrement_time_stamp", 26, "Decrement a time stamp under the cursor by one second. (format [m]m:ss or h:mm:ss", 81, "w:\\4ed\\code\\4coder_miblo_numbers.cpp", 36, 383 }, +{ PROC_LINKS(miblo_decrement_time_stamp_minute, 0), "miblo_decrement_time_stamp_minute", 33, "Decrement a time stamp under the cursor by one minute. (format [m]m:ss or h:mm:ss", 81, "w:\\4ed\\code\\4coder_miblo_numbers.cpp", 36, 395 }, +{ PROC_LINKS(miblo_increment_basic, 0), "miblo_increment_basic", 21, "Increment an integer under the cursor by one.", 45, "w:\\4ed\\code\\4coder_miblo_numbers.cpp", 36, 94 }, +{ PROC_LINKS(miblo_increment_time_stamp, 0), "miblo_increment_time_stamp", 26, "Increment a time stamp under the cursor by one second. (format [m]m:ss or h:mm:ss", 81, "w:\\4ed\\code\\4coder_miblo_numbers.cpp", 36, 377 }, +{ PROC_LINKS(miblo_increment_time_stamp_minute, 0), "miblo_increment_time_stamp_minute", 33, "Increment a time stamp under the cursor by one minute. (format [m]m:ss or h:mm:ss", 81, "w:\\4ed\\code\\4coder_miblo_numbers.cpp", 36, 389 }, +{ PROC_LINKS(mouse_wheel_change_face_size, 0), "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\\4coder_base_commands.cpp", 36, 625 }, +{ PROC_LINKS(mouse_wheel_scroll, 0), "mouse_wheel_scroll", 18, "Reads the scroll wheel value from the mouse state and scrolls accordingly.", 74, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 254 }, +{ PROC_LINKS(move_down, 0), "move_down", 9, "Moves the cursor down one line.", 31, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 320 }, +{ PROC_LINKS(move_down_10, 0), "move_down_10", 12, "Moves the cursor down ten lines.", 32, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 332 }, +{ PROC_LINKS(move_down_textual, 0), "move_down_textual", 17, "Moves down to the next line of actual text, regardless of line wrapping.", 72, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 338 }, +{ PROC_LINKS(move_left, 0), "move_left", 9, "Moves the cursor one character to the left.", 43, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 369 }, +{ PROC_LINKS(move_line_down, 0), "move_line_down", 14, "Swaps the line under the cursor with the line below it, and moves the cursor down with it.", 90, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1398 }, +{ PROC_LINKS(move_line_up, 0), "move_line_up", 12, "Swaps the line under the cursor with the line above it, and moves the cursor up with it.", 88, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1334 }, +{ PROC_LINKS(move_right, 0), "move_right", 10, "Moves the cursor one character to the right.", 44, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 379 }, +{ PROC_LINKS(move_up, 0), "move_up", 7, "Moves the cursor up one line.", 29, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 314 }, +{ PROC_LINKS(move_up_10, 0), "move_up_10", 10, "Moves the cursor up ten lines.", 30, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 326 }, +{ PROC_LINKS(multi_line_edit, 0), "multi_line_edit", 15, "Begin multi-line mode. In multi-line mode characters are inserted at every line between the mark and cursor. All characters are inserted at the same character offset into the line. This mode uses line_char coordinates.", 221, "w:\\4ed\\code\\4coder_experiments.cpp", 34, 117 }, +{ PROC_LINKS(newline_or_goto_position_direct, 0), "newline_or_goto_position_direct", 31, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor.", 106, "w:\\4ed\\code\\4coder_jump_direct.cpp", 34, 99 }, +{ PROC_LINKS(newline_or_goto_position_same_panel_direct, 0), "newline_or_goto_position_same_panel_direct", 42, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor_same_panel.", 117, "w:\\4ed\\code\\4coder_jump_direct.cpp", 34, 114 }, +{ PROC_LINKS(newline_or_goto_position_same_panel_sticky, 0), "newline_or_goto_position_same_panel_sticky", 42, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor_same_panel.", 117, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 582 }, +{ PROC_LINKS(newline_or_goto_position_sticky, 0), "newline_or_goto_position_sticky", 31, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor.", 106, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 568 }, +{ PROC_LINKS(open_all_code, 0), "open_all_code", 13, "Open all code in the current directory. File types are determined by extensions. An extension is considered code based on the extensions specified in 4coder.config.", 164, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1067 }, +{ PROC_LINKS(open_all_code_recursive, 0), "open_all_code_recursive", 23, "Works as open_all_code but also runs in all subdirectories.", 59, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1074 }, +{ PROC_LINKS(open_file_in_quotes, 0), "open_file_in_quotes", 19, "Reads a filename from surrounding '\"' characters and attempts to open the corresponding file.", 94, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1528 }, +{ PROC_LINKS(open_in_other, 0), "open_in_other", 13, "Interactively opens a file in the other panel.", 46, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1918 }, +{ PROC_LINKS(open_long_braces, 0), "open_long_braces", 16, "At the cursor, insert a '{' and '}' separated by a blank line.", 62, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 55 }, +{ PROC_LINKS(open_long_braces_break, 0), "open_long_braces_break", 22, "At the cursor, insert a '{' and '}break;' separated by a blank line.", 68, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 71 }, +{ PROC_LINKS(open_long_braces_semicolon, 0), "open_long_braces_semicolon", 26, "At the cursor, insert a '{' and '};' separated by a blank line.", 63, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 63 }, +{ PROC_LINKS(open_matching_file_cpp, 0), "open_matching_file_cpp", 22, "If the current file is a *.cpp or *.h, attempts to open the corresponding *.h or *.cpp file in the other view.", 110, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1571 }, +{ PROC_LINKS(open_panel_hsplit, 0), "open_panel_hsplit", 17, "Create a new panel by horizontally splitting the active panel.", 62, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 263 }, +{ PROC_LINKS(open_panel_vsplit, 0), "open_panel_vsplit", 17, "Create a new panel by vertically splitting the active panel.", 60, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 254 }, +{ PROC_LINKS(page_down, 0), "page_down", 9, "Scrolls the view down one view height and moves the cursor down one view height.", 80, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 358 }, +{ PROC_LINKS(page_up, 0), "page_up", 7, "Scrolls the view up one view height and moves the cursor up one view height.", 76, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 349 }, +{ PROC_LINKS(paste, 0), "paste", 5, "At the cursor, insert the text at the top of the clipboard.", 59, "w:\\4ed\\code\\4coder_clipboard.cpp", 32, 46 }, +{ PROC_LINKS(paste_and_indent, 0), "paste_and_indent", 16, "Paste from the top of clipboard and run auto-indent on the newly pasted text.", 77, "w:\\4ed\\code\\4coder_clipboard.cpp", 32, 134 }, +{ PROC_LINKS(paste_next, 0), "paste_next", 10, "If the previous command was paste or paste_next, replaces the paste range with the next text down on the clipboard, otherwise operates as the paste command.", 156, "w:\\4ed\\code\\4coder_clipboard.cpp", 32, 85 }, +{ PROC_LINKS(paste_next_and_indent, 0), "paste_next_and_indent", 21, "Paste the next item on the clipboard and run auto-indent on the newly pasted text.", 82, "w:\\4ed\\code\\4coder_clipboard.cpp", 32, 141 }, +{ PROC_LINKS(place_in_scope, 0), "place_in_scope", 14, "Wraps the code contained in the range between cursor and mark with a new curly brace scope.", 91, "w:\\4ed\\code\\4coder_scope_commands.cpp", 37, 475 }, +{ PROC_LINKS(project_command_lister, 0), "project_command_lister", 22, "Open a lister of all commands in the currently loaded project.", 62, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1527 }, +{ PROC_LINKS(project_fkey_command, 0), "project_fkey_command", 20, "Run an 'fkey command' configured in a project.4coder file. Determines the index of the 'fkey command' by which function key or numeric key was pressed to trigger the command.", 175, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1090 }, +{ PROC_LINKS(project_go_to_root_directory, 0), "project_go_to_root_directory", 28, "Changes 4coder's hot directory to the root directory of the currently loaded project. With no loaded project nothing hapepns.", 125, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1113 }, +{ PROC_LINKS(query_replace, 0), "query_replace", 13, "Queries the user for two strings, and incrementally replaces every occurence of the first string with the second string.", 120, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1074 }, +{ PROC_LINKS(query_replace_identifier, 0), "query_replace_identifier", 24, "Queries the user for a string, and incrementally replace every occurence of the word or token found at the cursor with the specified string.", 140, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1098 }, +{ PROC_LINKS(query_replace_selection, 0), "query_replace_selection", 23, "Queries the user for a string, and incrementally replace every occurence of the string found in the selected range with the specified string.", 141, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1117 }, +{ PROC_LINKS(redo, 0), "redo", 4, "Advances forward through the undo history in the buffer containing the most recent regular edit.", 96, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1811 }, +{ PROC_LINKS(redo_this_buffer, 0), "redo_this_buffer", 16, "Advances forwards through the undo history of the current buffer.", 65, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1719 }, +{ PROC_LINKS(remap_interactive, 0), "remap_interactive", 17, "Switch to a named key binding map.", 34, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 381 }, +{ PROC_LINKS(rename_file_query, 0), "rename_file_query", 17, "Queries the user for a new name and renames the file of the current buffer, altering the buffer's name too.", 107, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1257 }, +{ PROC_LINKS(rename_parameter, 0), "rename_parameter", 16, "If the cursor is found to be on the name of a function parameter in the signature of a function definition, all occurences within the scope of the function will be replaced with a new provided string.", 200, "w:\\4ed\\code\\4coder_experiments.cpp", 34, 383 }, +{ PROC_LINKS(reopen, 0), "reopen", 6, "Reopen the current buffer from the hard drive.", 46, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1643 }, +{ PROC_LINKS(replace_all_occurrences, 0), "replace_all_occurrences", 23, "Queries the user for two strings, and replaces all occurrences of the first string with the second string in all open buffers.", 126, "w:\\4ed\\code\\4coder_experiments.cpp", 34, 780 }, +{ PROC_LINKS(replace_in_range, 0), "replace_in_range", 16, "Queries the user for two strings, and replaces all occurences of the first string in the range between the cursor and the mark with the second string.", 150, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 948 }, +{ PROC_LINKS(reverse_search, 0), "reverse_search", 14, "Begins an incremental search up through the current buffer for a user specified string.", 87, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 919 }, +{ PROC_LINKS(reverse_search_identifier, 0), "reverse_search_identifier", 25, "Begins an incremental search up through the current buffer for the word or token under the cursor.", 98, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 937 }, +{ PROC_LINKS(save, 0), "save", 4, "Saves the current buffer.", 25, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1635 }, +{ PROC_LINKS(save_all_dirty_buffers, 0), "save_all_dirty_buffers", 22, "Saves all buffers marked dirty (showing the '*' indicator).", 59, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1161 }, +{ PROC_LINKS(save_to_query, 0), "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\\4coder_base_commands.cpp", 36, 1217 }, +{ PROC_LINKS(scope_absorb_down, 0), "scope_absorb_down", 17, "If a scope is currently selected, and a statement or block statement is present below the current scope, the statement is moved into the scope.", 143, "w:\\4ed\\code\\4coder_scope_commands.cpp", 37, 716 }, +{ PROC_LINKS(search, 0), "search", 6, "Begins an incremental search down through the current buffer for a user specified string.", 89, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 912 }, +{ PROC_LINKS(search_identifier, 0), "search_identifier", 17, "Begins an incremental search down through the current buffer for the word or token under the cursor.", 100, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 926 }, +{ PROC_LINKS(seek_alphanumeric_left, 0), "seek_alphanumeric_left", 22, "Seek left for boundary between alphanumeric characters and non-alphanumeric characters.", 87, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1195 }, +{ PROC_LINKS(seek_alphanumeric_or_camel_left, 0), "seek_alphanumeric_or_camel_left", 31, "Seek left for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 106, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1207 }, +{ PROC_LINKS(seek_alphanumeric_or_camel_right, 0), "seek_alphanumeric_or_camel_right", 32, "Seek right for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 107, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1201 }, +{ PROC_LINKS(seek_alphanumeric_right, 0), "seek_alphanumeric_right", 23, "Seek right for boundary between alphanumeric characters and non-alphanumeric characters.", 88, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1189 }, +{ PROC_LINKS(seek_beginning_of_line, 0), "seek_beginning_of_line", 22, "Seeks the cursor to the beginning of the visual line.", 53, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1083 }, +{ PROC_LINKS(seek_beginning_of_textual_line, 0), "seek_beginning_of_textual_line", 30, "Seeks the cursor to the beginning of the line across all text.", 62, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1061 }, +{ PROC_LINKS(seek_end_of_line, 0), "seek_end_of_line", 16, "Seeks the cursor to the end of the visual line.", 47, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1095 }, +{ PROC_LINKS(seek_end_of_textual_line, 0), "seek_end_of_textual_line", 24, "Seeks the cursor to the end of the line across all text.", 56, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1072 }, +{ PROC_LINKS(seek_token_left, 0), "seek_token_left", 15, "Seek left for the next beginning of a token.", 44, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1171 }, +{ PROC_LINKS(seek_token_right, 0), "seek_token_right", 16, "Seek right for the next end of a token.", 39, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1165 }, +{ PROC_LINKS(seek_white_or_token_left, 0), "seek_white_or_token_left", 24, "Seek left for the next end of a token or boundary between whitespace and non-whitespace.", 88, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1183 }, +{ PROC_LINKS(seek_white_or_token_right, 0), "seek_white_or_token_right", 25, "Seek right for the next end of a token or boundary between whitespace and non-whitespace.", 89, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1177 }, +{ PROC_LINKS(seek_whitespace_down, 0), "seek_whitespace_down", 20, "Seeks the cursor down to the next blank line.", 45, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1050 }, +{ PROC_LINKS(seek_whitespace_down_end_line, 0), "seek_whitespace_down_end_line", 29, "Seeks the cursor down to the next blank line and places it at the end of the line.", 82, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1119 }, +{ PROC_LINKS(seek_whitespace_left, 0), "seek_whitespace_left", 20, "Seek left for the next boundary between whitespace and non-whitespace.", 70, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1159 }, +{ PROC_LINKS(seek_whitespace_right, 0), "seek_whitespace_right", 21, "Seek right for the next boundary between whitespace and non-whitespace.", 71, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1153 }, +{ PROC_LINKS(seek_whitespace_up, 0), "seek_whitespace_up", 18, "Seeks the cursor up to the next blank line.", 43, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1039 }, +{ PROC_LINKS(seek_whitespace_up_end_line, 0), "seek_whitespace_up_end_line", 27, "Seeks the cursor up to the next blank line and places it at the end of the line.", 80, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1107 }, +{ PROC_LINKS(select_all, 0), "select_all", 10, "Puts the cursor at the top of the file, and the mark at the bottom of the file.", 79, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 389 }, +{ PROC_LINKS(select_next_scope_absolute, 0), "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\\4coder_scope_commands.cpp", 37, 357 }, +{ PROC_LINKS(select_prev_scope_absolute, 0), "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\\4coder_scope_commands.cpp", 37, 376 }, +{ PROC_LINKS(select_surrounding_scope, 0), "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\\4coder_scope_commands.cpp", 37, 342 }, +{ PROC_LINKS(set_bindings_choose, 0), "set_bindings_choose", 19, "Remap keybindings using the 'choose' mapping rule.", 50, "w:\\4ed\\code\\4coder_remapping_commands.cpp", 41, 47 }, +{ PROC_LINKS(set_bindings_default, 0), "set_bindings_default", 20, "Remap keybindings using the 'default' mapping rule.", 51, "w:\\4ed\\code\\4coder_remapping_commands.cpp", 41, 61 }, +{ PROC_LINKS(set_bindings_mac_default, 0), "set_bindings_mac_default", 24, "Remap keybindings using the 'mac-default' mapping rule.", 55, "w:\\4ed\\code\\4coder_remapping_commands.cpp", 41, 75 }, +{ PROC_LINKS(set_mark, 0), "set_mark", 8, "Sets the mark to the current position of the cursor.", 52, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 121 }, +{ PROC_LINKS(set_mode_to_notepad_like, 0), "set_mode_to_notepad_like", 24, "Sets the edit mode to Notepad like.", 35, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 349 }, +{ PROC_LINKS(set_mode_to_original, 0), "set_mode_to_original", 20, "Sets the edit mode to 4coder original.", 38, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 343 }, +{ PROC_LINKS(setup_build_bat, 0), "setup_build_bat", 15, "Queries the user for several configuration options and initializes a new build batch script.", 92, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1498 }, +{ PROC_LINKS(setup_build_bat_and_sh, 0), "setup_build_bat_and_sh", 22, "Queries the user for several configuration options and initializes a new build batch script.", 92, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1510 }, +{ PROC_LINKS(setup_build_sh, 0), "setup_build_sh", 14, "Queries the user for several configuration options and initializes a new build shell script.", 92, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1504 }, +{ PROC_LINKS(setup_new_project, 0), "setup_new_project", 17, "Queries the user for several configuration options and initializes a new 4coder project with build scripts for every OS.", 120, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1491 }, +{ PROC_LINKS(show_filebar, 0), "show_filebar", 12, "Sets the current view to show it's filebar.", 43, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 541 }, +{ PROC_LINKS(show_scrollbar, 0), "show_scrollbar", 14, "Sets the current view to show it's scrollbar.", 45, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 527 }, +{ PROC_LINKS(snipe_token_or_word, 0), "snipe_token_or_word", 19, "Delete a single, whole token on or to the left of the cursor and post it to the clipboard.", 90, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1227 }, +{ PROC_LINKS(snipe_token_or_word_right, 0), "snipe_token_or_word_right", 25, "Delete a single, whole token on or to the right of the cursor and post it to the clipboard.", 91, "w:\\4ed\\code\\4coder_seek.cpp", 27, 1233 }, +{ PROC_LINKS(snippet_lister, 0), "snippet_lister", 14, "Opens a snippet lister for inserting whole pre-written snippets of text.", 72, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 251 }, +{ PROC_LINKS(suppress_mouse, 0), "suppress_mouse", 14, "Hides the mouse and causes all mosue input (clicks, position, wheel) to be ignored.", 83, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 325 }, +{ PROC_LINKS(swap_buffers_between_panels, 0), "swap_buffers_between_panels", 27, "Set the other non-active panel to view the buffer that the active panel views, and switch to that panel.", 104, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1595 }, +{ PROC_LINKS(to_lowercase, 0), "to_lowercase", 12, "Converts all ascii text in the range between the cursor and the mark to lowercase.", 82, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 421 }, +{ PROC_LINKS(to_uppercase, 0), "to_uppercase", 12, "Converts all ascii text in the range between the cursor and the mark to uppercase.", 82, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 401 }, +{ PROC_LINKS(toggle_filebar, 0), "toggle_filebar", 14, "Toggles the visibility status of the current view's filebar.", 60, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 555 }, +{ PROC_LINKS(toggle_fps_meter, 0), "toggle_fps_meter", 16, "Toggles the visibility of the FPS performance meter", 51, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 573 }, +{ PROC_LINKS(toggle_fullscreen, 0), "toggle_fullscreen", 17, "Toggle fullscreen mode on or off. The change(s) do not take effect until the next frame.", 89, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 373 }, +{ PROC_LINKS(toggle_highlight_enclosing_scopes, 0), "toggle_highlight_enclosing_scopes", 33, "In code files scopes surrounding the cursor are highlighted with distinguishing colors.", 87, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 361 }, +{ PROC_LINKS(toggle_highlight_line_at_cursor, 0), "toggle_highlight_line_at_cursor", 31, "Toggles the line highlight at the cursor.", 41, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 355 }, +{ PROC_LINKS(toggle_line_numbers, 0), "toggle_line_numbers", 19, "Toggles the left margin line numbers.", 37, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 660 }, +{ PROC_LINKS(toggle_line_wrap, 0), "toggle_line_wrap", 16, "Toggles the current buffer's line wrapping status.", 50, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 564 }, +{ PROC_LINKS(toggle_mouse, 0), "toggle_mouse", 12, "Toggles the mouse suppression mode, see suppress_mouse and allow_mouse.", 71, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 337 }, +{ PROC_LINKS(toggle_paren_matching_helper, 0), "toggle_paren_matching_helper", 28, "In code files matching parentheses pairs are colored with distinguishing colors.", 80, "w:\\4ed\\code\\4coder_default_framework.cpp", 40, 367 }, +{ PROC_LINKS(toggle_show_whitespace, 0), "toggle_show_whitespace", 22, "Toggles the current buffer's whitespace visibility status.", 58, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 653 }, +{ PROC_LINKS(toggle_virtual_whitespace, 0), "toggle_virtual_whitespace", 25, "Toggles the current buffer's virtual whitespace status.", 55, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 642 }, +{ PROC_LINKS(uncomment_line, 0), "uncomment_line", 14, "If present, delete '//' at the beginning of the line after leading whitespace.", 78, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 148 }, +{ PROC_LINKS(undo, 0), "undo", 4, "Advances backward through the undo history in the buffer containing the most recent regular edit.", 97, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1735 }, +{ PROC_LINKS(undo_this_buffer, 0), "undo_this_buffer", 16, "Advances backwards through the undo history of the current buffer.", 66, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1705 }, +{ PROC_LINKS(view_buffer_other_panel, 0), "view_buffer_other_panel", 23, "Set the other non-active panel to view the buffer that the active panel views, and switch to that panel.", 104, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1585 }, +{ PROC_LINKS(view_jump_list_with_lister, 0), "view_jump_list_with_lister", 26, "When executed on a buffer with jumps, creates a persistent lister for all the jumps", 83, "w:\\4ed\\code\\4coder_jump_lister.cpp", 34, 106 }, +{ PROC_LINKS(word_complete, 0), "word_complete", 13, "Iteratively tries completing the word to the left of the cursor with other words in open buffers that have the same prefix string.", 130, "w:\\4ed\\code\\4coder_search.cpp", 29, 900 }, +{ PROC_LINKS(write_and_auto_tab, 0), "write_and_auto_tab", 18, "Inserts a character and auto-indents the line on which the cursor sits.", 71, "w:\\4ed\\code\\4coder_auto_indent.cpp", 34, 644 }, +{ PROC_LINKS(write_block, 0), "write_block", 11, "At the cursor, insert a block comment.", 38, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 103 }, +{ PROC_LINKS(write_character, 0), "write_character", 15, "Inserts whatever character was used to trigger this command.", 60, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 67 }, +{ PROC_LINKS(write_explicit_enum_flags, 0), "write_explicit_enum_flags", 25, "If the cursor is found to be on the '{' of an enum definition, the values of the enum will be filled in to give each a unique power of 2 value, starting from 1. Existing values are overwritten.", 194, "w:\\4ed\\code\\4coder_experiments.cpp", 34, 705 }, +{ PROC_LINKS(write_explicit_enum_values, 0), "write_explicit_enum_values", 26, "If the cursor is found to be on the '{' of an enum definition, the values of the enum will be filled in sequentially starting from zero. Existing values are overwritten.", 170, "w:\\4ed\\code\\4coder_experiments.cpp", 34, 699 }, +{ PROC_LINKS(write_hack, 0), "write_hack", 10, "At the cursor, insert a '// HACK' comment, includes user name if it was specified in config.4coder.", 99, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 91 }, +{ PROC_LINKS(write_note, 0), "write_note", 10, "At the cursor, insert a '// NOTE' comment, includes user name if it was specified in config.4coder.", 99, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 97 }, +{ PROC_LINKS(write_todo, 0), "write_todo", 10, "At the cursor, insert a '// TODO' comment, includes user name if it was specified in config.4coder.", 99, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 85 }, +{ PROC_LINKS(write_underscore, 0), "write_underscore", 16, "Inserts an underscore.", 22, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 76 }, +{ PROC_LINKS(write_zero_struct, 0), "write_zero_struct", 17, "At the cursor, insert a ' = {};'.", 33, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 109 }, }; static int32_t fcoder_metacmd_ID_allow_mouse = 0; static int32_t fcoder_metacmd_ID_auto_tab_line_at_cursor = 1; diff --git a/4coder_helper.cpp b/4coder_helper.cpp index 2ab9dc7a..9e521995 100644 --- a/4coder_helper.cpp +++ b/4coder_helper.cpp @@ -527,11 +527,12 @@ buffer_identifier(Buffer_ID id){ static void adjust_all_buffer_wrap_widths(Application_Links *app, i32 wrap_width, i32 min_base_width){ - for (Buffer_Summary buffer = get_buffer_first(app, AccessAll); - buffer.exists; - get_buffer_next(app, &buffer, AccessAll)){ - buffer_set_setting(app, &buffer, BufferSetting_WrapPosition, wrap_width); - buffer_set_setting(app, &buffer, BufferSetting_MinimumBaseWrapPosition, min_base_width); + Buffer_ID buffer = 0; + for (get_buffer_next(app, 0, AccessAll, &buffer); + buffer != 0; + get_buffer_next(app, buffer, AccessAll, &buffer)){ + buffer_set_setting(app, buffer, BufferSetting_WrapPosition, wrap_width); + buffer_set_setting(app, buffer, BufferSetting_MinimumBaseWrapPosition, min_base_width); } } @@ -584,38 +585,26 @@ static View_Summary get_first_view_with_buffer(Application_Links *app, i32 buffer_id){ View_Summary result = {}; View_Summary test = {}; - if (buffer_id != 0){ - u32 access = AccessAll; - for(test = get_view_first(app, access); - test.exists; - get_view_next(app, &test, access)){ - - Buffer_Summary buffer = get_buffer(app, test.buffer_id, access); - - if(buffer.buffer_id == buffer_id){ + for (test = get_view_first(app, AccessAll); + test.exists; + get_view_next(app, &test, AccessAll)){ + if (test.buffer_id == buffer_id){ result = test; break; } } } - return(result); } static b32 -open_file(Application_Links *app, Buffer_Summary *buffer_out, - char *filename, i32 filename_len, b32 background, b32 never_new){ +open_file(Application_Links *app, Buffer_ID *buffer_out, char *filename, i32 filename_len, b32 background, b32 never_new){ b32 result = false; - Buffer_Summary buffer = get_buffer_by_name(app, filename, filename_len, AccessProtected|AccessHidden); - - if (buffer.exists){ - if (buffer_out){ - *buffer_out = buffer; - } - result = true; - } - else{ + Buffer_ID buffer = 0; + get_buffer_by_name(app, filename, filename_len, AccessProtected); + b32 exists = buffer_exists(app, buffer); + if (!exists){ Buffer_Create_Flag flags = 0; if (background){ flags |= BufferCreate_Background; @@ -623,15 +612,15 @@ open_file(Application_Links *app, Buffer_Summary *buffer_out, if (never_new){ flags |= BufferCreate_NeverNew; } - buffer = create_buffer(app, filename, filename_len, flags); - if (buffer.exists){ - if (buffer_out != 0){ - *buffer_out = buffer; - } - result = true; - } + create_buffer(app, make_string(filename, filename_len), flags, &buffer); + exists = buffer_exists(app, buffer); + } + if (exists){ + if (buffer_out != 0){ + *buffer_out = buffer; + } + result = true; } - return(result); } @@ -642,11 +631,10 @@ buffer_identifier_to_id(Application_Links *app, Buffer_Identifier identifier){ id = identifier.id; } else{ - Buffer_Summary buffer = get_buffer_by_name(app, identifier.name, identifier.name_len, AccessAll); - id = buffer.buffer_id; + String name = make_string(identifier.name, identifier.name_len); + get_buffer_by_name(app, name, AccessAll, &id); if (id == 0){ - buffer = get_buffer_by_file_name(app, identifier.name, identifier.name_len, AccessAll); - id = buffer.buffer_id; + get_buffer_by_file_name(app, name, AccessAll, &id); } } return(id); @@ -671,9 +659,9 @@ static b32 view_open_file(Application_Links *app, View_Summary *view, char *filename, i32 filename_len, b32 never_new){ b32 result = false; if (view != 0){ - Buffer_Summary buffer = {}; + Buffer_ID buffer = {}; if (open_file(app, &buffer, filename, filename_len, false, never_new)){ - view_set_buffer(app, view, buffer.buffer_id, 0); + view_set_buffer(app, view, buffer, 0); result = true; } } @@ -921,7 +909,7 @@ buffer_get_line_end(Application_Links *app, Buffer_ID buffer_id, i32 line){ } static i32 -buffer_get_line_number(Application_Links *app, Buffer_Summary *buffer, i32 pos){ +buffer_get_line_number(Application_Links *app, Buffer_ID buffer, i32 pos){ Partial_Cursor partial_cursor = {}; buffer_compute_cursor(app, buffer, seek_pos(pos), &partial_cursor); return(partial_cursor.line); @@ -1145,10 +1133,9 @@ backward_stream_tokens(Stream_Tokens_DEP *stream){ //////////////////////////////// static Token_Range -buffer_get_token_range(Application_Links *app, Buffer_ID buffer_id){ +buffer_get_token_range(Application_Links *app, Buffer_ID buffer){ Token_Range range = {}; - Buffer_Summary buffer = get_buffer(app, buffer_id, AccessAll); - buffer_get_token_range(app, &buffer, &range.first, &range.one_past_last); + buffer_get_token_range(app, buffer, &range.first, &range.one_past_last); return(range); } @@ -1244,7 +1231,7 @@ token_iterator_goto_prev_raw(Token_Iterator *iterator){ } static String -token_get_lexeme(Application_Links *app, Buffer_Summary *buffer, Cpp_Token *token, char *out_buffer, i32 out_buffer_size){ +token_get_lexeme(Application_Links *app, Buffer_ID buffer, Cpp_Token *token, char *out_buffer, i32 out_buffer_size){ String result = {}; if (out_buffer_size > 1){ i32 read_size = token->size; @@ -1260,7 +1247,7 @@ token_get_lexeme(Application_Links *app, Buffer_Summary *buffer, Cpp_Token *toke } static String -token_get_lexeme(Application_Links *app, Partition *part, Buffer_Summary *buffer, Cpp_Token *token){ +token_get_lexeme(Application_Links *app, Partition *part, Buffer_ID buffer, Cpp_Token *token){ String result = {}; Temp_Memory restore_point = begin_temp_memory(part); char *s = push_array(part, char, token->size); @@ -1289,21 +1276,23 @@ get_query_string(Application_Links *app, char *query_str, char *string_space, i3 static String get_string_in_view_range(Application_Links *app, Partition *arena, View_Summary *view){ String str = {}; - Buffer_Summary buffer = get_buffer(app, view->buffer_id, AccessProtected); - if (!buffer.exists) return(str); - Range range = get_view_range(view); - i32 query_length = range.max - range.min; - if (query_length != 0){ - char *query_space = push_array(arena, char, query_length); - if (buffer_read_range(app, &buffer, range.min, range.max, query_space)){ - str = make_string(query_space, query_length); + Buffer_ID buffer = 0; + view_get_buffer(app, view->view_id, AccessProtected, &buffer); + if (buffer_exists(app, buffer)){ + Range range = get_view_range(view); + i32 query_length = range.max - range.min; + if (query_length != 0){ + char *query_space = push_array(arena, char, query_length); + if (buffer_read_range(app, buffer, range.min, range.max, query_space)){ + str = make_string(query_space, query_length); + } } } return(str); } static String -get_token_or_word_under_pos(Application_Links *app, Buffer_Summary *buffer, i32 pos, char *space, i32 capacity){ +get_token_or_word_under_pos(Application_Links *app, Buffer_ID buffer, i32 pos, char *space, i32 capacity){ String result = {}; Cpp_Get_Token_Result get_result = {}; b32 success = buffer_get_token_index(app, buffer, pos, &get_result); @@ -1663,5 +1652,34 @@ draw_margin(Application_Links *app, f32_Rect outer, f32_Rect inner, int_color co draw_rectangle(app, f32R(inner.x1, inner.y0, outer.x1, inner.y1), color); } +//////////////////////////////// + +static String +buffer_push_base_buffer_name(Application_Links *app, Buffer_ID buffer, Arena *arena){ + String result = {}; + buffer_get_base_buffer_name(app, buffer, 0, &result.memory_size); + result.str = push_array(arena, char, result.memory_size); + buffer_get_base_buffer_name(app, buffer, &result, 0); + return(result); +} + +static String +buffer_push_unique_buffer_name(Application_Links *app, Buffer_ID buffer, Arena *arena){ + String result = {}; + buffer_get_unique_buffer_name(app, buffer, 0, &result.memory_size); + result.str = push_array(arena, char, result.memory_size); + buffer_get_unique_buffer_name(app, buffer, &result, 0); + return(result); +} + +static String +buffer_push_file_name(Application_Links *app, Buffer_ID buffer, Arena *arena){ + String result = {}; + buffer_get_file_name(app, buffer, 0, &result.memory_size); + result.str = push_array(arena, char, result.memory_size); + buffer_get_file_name(app, buffer, &result, 0); + return(result); +} + // BOTTOM diff --git a/4coder_jump_direct.cpp b/4coder_jump_direct.cpp index 290652c1..f0088ac3 100644 --- a/4coder_jump_direct.cpp +++ b/4coder_jump_direct.cpp @@ -15,10 +15,10 @@ CUSTOM_DOC("If the cursor is found to be on a jump location, parses the jump loc if (jump.success){ change_active_panel(app); View_Summary target_view = get_active_view(app, AccessAll); - Buffer_Summary buffer = {}; + Buffer_ID buffer = {}; if (get_jump_buffer(app, &buffer, &jump.location)){ - switch_to_existing_view(app, &target_view, &buffer); - jump_to_location(app, &target_view, &buffer, jump.location); + switch_to_existing_view(app, &target_view, buffer); + jump_to_location(app, &target_view, buffer, jump.location); } } @@ -34,9 +34,9 @@ CUSTOM_DOC("If the cursor is found to be on a jump location, parses the jump loc Parsed_Jump jump = parse_jump_from_buffer_line(app, &global_part, view.buffer_id, view.cursor.line, false); if (jump.success){ View_Summary target_view = view; - Buffer_Summary buffer = {}; + Buffer_ID buffer = {}; if (get_jump_buffer(app, &buffer, &jump.location)){ - jump_to_location(app, &target_view, &buffer, jump.location); + jump_to_location(app, &target_view, buffer, jump.location); } } diff --git a/4coder_jump_lister.cpp b/4coder_jump_lister.cpp index d8962195..25a724b6 100644 --- a/4coder_jump_lister.cpp +++ b/4coder_jump_lister.cpp @@ -50,10 +50,10 @@ activate_jump(Application_Links *app, Partition *scratch, Heap *heap, ID_Pos_Jump_Location location = {}; if (get_jump_from_list(app, list, list_index, &location)){ - Buffer_Summary buffer = {}; + Buffer_ID buffer = {}; if (get_jump_buffer(app, &buffer, &location)){ set_active_view(app, &target_view); - jump_to_location(app, &target_view, &buffer, location); + jump_to_location(app, &target_view, buffer, location); } } diff --git a/4coder_jump_sticky.cpp b/4coder_jump_sticky.cpp index 54c4477a..4bc55bba 100644 --- a/4coder_jump_sticky.cpp +++ b/4coder_jump_sticky.cpp @@ -55,15 +55,15 @@ parse_buffer_to_jump_array(Application_Links *app, Partition *arena, Buffer_Summ if (read_line(app, arena, buffer.buffer_id, line, &line_str)){ Parsed_Jump parsed_jump = parse_jump_location(line_str); if (parsed_jump.success){ - Buffer_Summary jump_buffer = {}; - if (open_file(app, &jump_buffer, parsed_jump.location.file.str, parsed_jump.location.file.size, false, true) && jump_buffer.exists){ - Partial_Cursor cursor = {}; - if (buffer_compute_cursor(app, &jump_buffer, - seek_line_char(parsed_jump.location.line, parsed_jump.location.column), - &cursor)){ - out_buffer_id = jump_buffer.buffer_id; - out_pos = cursor.pos; - output_jump = true; + Buffer_ID jump_buffer = {}; + if (open_file(app, &jump_buffer, parsed_jump.location.file.str, parsed_jump.location.file.size, false, true)){ + if (buffer_exists(app, jump_buffer)){ + Partial_Cursor cursor = {}; + if (buffer_compute_cursor(app, jump_buffer, seek_line_char(parsed_jump.location.line, parsed_jump.location.column), &cursor)){ + out_buffer_id = jump_buffer; + out_pos = cursor.pos; + output_jump = true; + } } } } @@ -355,12 +355,12 @@ CUSTOM_DOC("If the cursor is found to be on a jump location, parses the jump loc if (list_index >= 0){ ID_Pos_Jump_Location location = {}; if (get_jump_from_list(app, list, list_index, &location)){ - Buffer_Summary buffer = {}; + Buffer_ID buffer = {}; if (get_jump_buffer(app, &buffer, &location)){ change_active_panel(app); View_Summary target_view = get_active_view(app, AccessAll); - switch_to_existing_view(app, &target_view, &buffer); - jump_to_location(app, &target_view, &buffer, location); + switch_to_existing_view(app, &target_view, buffer); + jump_to_location(app, &target_view, buffer, location); } } } @@ -382,10 +382,10 @@ CUSTOM_DOC("If the cursor is found to be on a jump location, parses the jump loc if (list_index >= 0){ ID_Pos_Jump_Location location = {}; if (get_jump_from_list(app, list, list_index, &location)){ - Buffer_Summary buffer = {}; + Buffer_ID buffer = {}; if (get_jump_buffer(app, &buffer, &location)){ View_Summary target_view = view; - jump_to_location(app, &target_view, &buffer, location); + jump_to_location(app, &target_view, buffer, location); } } } @@ -395,15 +395,15 @@ CUSTOM_DOC("If the cursor is found to be on a jump location, parses the jump loc static void goto_jump_in_order(Application_Links *app, Marker_List *list, View_Summary *jump_view, ID_Pos_Jump_Location location){ - Buffer_Summary buffer = {}; + Buffer_ID buffer = {}; if (get_jump_buffer(app, &buffer, &location)){ View_Summary target_view = get_active_view(app, AccessAll); if (target_view.view_id == jump_view->view_id){ change_active_panel(app); target_view = get_active_view(app, AccessAll); } - switch_to_existing_view(app, &target_view, &buffer); - jump_to_location(app, &target_view, &buffer, location); + switch_to_existing_view(app, &target_view, buffer); + jump_to_location(app, &target_view, buffer, location); prev_location.buffer_id = location.buffer_id; prev_location.line = location.pos; prev_location.column = 0; @@ -553,9 +553,9 @@ CUSTOM_DOC("If a buffer containing jump locations has been locked in, goes to th i32 list_index = 0; ID_Pos_Jump_Location location = {}; if (get_jump_from_list(app, jump_state.list, list_index, &location)){ - Buffer_Summary buffer = {}; + Buffer_ID buffer = {}; if (get_jump_buffer(app, &buffer, &location)){ - jump_to_location(app, &jump_state.view, &buffer, location); + jump_to_location(app, &jump_state.view, buffer, location); } } } diff --git a/4coder_jumping.cpp b/4coder_jumping.cpp index 6092118d..f5ce76fa 100644 --- a/4coder_jumping.cpp +++ b/4coder_jumping.cpp @@ -210,25 +210,25 @@ parse_jump_from_buffer_line(Application_Links *app, Partition *arena, Buffer_ID //////////////////////////////// static b32 -get_jump_buffer(Application_Links *app, Buffer_Summary *buffer, Name_Line_Column_Location *location){ +get_jump_buffer(Application_Links *app, Buffer_ID *buffer, Name_Line_Column_Location *location){ return(open_file(app, buffer, location->file.str, location->file.size, false, true)); } static b32 -get_jump_buffer(Application_Links *app, Buffer_Summary *buffer, ID_Pos_Jump_Location *location, Access_Flag access){ - *buffer = get_buffer(app, location->buffer_id, access); - return((b32)buffer->exists); +get_jump_buffer(Application_Links *app, Buffer_ID *buffer, ID_Pos_Jump_Location *location, Access_Flag access){ + *buffer = location->buffer_id; + return(buffer_exists(app, *buffer)); } static b32 -get_jump_buffer(Application_Links *app, Buffer_Summary *buffer, ID_Pos_Jump_Location *location){ +get_jump_buffer(Application_Links *app, Buffer_ID *buffer, ID_Pos_Jump_Location *location){ return(get_jump_buffer(app, buffer, location, AccessAll)); } static void -switch_to_existing_view(Application_Links *app, View_Summary *view, Buffer_Summary *buffer){ - if (!(view->exists && view->buffer_id == buffer->buffer_id)){ - View_Summary existing_view = get_first_view_with_buffer(app, buffer->buffer_id); +switch_to_existing_view(Application_Links *app, View_Summary *view, Buffer_ID buffer){ + if (!view->exists || view->buffer_id != buffer){ + View_Summary existing_view = get_first_view_with_buffer(app, buffer); if (existing_view.exists){ *view = existing_view; } @@ -236,15 +236,15 @@ switch_to_existing_view(Application_Links *app, View_Summary *view, Buffer_Summa } static void -set_view_to_location(Application_Links *app, View_Summary *view, Buffer_Summary *buffer, Buffer_Seek seek){ - if (view->buffer_id != buffer->buffer_id){ - view_set_buffer(app, view, buffer->buffer_id, 0); +set_view_to_location(Application_Links *app, View_Summary *view, Buffer_ID buffer, Buffer_Seek seek){ + if (view->buffer_id != buffer){ + view_set_buffer(app, view, buffer, 0); } view_set_cursor(app, view, seek, true); } static void -jump_to_location(Application_Links *app, View_Summary *view, Buffer_Summary *buffer, Name_Line_Column_Location location){ +jump_to_location(Application_Links *app, View_Summary *view, Buffer_ID buffer, Name_Line_Column_Location location){ set_active_view(app, view); set_view_to_location(app, view, buffer, seek_line_char(location.line, location.column)); if (auto_center_after_jumps){ @@ -253,7 +253,7 @@ jump_to_location(Application_Links *app, View_Summary *view, Buffer_Summary *buf } static void -jump_to_location(Application_Links *app, View_Summary *view, Buffer_Summary *buffer, ID_Pos_Jump_Location location){ +jump_to_location(Application_Links *app, View_Summary *view, Buffer_ID buffer, ID_Pos_Jump_Location location){ set_active_view(app, view); set_view_to_location(app, view, buffer, seek_pos(location.pos)); if (auto_center_after_jumps){ @@ -367,15 +367,15 @@ seek_jump(Application_Links *app, Partition *part, b32 skip_repeats, b32 skip_su Name_Line_Column_Location location = {}; if (advance_cursor_in_jump_view(app, &global_part, &view, skip_repeats, skip_sub_errors, direction, &location)){ - Buffer_Summary buffer = {}; + Buffer_ID buffer = {}; if (get_jump_buffer(app, &buffer, &location)){ View_Summary target_view = get_active_view(app, AccessAll); if (target_view.view_id == view.view_id){ change_active_panel(app); target_view = get_active_view(app, AccessAll); } - switch_to_existing_view(app, &target_view, &buffer); - jump_to_location(app, &target_view, &buffer, location); + switch_to_existing_view(app, &target_view, buffer); + jump_to_location(app, &target_view, buffer, location); result = true; } } diff --git a/4coder_scope_commands.cpp b/4coder_scope_commands.cpp index 32358541..deba813d 100644 --- a/4coder_scope_commands.cpp +++ b/4coder_scope_commands.cpp @@ -40,12 +40,10 @@ find_scope_get_token_type(u32 flags, Cpp_Token_Type token_type){ } static b32 -find_scope_top(Application_Links *app, Buffer_Summary *buffer, i32 start_pos, u32 flags, i32 *end_pos_out){ +find_scope_top(Application_Links *app, Buffer_ID buffer, i32 start_pos, u32 flags, i32 *end_pos_out){ Cpp_Get_Token_Result get_result = {}; - b32 success = false; i32 position = 0; - if (buffer_get_token_index(app, buffer, start_pos, &get_result)){ i32 token_index = get_result.token_index; if (flags & FindScope_Parent){ @@ -54,13 +52,10 @@ find_scope_top(Application_Links *app, Buffer_Summary *buffer, i32 start_pos, u3 ++token_index; } } - if (token_index >= 0){ - Token_Range token_range = buffer_get_token_range(app, buffer->buffer_id); - + Token_Range token_range = buffer_get_token_range(app, buffer); if (token_range.first != 0){ Token_Iterator token_it = make_token_iterator(token_range, token_index); - i32 nest_level = 0; for (Cpp_Token *token = token_iterator_current(&token_it); token != 0; @@ -90,19 +85,16 @@ find_scope_top(Application_Links *app, Buffer_Summary *buffer, i32 start_pos, u3 } } } - finished:; *end_pos_out = position; return(success); } static b32 -find_scope_bottom(Application_Links *app, Buffer_Summary *buffer, i32 start_pos, u32 flags, i32 *end_pos_out){ +find_scope_bottom(Application_Links *app, Buffer_ID buffer, i32 start_pos, u32 flags, i32 *end_pos_out){ Cpp_Get_Token_Result get_result = {}; - b32 success = false; i32 position = 0; - if (buffer_get_token_index(app, buffer, start_pos, &get_result)){ i32 token_index = get_result.token_index + 1; if (flags & FindScope_Parent){ @@ -111,13 +103,10 @@ find_scope_bottom(Application_Links *app, Buffer_Summary *buffer, i32 start_pos, ++token_index; } } - if (token_index >= 0){ - Token_Range token_range = buffer_get_token_range(app, buffer->buffer_id); - + Token_Range token_range = buffer_get_token_range(app, buffer); if (token_range.first != 0){ Token_Iterator token_it = make_token_iterator(token_range, token_index); - i32 nest_level = 0; for (Cpp_Token *token = token_iterator_current(&token_it); token != 0; @@ -147,28 +136,22 @@ find_scope_bottom(Application_Links *app, Buffer_Summary *buffer, i32 start_pos, } } } - finished:; *end_pos_out = position; return(success); } static b32 -find_next_scope(Application_Links *app, Buffer_Summary *buffer, i32 start_pos, u32 flags, i32 *end_pos_out){ +find_next_scope(Application_Links *app, Buffer_ID buffer, i32 start_pos, u32 flags, i32 *end_pos_out){ Cpp_Get_Token_Result get_result = {}; - b32 success = 0; i32 position = 0; - if (buffer_get_token_index(app, buffer, start_pos, &get_result)){ - i32 token_index = get_result.token_index+1; - + i32 token_index = get_result.token_index + 1; if (token_index >= 0){ - Token_Range token_range = buffer_get_token_range(app, buffer->buffer_id); - + Token_Range token_range = buffer_get_token_range(app, buffer); if (token_range.first != 0){ Token_Iterator token_it = make_token_iterator(token_range, token_index); - if ((flags & FindScope_NextSibling) != 0){ i32 nest_level = 1; for (Cpp_Token *token = token_iterator_current(&token_it); @@ -201,7 +184,6 @@ find_next_scope(Application_Links *app, Buffer_Summary *buffer, i32 start_pos, u } } } - else{ for (Cpp_Token *token = token_iterator_current(&token_it); token != 0; @@ -217,32 +199,25 @@ find_next_scope(Application_Links *app, Buffer_Summary *buffer, i32 start_pos, u } } } - } } } - finished:; *end_pos_out = position; return(success); } static b32 -find_prev_scope(Application_Links *app, Buffer_Summary *buffer, i32 start_pos, u32 flags, i32 *end_pos_out){ +find_prev_scope(Application_Links *app, Buffer_ID buffer, i32 start_pos, u32 flags, i32 *end_pos_out){ Cpp_Get_Token_Result get_result = {}; - b32 success = false; i32 position = 0; - if (buffer_get_token_index(app, buffer, start_pos, &get_result)){ i32 token_index = get_result.token_index-1; - if (token_index >= 0){ - Token_Range token_range = buffer_get_token_range(app, buffer->buffer_id); - + Token_Range token_range = buffer_get_token_range(app, buffer); if (token_range.first != 0){ Token_Iterator token_it = make_token_iterator(token_range, token_index); - if (flags & FindScope_NextSibling){ i32 nest_level = -1; for (Cpp_Token *token = token_iterator_current(&token_it); @@ -275,7 +250,6 @@ find_prev_scope(Application_Links *app, Buffer_Summary *buffer, i32 start_pos, u } } } - else{ for (Cpp_Token *token = token_iterator_current(&token_it); token != 0; @@ -291,31 +265,25 @@ find_prev_scope(Application_Links *app, Buffer_Summary *buffer, i32 start_pos, u } } } - } } } - finished:; *end_pos_out = position; return(success); } static b32 -find_scope_range(Application_Links *app, Buffer_Summary *buffer, i32 start_pos, Range *range_out, - u32 flags){ +find_scope_range(Application_Links *app, Buffer_ID buffer, i32 start_pos, Range *range_out, u32 flags){ + b32 result = false; Range range = {}; - if (find_scope_top(app, buffer, start_pos, - FindScope_Parent|flags, - &range.start)){ - if (find_scope_bottom(app, buffer, start_pos, - FindScope_Parent|FindScope_EndOfToken|flags, - &range.end)){ + if (find_scope_top(app, buffer, start_pos, FindScope_Parent|flags, &range.start)){ + if (find_scope_bottom(app, buffer, start_pos, FindScope_Parent|FindScope_EndOfToken|flags, &range.end)){ *range_out = range; - return(true); + result = true; } } - return(false); + return(result); } static void @@ -374,12 +342,11 @@ view_set_to_region(Application_Links *app, View_Summary *view, i32 major_pos, i3 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 '}'.") { - u32 access = AccessProtected; - View_Summary view = get_active_view(app, access); - Buffer_Summary buffer = get_buffer(app, view.buffer_id, access); - + View_Summary view = get_active_view(app, AccessProtected); + Buffer_ID buffer = 0; + view_get_buffer(app, view.view_id, AccessProtected, &buffer); Range range = {}; - if (find_scope_range(app, &buffer, view.cursor.pos, &range, FindScope_Brace)){ + if (find_scope_range(app, buffer, view.cursor.pos, &range, FindScope_Brace)){ view_set_cursor(app, &view, seek_pos(range.first), true); view_set_mark(app, &view, seek_pos(range.end)); view_set_to_region(app, &view, range.first, range.end, scope_center_threshold); @@ -390,15 +357,14 @@ CUSTOM_DOC("Finds the scope enclosed by '{' '}' surrounding the cursor and puts CUSTOM_COMMAND_SIG(select_next_scope_absolute) CUSTOM_DOC("Finds the first scope started by '{' after the cursor and puts the cursor and mark on the '{' and '}'.") { - u32 access = AccessProtected; - View_Summary view = get_active_view(app, access); - Buffer_Summary buffer = get_buffer(app, view.buffer_id, access); - + View_Summary view = get_active_view(app, AccessProtected); + Buffer_ID buffer = 0; + view_get_buffer(app, view.view_id, AccessProtected, &buffer); i32 start_pos = view.cursor.pos; i32 top = 0; i32 bottom = 0; - if (find_next_scope(app, &buffer, start_pos, FindScope_Brace, &top)){ - if (find_scope_bottom(app, &buffer, top, FindScope_EndOfToken|FindScope_Brace, &bottom)){ + if (find_next_scope(app, buffer, start_pos, FindScope_Brace, &top)){ + if (find_scope_bottom(app, buffer, top, FindScope_EndOfToken|FindScope_Brace, &bottom)){ view_set_cursor(app, &view, seek_pos(top), true); view_set_mark(app, &view, seek_pos(bottom)); view_set_to_region(app, &view, top, bottom, scope_center_threshold); @@ -410,14 +376,13 @@ CUSTOM_DOC("Finds the first scope started by '{' after the cursor and puts the c CUSTOM_COMMAND_SIG(select_prev_scope_absolute) CUSTOM_DOC("Finds the first scope started by '{' before the cursor and puts the cursor and mark on the '{' and '}'.") { - u32 access = AccessProtected; - View_Summary view = get_active_view(app, access); - Buffer_Summary buffer = get_buffer(app, view.buffer_id, access); - + View_Summary view = get_active_view(app, AccessProtected); + Buffer_ID buffer = 0; + view_get_buffer(app, view.view_id, AccessProtected, &buffer); i32 start_pos = view.cursor.pos; i32 top = 0, bottom = 0; - if (find_prev_scope(app, &buffer, start_pos, FindScope_Brace, &top)){ - if (find_scope_bottom(app, &buffer, top, FindScope_EndOfToken|FindScope_Brace, &bottom)){ + if (find_prev_scope(app, buffer, start_pos, FindScope_Brace, &top)){ + if (find_scope_bottom(app, buffer, top, FindScope_EndOfToken|FindScope_Brace, &bottom)){ view_set_cursor(app, &view, seek_pos(top), true); view_set_mark(app, &view, seek_pos(bottom)); view_set_to_region(app, &view, top, bottom, scope_center_threshold); @@ -429,16 +394,17 @@ CUSTOM_DOC("Finds the first scope started by '{' before the cursor and puts the static void place_begin_and_end_on_own_lines(Application_Links *app, Partition *scratch, char *begin, char *end){ View_Summary view = get_active_view(app, AccessOpen); - Buffer_Summary buffer = get_buffer(app, view.buffer_id, AccessOpen); + Buffer_ID buffer = 0; + view_get_buffer(app, view.view_id, AccessOpen, &buffer); Range lines = {}; Range range = get_view_range(&view); - lines.min = buffer_get_line_number(app, &buffer, range.min); - lines.max = buffer_get_line_number(app, &buffer, range.max); - range.min = buffer_get_line_start(app, buffer.buffer_id, lines.min); - range.max = buffer_get_line_end(app, buffer.buffer_id, lines.max); + lines.min = buffer_get_line_number(app, buffer, range.min); + lines.max = buffer_get_line_number(app, buffer, range.max); + range.min = buffer_get_line_start(app, buffer, lines.min); + range.max = buffer_get_line_end(app, buffer, lines.max); - b32 do_full = (lines.min < lines.max) || (!buffer_line_is_blank(app, buffer.buffer_id, lines.min)); + b32 do_full = (lines.min < lines.max) || (!buffer_line_is_blank(app, buffer, lines.min)); Temp_Memory temp = begin_temp_memory(scratch); i32 begin_len = str_size(begin); @@ -458,13 +424,13 @@ place_begin_and_end_on_own_lines(Application_Links *app, Partition *scratch, cha i32 min_adjustment = 0; i32 max_adjustment = 4; - if (buffer_line_is_blank(app, buffer.buffer_id, lines.min)){ + if (buffer_line_is_blank(app, buffer, lines.min)){ memmove(str + 1, str, begin_len); str[0] = '\n'; ++min_adjustment; } - if (buffer_line_is_blank(app, buffer.buffer_id, lines.max)){ + if (buffer_line_is_blank(app, buffer, lines.max)){ memmove(str + begin_len + 1, str + begin_len + 2, end_len); str[begin_len + end_len + 1] = '\n'; --max_adjustment; @@ -491,13 +457,13 @@ place_begin_and_end_on_own_lines(Application_Links *app, Partition *scratch, cha edits[1].start = range.max; edits[1].end = range.max; - buffer_batch_edit(app, &buffer, str, str_size, edits, 2, BatchEdit_Normal); + buffer_batch_edit(app, buffer, str, str_size, edits, 2, BatchEdit_Normal); view_set_cursor(app, &view, seek_pos(cursor_pos), true); view_set_mark(app, &view, seek_pos(mark_pos)); } else{ - buffer_replace_range(app, &buffer, range.min, range.max, str, str_size); + buffer_replace_range(app, buffer, range.min, range.max, make_string(str, str_size)); i32 center_pos = range.min + begin_len + 1; view_set_cursor(app, &view, seek_pos(center_pos), true); view_set_mark(app, &view, seek_pos(center_pos)); @@ -515,9 +481,9 @@ CUSTOM_DOC("Wraps the code contained in the range between cursor and mark with a CUSTOM_COMMAND_SIG(delete_current_scope) CUSTOM_DOC("Deletes the braces surrounding the currently selected scope. Leaves the contents within the scope.") { - u32 access = AccessOpen; - View_Summary view = get_active_view(app, access); - Buffer_Summary buffer = get_buffer(app, view.buffer_id, access); + View_Summary view = get_active_view(app, AccessOpen); + Buffer_ID buffer = 0; + view_get_buffer(app, view.view_id, AccessOpen, &buffer); i32 top = view.cursor.pos; i32 bottom = view.mark.pos; @@ -528,14 +494,13 @@ CUSTOM_DOC("Deletes the braces surrounding the currently selected scope. Leaves bottom = x; } - if (buffer_get_char(app, buffer.buffer_id, top) == '{' && - buffer_get_char(app, buffer.buffer_id, bottom - 1) == '}'){ + if (buffer_get_char(app, buffer, top) == '{' && buffer_get_char(app, buffer, bottom - 1) == '}'){ i32 top_len = 1; i32 bottom_len = 1; - if (buffer_get_char(app, buffer.buffer_id, top - 1) == '\n'){ + if (buffer_get_char(app, buffer, top - 1) == '\n'){ top_len = 2; } - if (buffer_get_char(app, buffer.buffer_id, bottom + 1) == '\n'){ + if (buffer_get_char(app, buffer, bottom + 1) == '\n'){ bottom_len = 2; } @@ -550,7 +515,7 @@ CUSTOM_DOC("Deletes the braces surrounding the currently selected scope. Leaves edits[1].start = bottom - 1; edits[1].end = bottom - 1 + bottom_len; - buffer_batch_edit(app, &buffer, 0, 0, edits, 2, BatchEdit_Normal); + buffer_batch_edit(app, buffer, 0, 0, edits, 2, BatchEdit_Normal); } } @@ -710,9 +675,9 @@ parse_statement_down(Application_Links *app, Statement_Parser *parser, Cpp_Token } static Statement_Parser -make_statement_parser(Application_Links *app, Buffer_Summary *buffer, i32 token_index){ +make_statement_parser(Application_Links *app, Buffer_ID buffer, i32 token_index){ Statement_Parser parser = {}; - Token_Range token_range = buffer_get_token_range(app, buffer->buffer_id); + Token_Range token_range = buffer_get_token_range(app, buffer); if (token_range.first != 0){ parser.token_iterator = make_token_iterator(token_range, token_index); parser.buffer = buffer; @@ -721,7 +686,7 @@ make_statement_parser(Application_Links *app, Buffer_Summary *buffer, i32 token_ } static b32 -find_whole_statement_down(Application_Links *app, Buffer_Summary *buffer, i32 pos, i32 *start_out, i32 *end_out){ +find_whole_statement_down(Application_Links *app, Buffer_ID buffer, i32 pos, i32 *start_out, i32 *end_out){ b32 result = false; i32 start = pos; i32 end = start; @@ -751,9 +716,9 @@ find_whole_statement_down(Application_Links *app, Buffer_Summary *buffer, i32 po CUSTOM_COMMAND_SIG(scope_absorb_down) CUSTOM_DOC("If a scope is currently selected, and a statement or block statement is present below the current scope, the statement is moved into the scope.") { - u32 access = AccessOpen; - View_Summary view = get_active_view(app, access); - Buffer_Summary buffer = get_buffer(app, view.buffer_id, access); + View_Summary view = get_active_view(app, AccessOpen); + Buffer_ID buffer = 0; + view_get_buffer(app, view.view_id, AccessOpen, &buffer); i32 top = view.cursor.pos; i32 bottom = view.mark.pos; @@ -767,12 +732,11 @@ CUSTOM_DOC("If a scope is currently selected, and a statement or block statement Partition *part = &global_part; Temp_Memory temp = begin_temp_memory(part); - if (buffer_get_char(app, buffer.buffer_id, top) == '{' && - buffer_get_char(app, buffer.buffer_id, bottom-1) == '}'){ + if (buffer_get_char(app, buffer, top) == '{' && buffer_get_char(app, buffer, bottom - 1) == '}'){ Range range = {}; - if (find_whole_statement_down(app, &buffer, bottom, &range.start, &range.end)){ + if (find_whole_statement_down(app, buffer, bottom, &range.start, &range.end)){ char *string_space = push_array(part, char, range.end - range.start); - buffer_read_range(app, &buffer, range.start, range.end, string_space); + buffer_read_range(app, buffer, range.start, range.end, string_space); String string = make_string(string_space, range.end - range.start); string = skip_chop_whitespace(string); @@ -816,7 +780,7 @@ CUSTOM_DOC("If a scope is currently selected, and a statement or block statement edits[1].start = range.start; edits[1].end = range.end; - buffer_batch_edit(app, &buffer, edit_str, edit_len, edits, 2, BatchEdit_Normal); + buffer_batch_edit(app, buffer, edit_str, edit_len, edits, 2, BatchEdit_Normal); } } end_temp_memory(temp); diff --git a/4coder_scope_commands.h b/4coder_scope_commands.h index 11b74704..6118c30f 100644 --- a/4coder_scope_commands.h +++ b/4coder_scope_commands.h @@ -17,7 +17,7 @@ enum{ struct Statement_Parser{ Token_Iterator token_iterator; - Buffer_Summary *buffer; + Buffer_ID buffer; }; typedef i32 Find_Scope_Token_Type; diff --git a/4coder_search.cpp b/4coder_search.cpp index d0ed218c..3270ad4d 100644 --- a/4coder_search.cpp +++ b/4coder_search.cpp @@ -751,12 +751,14 @@ list_identifier__parameters(Application_Links *app, Heap *heap, Partition *scrat b32 substrings, b32 case_insensitive, View_Summary default_target_view){ View_Summary view = get_active_view(app, AccessProtected); - Buffer_Summary buffer = get_buffer(app, view.buffer_id, AccessProtected); - if (!buffer.exists) return; - char space[512]; - String str = get_token_or_word_under_pos(app, &buffer, view.cursor.pos, space, sizeof(space)); - if (str.size > 0){ - list_single__parameters(app, heap, scratch, str, substrings, case_insensitive, default_target_view); + Buffer_ID buffer = 0; + view_get_buffer(app, view.view_id, AccessProtected, &buffer); + if (buffer_exists(app, buffer)){ + char space[512]; + String str = get_token_or_word_under_pos(app, buffer, view.cursor.pos, space, sizeof(space)); + if (str.size > 0){ + list_single__parameters(app, heap, scratch, str, substrings, case_insensitive, default_target_view); + } } } @@ -878,9 +880,10 @@ CUSTOM_COMMAND_SIG(list_all_locations_of_type_definition_of_identifier) CUSTOM_DOC("Reads a token or word under the cursor and lists all locations of strings that appear to define a type whose name matches it.") { View_Summary view = get_active_view(app, AccessProtected); - Buffer_Summary buffer = get_buffer(app, view.buffer_id, AccessProtected); + Buffer_ID buffer = 0; + view_get_buffer(app, view.view_id, AccessProtected, &buffer); char space[512]; - String str = get_token_or_word_under_pos(app, &buffer, view.cursor.pos, space, sizeof(space) - 1); + String str = get_token_or_word_under_pos(app, buffer, view.cursor.pos, space, sizeof(space) - 1); if (str.size > 0){ View_Summary target_view = get_next_view_after_active(app, AccessAll); list_type_definition__parameters(app, &global_heap, &global_part, str, target_view);