From 2c20e18a8df023f9fe65f2edf21a3ba4d9787a30 Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Sat, 15 Sep 2018 16:48:02 -0700 Subject: [PATCH] Command lister, Jump lister, Function lister --- 4coder_base_commands.cpp | 2 +- 4coder_default_include.cpp | 3 +- 4coder_function_list.cpp | 74 +++++- 4coder_generated/command_metadata.h | 352 +++++++++++++------------- 4coder_generated/remapping.h | 108 ++------ 4coder_jump_lister.cpp | 118 +++++++++ 4coder_jump_lister.h | 22 ++ 4coder_jump_sticky.cpp | 8 +- 4coder_lists.cpp | 138 +++++++--- 4coder_long_command_switch.cpp | 74 ------ 4coder_ui_helper.cpp | 55 ++-- 4coder_ui_helper.h | 21 +- 4ed_dynamic_variables.cpp | 1 + 4ed_view_ui.cpp | 2 + meta/4ed_metagen.cpp | 49 +--- site/source_material/binding_list.txt | 20 +- todo.txt | 20 +- 17 files changed, 607 insertions(+), 460 deletions(-) create mode 100644 4coder_jump_lister.cpp create mode 100644 4coder_jump_lister.h delete mode 100644 4coder_long_command_switch.cpp diff --git a/4coder_base_commands.cpp b/4coder_base_commands.cpp index c1e5c2e5..24211d80 100644 --- a/4coder_base_commands.cpp +++ b/4coder_base_commands.cpp @@ -1054,7 +1054,7 @@ CUSTOM_DOC("Deletes the file of the current buffer if 4coder has the appropriate } CUSTOM_COMMAND_SIG(save_to_query) -CUSTOM_DOC("Queries the user for a name and saves the contents of the current buffer, altering the buffer's name too.") +CUSTOM_DOC("Queries the user for a file name and saves the contents of the current buffer, altering the buffer's name too.") { View_Summary view = get_active_view(app, AccessAll); Buffer_Summary buffer = get_buffer(app, view.buffer_id, AccessAll); diff --git a/4coder_default_include.cpp b/4coder_default_include.cpp index b00a6e17..af889a45 100644 --- a/4coder_default_include.cpp +++ b/4coder_default_include.cpp @@ -35,6 +35,7 @@ #include "4coder_search.h" #include "4coder_build_commands.h" #include "4coder_jump_sticky.h" +#include "4coder_jump_lister.h" #include "4coder_project_commands.h" #include "4coder_function_list.h" #include "4coder_scope_commands.h" @@ -54,6 +55,7 @@ #include "4coder_jumping.cpp" #include "4coder_jump_direct.cpp" #include "4coder_jump_sticky.cpp" +#include "4coder_jump_lister.cpp" #include "4coder_clipboard.cpp" #include "4coder_system_command.cpp" #include "4coder_build_commands.cpp" @@ -61,7 +63,6 @@ #include "4coder_function_list.cpp" #include "4coder_scope_commands.cpp" #include "4coder_combined_write_commands.cpp" -#include "4coder_long_command_switch.cpp" #include "4coder_default_hooks.cpp" #include "4coder_remapping_commands.cpp" diff --git a/4coder_function_list.cpp b/4coder_function_list.cpp index 06e3f22b..ffa9709a 100644 --- a/4coder_function_list.cpp +++ b/4coder_function_list.cpp @@ -275,7 +275,7 @@ print_positions(Application_Links *app, Buffer_Summary *buffer, Function_Positio } static void -list_all_functions(Application_Links *app, Partition *part, Buffer_Summary *buffer){ +list_all_functions(Application_Links *app, Partition *part, Buffer_Summary *optional_target_buffer){ String search_name = make_lit_string("*decls*"); Buffer_Summary decls_buffer = get_buffer_by_name(app, search_name.str, search_name.size, AccessAll); if (!decls_buffer.exists){ @@ -294,17 +294,34 @@ list_all_functions(Application_Links *app, Partition *part, Buffer_Summary *buff int32_t positions_max = (4<<10)/sizeof(Function_Positions); Function_Positions *positions_array = push_array(part, Function_Positions, positions_max); - int32_t token_index = 0; - bool32 still_looping = false; - do{ - Get_Positions_Results get_positions_results = get_function_positions(app, buffer, token_index, positions_array, positions_max); + 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; + if (optional_target_buffer != 0){ + buffer = *optional_target_buffer; + } - int32_t positions_count = get_positions_results.positions_count; - token_index = get_positions_results.next_token_index; - still_looping = get_positions_results.still_looping; + if (!buffer.tokens_are_ready){ + continue; + } - print_positions(app, buffer, positions_array, positions_count, &decls_buffer, part); - }while(still_looping); + int32_t token_index = 0; + bool32 still_looping = false; + do{ + Get_Positions_Results get_positions_results = get_function_positions(app, &buffer, token_index, positions_array, positions_max); + + int32_t positions_count = get_positions_results.positions_count; + token_index = get_positions_results.next_token_index; + still_looping = get_positions_results.still_looping; + + print_positions(app, &buffer, positions_array, positions_count, &decls_buffer, part); + }while(still_looping); + + if (optional_target_buffer != 0){ + break; + } + } View_Summary view = get_active_view(app, AccessAll); view_set_buffer(app, &view, decls_buffer.buffer_id, 0); @@ -318,10 +335,39 @@ list_all_functions(Application_Links *app, Partition *part, Buffer_Summary *buff 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.") { - uint32_t access = AccessProtected; - View_Summary view = get_active_view(app, access); - Buffer_Summary buffer = get_buffer(app, view.buffer_id, access); - list_all_functions(app, &global_part, &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); + } +} + +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); + view = get_active_view(app, AccessAll); + open_jump_lister(app, &global_part, &global_heap, + &view, view.buffer_id, JumpListerActivation_OpenInUIView, 0); + } +} + +CUSTOM_COMMAND_SIG(list_all_functions_all_buffers) +CUSTOM_DOC("Creates a jump list of lines from all buffers that appear to define or declare functions.") +{ + list_all_functions(app, &global_part, 0); +} + +CUSTOM_COMMAND_SIG(list_all_functions_all_buffers_lister) +CUSTOM_DOC("Creates a lister of locations that look like function definitions and declarations all buffers.") +{ + list_all_functions(app, &global_part, 0); + View_Summary view = get_active_view(app, AccessAll); + open_jump_lister(app, &global_part, &global_heap, + &view, view.buffer_id, JumpListerActivation_OpenInUIView, 0); } // BOTTOM diff --git a/4coder_generated/command_metadata.h b/4coder_generated/command_metadata.h index cbf6cbec..c4b2c093 100644 --- a/4coder_generated/command_metadata.h +++ b/4coder_generated/command_metadata.h @@ -2,7 +2,7 @@ #define command_id(c) (fcoder_metacmd_ID_##c) #define command_metadata(c) (&fcoder_metacmd_table[command_id(c)]) #define command_metadata_by_id(id) (&fcoder_metacmd_table[id]) -#define command_one_past_last_id 202 +#define command_one_past_last_id 206 #if defined(CUSTOM_COMMAND_SIG) #define PROC_LINKS(x,y) x #else @@ -28,6 +28,7 @@ CUSTOM_COMMAND_SIG(click_set_mark); CUSTOM_COMMAND_SIG(close_all_code); CUSTOM_COMMAND_SIG(close_build_panel); CUSTOM_COMMAND_SIG(close_panel); +CUSTOM_COMMAND_SIG(command_lister); CUSTOM_COMMAND_SIG(copy); CUSTOM_COMMAND_SIG(cursor_mark_swap); CUSTOM_COMMAND_SIG(cut); @@ -43,7 +44,6 @@ CUSTOM_COMMAND_SIG(duplicate_line); CUSTOM_COMMAND_SIG(eol_dosify); CUSTOM_COMMAND_SIG(eol_nixify); CUSTOM_COMMAND_SIG(execute_any_cli); -CUSTOM_COMMAND_SIG(execute_arbitrary_command); CUSTOM_COMMAND_SIG(execute_previous_cli); CUSTOM_COMMAND_SIG(exit_4coder); CUSTOM_COMMAND_SIG(goto_beginning_of_file); @@ -79,7 +79,10 @@ CUSTOM_COMMAND_SIG(interactive_open_or_new); CUSTOM_COMMAND_SIG(interactive_switch_buffer); CUSTOM_COMMAND_SIG(kill_buffer); CUSTOM_COMMAND_SIG(left_adjust_view); +CUSTOM_COMMAND_SIG(list_all_functions_all_buffers); +CUSTOM_COMMAND_SIG(list_all_functions_all_buffers_lister); CUSTOM_COMMAND_SIG(list_all_functions_current_buffer); +CUSTOM_COMMAND_SIG(list_all_functions_current_buffer_lister); CUSTOM_COMMAND_SIG(list_all_locations); CUSTOM_COMMAND_SIG(list_all_locations_case_insensitive); CUSTOM_COMMAND_SIG(list_all_locations_of_identifier); @@ -202,6 +205,7 @@ CUSTOM_COMMAND_SIG(toggle_show_whitespace); CUSTOM_COMMAND_SIG(toggle_virtual_whitespace); CUSTOM_COMMAND_SIG(undo); CUSTOM_COMMAND_SIG(view_buffer_other_panel); +CUSTOM_COMMAND_SIG(view_jump_list_with_lister); CUSTOM_COMMAND_SIG(word_complete); CUSTOM_COMMAND_SIG(write_and_auto_tab); CUSTOM_COMMAND_SIG(write_block); @@ -222,7 +226,7 @@ char *source_name; int32_t source_name_len; int32_t line_number; }; -static Command_Metadata fcoder_metacmd_table[202] = { +static Command_Metadata fcoder_metacmd_table[206] = { { 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, 240 }, { 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, 722 }, { 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, 733 }, @@ -242,6 +246,7 @@ static Command_Metadata fcoder_metacmd_table[202] = { { 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, 1048 }, { 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, 447 }, +{ PROC_LINKS(command_lister, 0), "command_lister", 14, "Opens an interactive list of all registered commands.", 53, "w:\\4ed\\code\\4coder_lists.cpp", 28, 929 }, { 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, 101 }, { 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 }, @@ -257,27 +262,26 @@ static Command_Metadata fcoder_metacmd_table[202] = { { 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, 567 }, { 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, 575 }, { 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_arbitrary_command, 0), "execute_arbitrary_command", 25, "Execute a 'long form' command.", 30, "w:\\4ed\\code\\4coder_long_command_switch.cpp", 42, 8 }, { PROC_LINKS(execute_previous_cli, 0), "execute_previous_cli", 20, "If the command execute_any_cli has already been used, this will execute a CLI reusing the most recent buffer name and command.", 126, "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, 583 }, { 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, 1168 }, { 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, 1175 }, { PROC_LINKS(goto_first_jump_direct, 0), "goto_first_jump_direct", 22, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer.", 95, "w:\\4ed\\code\\4coder_jump_direct.cpp", 34, 84 }, -{ PROC_LINKS(goto_first_jump_same_panel_sticky, 0), "goto_first_jump_same_panel_sticky", 33, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer and views the buffer in the panel where the jump list was.", 153, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 520 }, -{ 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, 502 }, +{ 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, 524 }, +{ 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, 506 }, { 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, 29 }, -{ PROC_LINKS(goto_jump_at_cursor_same_panel_sticky, 0), "goto_jump_at_cursor_same_panel_sticky", 37, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in this view, losing the compilation output or jump list.", 167, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 348 }, -{ 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, 320 }, +{ 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, 352 }, +{ 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, 324 }, { 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, 591 }, { 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, 48 }, { PROC_LINKS(goto_next_jump_no_skips_direct, 0), "goto_next_jump_no_skips_direct", 30, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, and does not skip sub jump locations.", 132, "w:\\4ed\\code\\4coder_jump_direct.cpp", 34, 66 }, -{ PROC_LINKS(goto_next_jump_no_skips_sticky, 0), "goto_next_jump_no_skips_sticky", 30, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, and does not skip sub jump locations.", 132, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 471 }, -{ 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, 441 }, +{ 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, 475 }, +{ 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, 445 }, { 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, 57 }, { PROC_LINKS(goto_prev_jump_no_skips_direct, 0), "goto_prev_jump_no_skips_direct", 30, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, and does not skip sub jump locations.", 136, "w:\\4ed\\code\\4coder_jump_direct.cpp", 34, 75 }, -{ PROC_LINKS(goto_prev_jump_no_skips_sticky, 0), "goto_prev_jump_no_skips_sticky", 30, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, and does not skip sub jump locations.", 136, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 487 }, -{ 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, 457 }, +{ 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, 491 }, +{ 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, 461 }, { 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, 477 }, { 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, 463 }, { PROC_LINKS(highlight_next_scope_absolute, 0), "highlight_next_scope_absolute", 29, "Finds the first scope started by '{' after the cursor and puts the cursor and mark on the '{' and '}'.", 102, "w:\\4ed\\code\\4coder_scope_commands.cpp", 37, 363 }, @@ -286,14 +290,17 @@ static Command_Metadata fcoder_metacmd_table[202] = { { 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, 82 }, { 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, 525 }, { 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, 503 }, -{ PROC_LINKS(interactive_kill_buffer, 0), "interactive_kill_buffer", 23, "Interactively kill an open buffer.", 34, "w:\\4ed\\code\\4coder_lists.cpp", 28, 707 }, -{ PROC_LINKS(interactive_new, 0), "interactive_new", 15, "Interactively creates a new file.", 33, "w:\\4ed\\code\\4coder_lists.cpp", 28, 809 }, -{ PROC_LINKS(interactive_open, 0), "interactive_open", 16, "Interactively opens a file.", 27, "w:\\4ed\\code\\4coder_lists.cpp", 28, 836 }, -{ 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, 776 }, -{ PROC_LINKS(interactive_switch_buffer, 0), "interactive_switch_buffer", 25, "Interactively switch to an open buffer.", 39, "w:\\4ed\\code\\4coder_lists.cpp", 28, 689 }, +{ PROC_LINKS(interactive_kill_buffer, 0), "interactive_kill_buffer", 23, "Interactively kill an open buffer.", 34, "w:\\4ed\\code\\4coder_lists.cpp", 28, 746 }, +{ PROC_LINKS(interactive_new, 0), "interactive_new", 15, "Interactively creates a new file.", 33, "w:\\4ed\\code\\4coder_lists.cpp", 28, 848 }, +{ PROC_LINKS(interactive_open, 0), "interactive_open", 16, "Interactively opens a file.", 27, "w:\\4ed\\code\\4coder_lists.cpp", 28, 875 }, +{ 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, 815 }, +{ PROC_LINKS(interactive_switch_buffer, 0), "interactive_switch_buffer", 25, "Interactively switch to an open buffer.", 39, "w:\\4ed\\code\\4coder_lists.cpp", 28, 728 }, { PROC_LINKS(kill_buffer, 0), "kill_buffer", 11, "Kills the current buffer.", 25, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1450 }, { 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, 141 }, -{ 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, 318 }, +{ 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, 358 }, +{ 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, 364 }, +{ 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, 335 }, +{ 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, 345 }, { 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, 769 }, { 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, 783 }, { 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, 797 }, @@ -334,11 +341,11 @@ static Command_Metadata fcoder_metacmd_table[202] = { { 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, 262 }, { 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, 101 }, { PROC_LINKS(newline_or_goto_position_same_panel_direct, 0), "newline_or_goto_position_same_panel_direct", 42, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor_same_panel.", 117, "w:\\4ed\\code\\4coder_jump_direct.cpp", 34, 116 }, -{ PROC_LINKS(newline_or_goto_position_same_panel_sticky, 0), "newline_or_goto_position_same_panel_sticky", 42, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor_same_panel.", 117, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 558 }, -{ 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, 543 }, +{ 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, 562 }, +{ 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, 547 }, { 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, 1055 }, { 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, 1062 }, -{ PROC_LINKS(open_color_tweaker, 0), "open_color_tweaker", 18, "Opens the 4coder theme selector list.", 37, "w:\\4ed\\code\\4coder_lists.cpp", 28, 852 }, +{ PROC_LINKS(open_color_tweaker, 0), "open_color_tweaker", 18, "Opens the 4coder theme selector list.", 37, "w:\\4ed\\code\\4coder_lists.cpp", 28, 891 }, { 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, 1357 }, { 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, 1508 }, { 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, 58 }, @@ -369,7 +376,7 @@ static Command_Metadata fcoder_metacmd_table[202] = { { 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, 805 }, { PROC_LINKS(save, 0), "save", 4, "Saves the current buffer.", 25, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1477 }, { 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, 1000 }, -{ PROC_LINKS(save_to_query, 0), "save_to_query", 13, "Queries the user for a name and saves the contents of the current buffer, altering the buffer's name too.", 105, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1056 }, +{ 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, 1056 }, { 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, 738 }, { 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, 780 }, { 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, 794 }, @@ -416,6 +423,7 @@ static Command_Metadata fcoder_metacmd_table[202] = { { 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, 549 }, { PROC_LINKS(undo, 0), "undo", 4, "Advances backwards through the undo history.", 44, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1459 }, { 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, 1407 }, +{ 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, 109 }, { 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, 856 }, { 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, 745 }, { 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, 106 }, @@ -445,22 +453,22 @@ static int32_t fcoder_metacmd_ID_click_set_mark = 15; static int32_t fcoder_metacmd_ID_close_all_code = 16; static int32_t fcoder_metacmd_ID_close_build_panel = 17; static int32_t fcoder_metacmd_ID_close_panel = 18; -static int32_t fcoder_metacmd_ID_copy = 19; -static int32_t fcoder_metacmd_ID_cursor_mark_swap = 20; -static int32_t fcoder_metacmd_ID_cut = 21; -static int32_t fcoder_metacmd_ID_decrease_face_size = 22; -static int32_t fcoder_metacmd_ID_decrease_line_wrap = 23; -static int32_t fcoder_metacmd_ID_delete_char = 24; -static int32_t fcoder_metacmd_ID_delete_current_scope = 25; -static int32_t fcoder_metacmd_ID_delete_file_query = 26; -static int32_t fcoder_metacmd_ID_delete_line = 27; -static int32_t fcoder_metacmd_ID_delete_range = 28; -static int32_t fcoder_metacmd_ID_delete_word = 29; -static int32_t fcoder_metacmd_ID_duplicate_line = 30; -static int32_t fcoder_metacmd_ID_eol_dosify = 31; -static int32_t fcoder_metacmd_ID_eol_nixify = 32; -static int32_t fcoder_metacmd_ID_execute_any_cli = 33; -static int32_t fcoder_metacmd_ID_execute_arbitrary_command = 34; +static int32_t fcoder_metacmd_ID_command_lister = 19; +static int32_t fcoder_metacmd_ID_copy = 20; +static int32_t fcoder_metacmd_ID_cursor_mark_swap = 21; +static int32_t fcoder_metacmd_ID_cut = 22; +static int32_t fcoder_metacmd_ID_decrease_face_size = 23; +static int32_t fcoder_metacmd_ID_decrease_line_wrap = 24; +static int32_t fcoder_metacmd_ID_delete_char = 25; +static int32_t fcoder_metacmd_ID_delete_current_scope = 26; +static int32_t fcoder_metacmd_ID_delete_file_query = 27; +static int32_t fcoder_metacmd_ID_delete_line = 28; +static int32_t fcoder_metacmd_ID_delete_range = 29; +static int32_t fcoder_metacmd_ID_delete_word = 30; +static int32_t fcoder_metacmd_ID_duplicate_line = 31; +static int32_t fcoder_metacmd_ID_eol_dosify = 32; +static int32_t fcoder_metacmd_ID_eol_nixify = 33; +static int32_t fcoder_metacmd_ID_execute_any_cli = 34; static int32_t fcoder_metacmd_ID_execute_previous_cli = 35; static int32_t fcoder_metacmd_ID_exit_4coder = 36; static int32_t fcoder_metacmd_ID_goto_beginning_of_file = 37; @@ -496,136 +504,140 @@ static int32_t fcoder_metacmd_ID_interactive_open_or_new = 66; static int32_t fcoder_metacmd_ID_interactive_switch_buffer = 67; static int32_t fcoder_metacmd_ID_kill_buffer = 68; static int32_t fcoder_metacmd_ID_left_adjust_view = 69; -static int32_t fcoder_metacmd_ID_list_all_functions_current_buffer = 70; -static int32_t fcoder_metacmd_ID_list_all_locations = 71; -static int32_t fcoder_metacmd_ID_list_all_locations_case_insensitive = 72; -static int32_t fcoder_metacmd_ID_list_all_locations_of_identifier = 73; -static int32_t fcoder_metacmd_ID_list_all_locations_of_identifier_case_insensitive = 74; -static int32_t fcoder_metacmd_ID_list_all_locations_of_selection = 75; -static int32_t fcoder_metacmd_ID_list_all_locations_of_selection_case_insensitive = 76; -static int32_t fcoder_metacmd_ID_list_all_locations_of_type_definition = 77; -static int32_t fcoder_metacmd_ID_list_all_locations_of_type_definition_of_identifier = 78; -static int32_t fcoder_metacmd_ID_list_all_substring_locations = 79; -static int32_t fcoder_metacmd_ID_list_all_substring_locations_case_insensitive = 80; -static int32_t fcoder_metacmd_ID_lister__activate = 81; -static int32_t fcoder_metacmd_ID_lister__backspace_text_field = 82; -static int32_t fcoder_metacmd_ID_lister__backspace_text_field__default = 83; -static int32_t fcoder_metacmd_ID_lister__backspace_text_field__file_path = 84; -static int32_t fcoder_metacmd_ID_lister__mouse_press = 85; -static int32_t fcoder_metacmd_ID_lister__mouse_release = 86; -static int32_t fcoder_metacmd_ID_lister__move_down = 87; -static int32_t fcoder_metacmd_ID_lister__move_down__default = 88; -static int32_t fcoder_metacmd_ID_lister__move_up = 89; -static int32_t fcoder_metacmd_ID_lister__move_up__default = 90; -static int32_t fcoder_metacmd_ID_lister__quit = 91; -static int32_t fcoder_metacmd_ID_lister__repaint = 92; -static int32_t fcoder_metacmd_ID_lister__wheel_scroll = 93; -static int32_t fcoder_metacmd_ID_lister__write_character = 94; -static int32_t fcoder_metacmd_ID_lister__write_character__default = 95; -static int32_t fcoder_metacmd_ID_lister__write_character__file_path = 96; -static int32_t fcoder_metacmd_ID_lister__write_character__fixed_list = 97; -static int32_t fcoder_metacmd_ID_load_project = 98; -static int32_t fcoder_metacmd_ID_make_directory_query = 99; -static int32_t fcoder_metacmd_ID_move_down = 100; -static int32_t fcoder_metacmd_ID_move_down_10 = 101; -static int32_t fcoder_metacmd_ID_move_down_textual = 102; -static int32_t fcoder_metacmd_ID_move_left = 103; -static int32_t fcoder_metacmd_ID_move_line_down = 104; -static int32_t fcoder_metacmd_ID_move_line_up = 105; -static int32_t fcoder_metacmd_ID_move_right = 106; -static int32_t fcoder_metacmd_ID_move_up = 107; -static int32_t fcoder_metacmd_ID_move_up_10 = 108; -static int32_t fcoder_metacmd_ID_newline_or_goto_position_direct = 109; -static int32_t fcoder_metacmd_ID_newline_or_goto_position_same_panel_direct = 110; -static int32_t fcoder_metacmd_ID_newline_or_goto_position_same_panel_sticky = 111; -static int32_t fcoder_metacmd_ID_newline_or_goto_position_sticky = 112; -static int32_t fcoder_metacmd_ID_open_all_code = 113; -static int32_t fcoder_metacmd_ID_open_all_code_recursive = 114; -static int32_t fcoder_metacmd_ID_open_color_tweaker = 115; -static int32_t fcoder_metacmd_ID_open_file_in_quotes = 116; -static int32_t fcoder_metacmd_ID_open_in_other = 117; -static int32_t fcoder_metacmd_ID_open_long_braces = 118; -static int32_t fcoder_metacmd_ID_open_long_braces_break = 119; -static int32_t fcoder_metacmd_ID_open_long_braces_semicolon = 120; -static int32_t fcoder_metacmd_ID_open_matching_file_cpp = 121; -static int32_t fcoder_metacmd_ID_open_panel_hsplit = 122; -static int32_t fcoder_metacmd_ID_open_panel_vsplit = 123; -static int32_t fcoder_metacmd_ID_page_down = 124; -static int32_t fcoder_metacmd_ID_page_up = 125; -static int32_t fcoder_metacmd_ID_paste = 126; -static int32_t fcoder_metacmd_ID_paste_and_indent = 127; -static int32_t fcoder_metacmd_ID_paste_next = 128; -static int32_t fcoder_metacmd_ID_paste_next_and_indent = 129; -static int32_t fcoder_metacmd_ID_place_in_scope = 130; -static int32_t fcoder_metacmd_ID_project_fkey_command = 131; -static int32_t fcoder_metacmd_ID_project_go_to_root_directory = 132; -static int32_t fcoder_metacmd_ID_query_replace = 133; -static int32_t fcoder_metacmd_ID_query_replace_identifier = 134; -static int32_t fcoder_metacmd_ID_query_replace_selection = 135; -static int32_t fcoder_metacmd_ID_redo = 136; -static int32_t fcoder_metacmd_ID_reload_themes = 137; -static int32_t fcoder_metacmd_ID_remap_interactive = 138; -static int32_t fcoder_metacmd_ID_rename_file_query = 139; -static int32_t fcoder_metacmd_ID_reopen = 140; -static int32_t fcoder_metacmd_ID_replace_in_range = 141; -static int32_t fcoder_metacmd_ID_reverse_search = 142; -static int32_t fcoder_metacmd_ID_reverse_search_identifier = 143; -static int32_t fcoder_metacmd_ID_save = 144; -static int32_t fcoder_metacmd_ID_save_all_dirty_buffers = 145; -static int32_t fcoder_metacmd_ID_save_to_query = 146; -static int32_t fcoder_metacmd_ID_scope_absorb_down = 147; -static int32_t fcoder_metacmd_ID_search = 148; -static int32_t fcoder_metacmd_ID_search_identifier = 149; -static int32_t fcoder_metacmd_ID_seek_alphanumeric_left = 150; -static int32_t fcoder_metacmd_ID_seek_alphanumeric_or_camel_left = 151; -static int32_t fcoder_metacmd_ID_seek_alphanumeric_or_camel_right = 152; -static int32_t fcoder_metacmd_ID_seek_alphanumeric_right = 153; -static int32_t fcoder_metacmd_ID_seek_beginning_of_line = 154; -static int32_t fcoder_metacmd_ID_seek_beginning_of_textual_line = 155; -static int32_t fcoder_metacmd_ID_seek_end_of_line = 156; -static int32_t fcoder_metacmd_ID_seek_end_of_textual_line = 157; -static int32_t fcoder_metacmd_ID_seek_token_left = 158; -static int32_t fcoder_metacmd_ID_seek_token_right = 159; -static int32_t fcoder_metacmd_ID_seek_white_or_token_left = 160; -static int32_t fcoder_metacmd_ID_seek_white_or_token_right = 161; -static int32_t fcoder_metacmd_ID_seek_whitespace_down = 162; -static int32_t fcoder_metacmd_ID_seek_whitespace_down_end_line = 163; -static int32_t fcoder_metacmd_ID_seek_whitespace_left = 164; -static int32_t fcoder_metacmd_ID_seek_whitespace_right = 165; -static int32_t fcoder_metacmd_ID_seek_whitespace_up = 166; -static int32_t fcoder_metacmd_ID_seek_whitespace_up_end_line = 167; -static int32_t fcoder_metacmd_ID_select_all = 168; -static int32_t fcoder_metacmd_ID_set_bindings_choose = 169; -static int32_t fcoder_metacmd_ID_set_bindings_default = 170; -static int32_t fcoder_metacmd_ID_set_bindings_mac_default = 171; -static int32_t fcoder_metacmd_ID_set_mark = 172; -static int32_t fcoder_metacmd_ID_setup_build_bat = 173; -static int32_t fcoder_metacmd_ID_setup_build_bat_and_sh = 174; -static int32_t fcoder_metacmd_ID_setup_build_sh = 175; -static int32_t fcoder_metacmd_ID_setup_new_project = 176; -static int32_t fcoder_metacmd_ID_show_filebar = 177; -static int32_t fcoder_metacmd_ID_show_scrollbar = 178; -static int32_t fcoder_metacmd_ID_snipe_token_or_word = 179; -static int32_t fcoder_metacmd_ID_snipe_token_or_word_right = 180; -static int32_t fcoder_metacmd_ID_suppress_mouse = 181; -static int32_t fcoder_metacmd_ID_swap_buffers_between_panels = 182; -static int32_t fcoder_metacmd_ID_to_lowercase = 183; -static int32_t fcoder_metacmd_ID_to_uppercase = 184; -static int32_t fcoder_metacmd_ID_toggle_filebar = 185; -static int32_t fcoder_metacmd_ID_toggle_fullscreen = 186; -static int32_t fcoder_metacmd_ID_toggle_line_wrap = 187; -static int32_t fcoder_metacmd_ID_toggle_mouse = 188; -static int32_t fcoder_metacmd_ID_toggle_show_whitespace = 189; -static int32_t fcoder_metacmd_ID_toggle_virtual_whitespace = 190; -static int32_t fcoder_metacmd_ID_undo = 191; -static int32_t fcoder_metacmd_ID_view_buffer_other_panel = 192; -static int32_t fcoder_metacmd_ID_word_complete = 193; -static int32_t fcoder_metacmd_ID_write_and_auto_tab = 194; -static int32_t fcoder_metacmd_ID_write_block = 195; -static int32_t fcoder_metacmd_ID_write_character = 196; -static int32_t fcoder_metacmd_ID_write_hack = 197; -static int32_t fcoder_metacmd_ID_write_note = 198; -static int32_t fcoder_metacmd_ID_write_todo = 199; -static int32_t fcoder_metacmd_ID_write_underscore = 200; -static int32_t fcoder_metacmd_ID_write_zero_struct = 201; +static int32_t fcoder_metacmd_ID_list_all_functions_all_buffers = 70; +static int32_t fcoder_metacmd_ID_list_all_functions_all_buffers_lister = 71; +static int32_t fcoder_metacmd_ID_list_all_functions_current_buffer = 72; +static int32_t fcoder_metacmd_ID_list_all_functions_current_buffer_lister = 73; +static int32_t fcoder_metacmd_ID_list_all_locations = 74; +static int32_t fcoder_metacmd_ID_list_all_locations_case_insensitive = 75; +static int32_t fcoder_metacmd_ID_list_all_locations_of_identifier = 76; +static int32_t fcoder_metacmd_ID_list_all_locations_of_identifier_case_insensitive = 77; +static int32_t fcoder_metacmd_ID_list_all_locations_of_selection = 78; +static int32_t fcoder_metacmd_ID_list_all_locations_of_selection_case_insensitive = 79; +static int32_t fcoder_metacmd_ID_list_all_locations_of_type_definition = 80; +static int32_t fcoder_metacmd_ID_list_all_locations_of_type_definition_of_identifier = 81; +static int32_t fcoder_metacmd_ID_list_all_substring_locations = 82; +static int32_t fcoder_metacmd_ID_list_all_substring_locations_case_insensitive = 83; +static int32_t fcoder_metacmd_ID_lister__activate = 84; +static int32_t fcoder_metacmd_ID_lister__backspace_text_field = 85; +static int32_t fcoder_metacmd_ID_lister__backspace_text_field__default = 86; +static int32_t fcoder_metacmd_ID_lister__backspace_text_field__file_path = 87; +static int32_t fcoder_metacmd_ID_lister__mouse_press = 88; +static int32_t fcoder_metacmd_ID_lister__mouse_release = 89; +static int32_t fcoder_metacmd_ID_lister__move_down = 90; +static int32_t fcoder_metacmd_ID_lister__move_down__default = 91; +static int32_t fcoder_metacmd_ID_lister__move_up = 92; +static int32_t fcoder_metacmd_ID_lister__move_up__default = 93; +static int32_t fcoder_metacmd_ID_lister__quit = 94; +static int32_t fcoder_metacmd_ID_lister__repaint = 95; +static int32_t fcoder_metacmd_ID_lister__wheel_scroll = 96; +static int32_t fcoder_metacmd_ID_lister__write_character = 97; +static int32_t fcoder_metacmd_ID_lister__write_character__default = 98; +static int32_t fcoder_metacmd_ID_lister__write_character__file_path = 99; +static int32_t fcoder_metacmd_ID_lister__write_character__fixed_list = 100; +static int32_t fcoder_metacmd_ID_load_project = 101; +static int32_t fcoder_metacmd_ID_make_directory_query = 102; +static int32_t fcoder_metacmd_ID_move_down = 103; +static int32_t fcoder_metacmd_ID_move_down_10 = 104; +static int32_t fcoder_metacmd_ID_move_down_textual = 105; +static int32_t fcoder_metacmd_ID_move_left = 106; +static int32_t fcoder_metacmd_ID_move_line_down = 107; +static int32_t fcoder_metacmd_ID_move_line_up = 108; +static int32_t fcoder_metacmd_ID_move_right = 109; +static int32_t fcoder_metacmd_ID_move_up = 110; +static int32_t fcoder_metacmd_ID_move_up_10 = 111; +static int32_t fcoder_metacmd_ID_newline_or_goto_position_direct = 112; +static int32_t fcoder_metacmd_ID_newline_or_goto_position_same_panel_direct = 113; +static int32_t fcoder_metacmd_ID_newline_or_goto_position_same_panel_sticky = 114; +static int32_t fcoder_metacmd_ID_newline_or_goto_position_sticky = 115; +static int32_t fcoder_metacmd_ID_open_all_code = 116; +static int32_t fcoder_metacmd_ID_open_all_code_recursive = 117; +static int32_t fcoder_metacmd_ID_open_color_tweaker = 118; +static int32_t fcoder_metacmd_ID_open_file_in_quotes = 119; +static int32_t fcoder_metacmd_ID_open_in_other = 120; +static int32_t fcoder_metacmd_ID_open_long_braces = 121; +static int32_t fcoder_metacmd_ID_open_long_braces_break = 122; +static int32_t fcoder_metacmd_ID_open_long_braces_semicolon = 123; +static int32_t fcoder_metacmd_ID_open_matching_file_cpp = 124; +static int32_t fcoder_metacmd_ID_open_panel_hsplit = 125; +static int32_t fcoder_metacmd_ID_open_panel_vsplit = 126; +static int32_t fcoder_metacmd_ID_page_down = 127; +static int32_t fcoder_metacmd_ID_page_up = 128; +static int32_t fcoder_metacmd_ID_paste = 129; +static int32_t fcoder_metacmd_ID_paste_and_indent = 130; +static int32_t fcoder_metacmd_ID_paste_next = 131; +static int32_t fcoder_metacmd_ID_paste_next_and_indent = 132; +static int32_t fcoder_metacmd_ID_place_in_scope = 133; +static int32_t fcoder_metacmd_ID_project_fkey_command = 134; +static int32_t fcoder_metacmd_ID_project_go_to_root_directory = 135; +static int32_t fcoder_metacmd_ID_query_replace = 136; +static int32_t fcoder_metacmd_ID_query_replace_identifier = 137; +static int32_t fcoder_metacmd_ID_query_replace_selection = 138; +static int32_t fcoder_metacmd_ID_redo = 139; +static int32_t fcoder_metacmd_ID_reload_themes = 140; +static int32_t fcoder_metacmd_ID_remap_interactive = 141; +static int32_t fcoder_metacmd_ID_rename_file_query = 142; +static int32_t fcoder_metacmd_ID_reopen = 143; +static int32_t fcoder_metacmd_ID_replace_in_range = 144; +static int32_t fcoder_metacmd_ID_reverse_search = 145; +static int32_t fcoder_metacmd_ID_reverse_search_identifier = 146; +static int32_t fcoder_metacmd_ID_save = 147; +static int32_t fcoder_metacmd_ID_save_all_dirty_buffers = 148; +static int32_t fcoder_metacmd_ID_save_to_query = 149; +static int32_t fcoder_metacmd_ID_scope_absorb_down = 150; +static int32_t fcoder_metacmd_ID_search = 151; +static int32_t fcoder_metacmd_ID_search_identifier = 152; +static int32_t fcoder_metacmd_ID_seek_alphanumeric_left = 153; +static int32_t fcoder_metacmd_ID_seek_alphanumeric_or_camel_left = 154; +static int32_t fcoder_metacmd_ID_seek_alphanumeric_or_camel_right = 155; +static int32_t fcoder_metacmd_ID_seek_alphanumeric_right = 156; +static int32_t fcoder_metacmd_ID_seek_beginning_of_line = 157; +static int32_t fcoder_metacmd_ID_seek_beginning_of_textual_line = 158; +static int32_t fcoder_metacmd_ID_seek_end_of_line = 159; +static int32_t fcoder_metacmd_ID_seek_end_of_textual_line = 160; +static int32_t fcoder_metacmd_ID_seek_token_left = 161; +static int32_t fcoder_metacmd_ID_seek_token_right = 162; +static int32_t fcoder_metacmd_ID_seek_white_or_token_left = 163; +static int32_t fcoder_metacmd_ID_seek_white_or_token_right = 164; +static int32_t fcoder_metacmd_ID_seek_whitespace_down = 165; +static int32_t fcoder_metacmd_ID_seek_whitespace_down_end_line = 166; +static int32_t fcoder_metacmd_ID_seek_whitespace_left = 167; +static int32_t fcoder_metacmd_ID_seek_whitespace_right = 168; +static int32_t fcoder_metacmd_ID_seek_whitespace_up = 169; +static int32_t fcoder_metacmd_ID_seek_whitespace_up_end_line = 170; +static int32_t fcoder_metacmd_ID_select_all = 171; +static int32_t fcoder_metacmd_ID_set_bindings_choose = 172; +static int32_t fcoder_metacmd_ID_set_bindings_default = 173; +static int32_t fcoder_metacmd_ID_set_bindings_mac_default = 174; +static int32_t fcoder_metacmd_ID_set_mark = 175; +static int32_t fcoder_metacmd_ID_setup_build_bat = 176; +static int32_t fcoder_metacmd_ID_setup_build_bat_and_sh = 177; +static int32_t fcoder_metacmd_ID_setup_build_sh = 178; +static int32_t fcoder_metacmd_ID_setup_new_project = 179; +static int32_t fcoder_metacmd_ID_show_filebar = 180; +static int32_t fcoder_metacmd_ID_show_scrollbar = 181; +static int32_t fcoder_metacmd_ID_snipe_token_or_word = 182; +static int32_t fcoder_metacmd_ID_snipe_token_or_word_right = 183; +static int32_t fcoder_metacmd_ID_suppress_mouse = 184; +static int32_t fcoder_metacmd_ID_swap_buffers_between_panels = 185; +static int32_t fcoder_metacmd_ID_to_lowercase = 186; +static int32_t fcoder_metacmd_ID_to_uppercase = 187; +static int32_t fcoder_metacmd_ID_toggle_filebar = 188; +static int32_t fcoder_metacmd_ID_toggle_fullscreen = 189; +static int32_t fcoder_metacmd_ID_toggle_line_wrap = 190; +static int32_t fcoder_metacmd_ID_toggle_mouse = 191; +static int32_t fcoder_metacmd_ID_toggle_show_whitespace = 192; +static int32_t fcoder_metacmd_ID_toggle_virtual_whitespace = 193; +static int32_t fcoder_metacmd_ID_undo = 194; +static int32_t fcoder_metacmd_ID_view_buffer_other_panel = 195; +static int32_t fcoder_metacmd_ID_view_jump_list_with_lister = 196; +static int32_t fcoder_metacmd_ID_word_complete = 197; +static int32_t fcoder_metacmd_ID_write_and_auto_tab = 198; +static int32_t fcoder_metacmd_ID_write_block = 199; +static int32_t fcoder_metacmd_ID_write_character = 200; +static int32_t fcoder_metacmd_ID_write_hack = 201; +static int32_t fcoder_metacmd_ID_write_note = 202; +static int32_t fcoder_metacmd_ID_write_todo = 203; +static int32_t fcoder_metacmd_ID_write_underscore = 204; +static int32_t fcoder_metacmd_ID_write_zero_struct = 205; #endif diff --git a/4coder_generated/remapping.h b/4coder_generated/remapping.h index a609e934..2a46da6d 100644 --- a/4coder_generated/remapping.h +++ b/4coder_generated/remapping.h @@ -1,9 +1,6 @@ #if defined(CUSTOM_COMMAND_SIG) void fill_keys_default(Bind_Helper *context){ begin_map(context, mapid_global); -bind(context, 'p', MDFR_CTRL, open_panel_vsplit); -bind(context, '_', MDFR_CTRL, open_panel_hsplit); -bind(context, 'P', MDFR_CTRL, close_panel); bind(context, ',', MDFR_CTRL, change_active_panel); bind(context, '<', MDFR_CTRL, change_active_panel_backwards); bind(context, 'n', MDFR_CTRL, interactive_new); @@ -13,7 +10,6 @@ bind(context, 'k', MDFR_CTRL, interactive_kill_buffer); bind(context, 'i', MDFR_CTRL, interactive_switch_buffer); bind(context, 'h', MDFR_CTRL, project_go_to_root_directory); bind(context, 'S', MDFR_CTRL, save_all_dirty_buffers); -bind(context, 'c', MDFR_ALT, open_color_tweaker); bind(context, '.', MDFR_ALT, change_to_build_panel); bind(context, ',', MDFR_ALT, close_build_panel); bind(context, 'n', MDFR_ALT, goto_next_jump_no_skips_sticky); @@ -22,14 +18,9 @@ bind(context, 'M', MDFR_ALT, goto_first_jump_sticky); bind(context, 'm', MDFR_ALT, build_in_build_panel); bind(context, 'z', MDFR_ALT, execute_any_cli); bind(context, 'Z', MDFR_ALT, execute_previous_cli); -bind(context, 'x', MDFR_ALT, execute_arbitrary_command); -bind(context, 'W', MDFR_ALT, show_scrollbar); -bind(context, 'w', MDFR_ALT, hide_scrollbar); -bind(context, 'b', MDFR_ALT, toggle_filebar); -bind(context, '@', MDFR_ALT, toggle_mouse); +bind(context, 'x', MDFR_ALT, command_lister); +bind(context, 'I', MDFR_CTRL, list_all_functions_all_buffers_lister); bind(context, 'E', MDFR_ALT, exit_4coder); -bind(context, '+', MDFR_CTRL, increase_face_size); -bind(context, '-', MDFR_CTRL, decrease_face_size); bind(context, key_f1, MDFR_NONE, project_fkey_command); bind(context, key_f2, MDFR_NONE, project_fkey_command); bind(context, key_f3, MDFR_NONE, project_fkey_command); @@ -89,7 +80,6 @@ bind(context, 'F', MDFR_ALT, list_all_substring_locations_case_insensitive); bind(context, 'g', MDFR_CTRL, goto_line); bind(context, 'G', MDFR_CTRL, list_all_locations_of_selection); bind(context, 'K', MDFR_CTRL, kill_buffer); -bind(context, 'l', MDFR_CTRL, toggle_line_wrap); bind(context, 'L', MDFR_CTRL, duplicate_line); bind(context, 'm', MDFR_CTRL, cursor_mark_swap); bind(context, 'O', MDFR_CTRL, reopen); @@ -98,21 +88,18 @@ bind(context, 'Q', MDFR_CTRL, query_replace_identifier); bind(context, 'q', MDFR_ALT, query_replace_selection); bind(context, 'r', MDFR_CTRL, reverse_search); bind(context, 's', MDFR_CTRL, save); -bind(context, 's', MDFR_ALT, save_to_query); bind(context, 't', MDFR_CTRL, search_identifier); bind(context, 'T', MDFR_CTRL, list_all_locations_of_identifier); bind(context, 'v', MDFR_CTRL, paste_and_indent); -bind(context, 'v', MDFR_ALT, toggle_virtual_whitespace); bind(context, 'V', MDFR_CTRL, paste_next_and_indent); bind(context, 'x', MDFR_CTRL, cut); bind(context, 'y', MDFR_CTRL, redo); bind(context, 'z', MDFR_CTRL, undo); bind(context, '1', MDFR_CTRL, view_buffer_other_panel); bind(context, '2', MDFR_CTRL, swap_buffers_between_panels); -bind(context, '?', MDFR_CTRL, toggle_show_whitespace); -bind(context, '~', MDFR_CTRL, clean_all_lines); bind(context, '\n', MDFR_NONE, newline_or_goto_position_sticky); bind(context, '\n', MDFR_SHIFT, newline_or_goto_position_same_panel_sticky); +bind(context, '>', MDFR_CTRL, view_jump_list_with_lister); bind(context, ' ', MDFR_SHIFT, write_character); end_map(context); begin_map(context, default_code_map); @@ -148,7 +135,6 @@ bind(context, 'i', MDFR_ALT, if0_off); bind(context, '1', MDFR_ALT, open_file_in_quotes); bind(context, '2', MDFR_ALT, open_matching_file_cpp); bind(context, '0', MDFR_CTRL, write_zero_struct); -bind(context, 'I', MDFR_CTRL, list_all_functions_current_buffer); end_map(context); begin_map(context, default_lister_ui_map); bind_vanilla_keys(context, lister__write_character); @@ -169,9 +155,6 @@ end_map(context); } void fill_keys_mac_default(Bind_Helper *context){ begin_map(context, mapid_global); -bind(context, 'p', MDFR_CMND, open_panel_vsplit); -bind(context, '_', MDFR_CMND, open_panel_hsplit); -bind(context, 'P', MDFR_CMND, close_panel); bind(context, ',', MDFR_CMND, change_active_panel); bind(context, '<', MDFR_CMND, change_active_panel_backwards); bind(context, 'n', MDFR_CMND, interactive_new); @@ -181,7 +164,6 @@ bind(context, 'k', MDFR_CMND, interactive_kill_buffer); bind(context, 'i', MDFR_CMND, interactive_switch_buffer); bind(context, 'h', MDFR_CMND, project_go_to_root_directory); bind(context, 'S', MDFR_CMND, save_all_dirty_buffers); -bind(context, 'c', MDFR_CTRL, open_color_tweaker); bind(context, '.', MDFR_CTRL, change_to_build_panel); bind(context, ',', MDFR_CTRL, close_build_panel); bind(context, 'n', MDFR_CTRL, goto_next_jump_sticky); @@ -190,14 +172,9 @@ bind(context, 'M', MDFR_CTRL, goto_first_jump_sticky); bind(context, 'm', MDFR_CTRL, build_in_build_panel); bind(context, 'z', MDFR_CTRL, execute_any_cli); bind(context, 'Z', MDFR_CTRL, execute_previous_cli); -bind(context, 'x', MDFR_CTRL, execute_arbitrary_command); -bind(context, 'W', MDFR_CTRL, show_scrollbar); -bind(context, 'w', MDFR_CTRL, hide_scrollbar); -bind(context, 'b', MDFR_CTRL, toggle_filebar); -bind(context, '@', MDFR_CTRL, toggle_mouse); +bind(context, 'x', MDFR_CTRL, command_lister); +bind(context, 'I', MDFR_CMND, list_all_functions_all_buffers_lister); bind(context, 'E', MDFR_CTRL, exit_4coder); -bind(context, '+', MDFR_CTRL, increase_face_size); -bind(context, '-', MDFR_CTRL, decrease_face_size); bind(context, key_f1, MDFR_NONE, project_fkey_command); bind(context, key_f2, MDFR_NONE, project_fkey_command); bind(context, key_f3, MDFR_NONE, project_fkey_command); @@ -239,6 +216,8 @@ bind(context, key_right, MDFR_CMND, seek_whitespace_right); bind(context, key_left, MDFR_CMND, seek_whitespace_left); bind(context, key_up, MDFR_CMND, seek_whitespace_up_end_line); bind(context, key_down, MDFR_CMND, seek_whitespace_down_end_line); +bind(context, key_up, MDFR_ALT, move_line_up); +bind(context, key_down, MDFR_ALT, move_line_down); bind(context, key_back, MDFR_CMND, backspace_word); bind(context, key_del, MDFR_CMND, delete_word); bind(context, key_back, MDFR_CTRL, snipe_token_or_word); @@ -256,7 +235,6 @@ bind(context, 'F', MDFR_CTRL, list_all_substring_locations_case_insensitive); bind(context, 'g', MDFR_CMND, goto_line); bind(context, 'G', MDFR_CMND, list_all_locations_of_selection); bind(context, 'K', MDFR_CMND, kill_buffer); -bind(context, 'l', MDFR_CMND, toggle_line_wrap); bind(context, 'L', MDFR_CMND, duplicate_line); bind(context, 'm', MDFR_CMND, cursor_mark_swap); bind(context, 'O', MDFR_CMND, reopen); @@ -264,21 +242,18 @@ bind(context, 'q', MDFR_CMND, query_replace); bind(context, 'Q', MDFR_CMND, query_replace_identifier); bind(context, 'r', MDFR_CMND, reverse_search); bind(context, 's', MDFR_CMND, save); -bind(context, 's', MDFR_CTRL, save_to_query); bind(context, 't', MDFR_CMND, search_identifier); bind(context, 'T', MDFR_CMND, list_all_locations_of_identifier); bind(context, 'v', MDFR_CMND, paste_and_indent); -bind(context, 'v', MDFR_CTRL, toggle_virtual_whitespace); bind(context, 'V', MDFR_CMND, paste_next_and_indent); bind(context, 'x', MDFR_CMND, cut); bind(context, 'y', MDFR_CMND, redo); bind(context, 'z', MDFR_CMND, undo); bind(context, '1', MDFR_CMND, view_buffer_other_panel); bind(context, '2', MDFR_CMND, swap_buffers_between_panels); -bind(context, '?', MDFR_CMND, toggle_show_whitespace); -bind(context, '~', MDFR_CMND, clean_all_lines); bind(context, '\n', MDFR_NONE, newline_or_goto_position_sticky); bind(context, '\n', MDFR_SHIFT, newline_or_goto_position_same_panel_sticky); +bind(context, '>', MDFR_CMND, view_jump_list_with_lister); bind(context, ' ', MDFR_SHIFT, write_character); end_map(context); begin_map(context, default_code_map); @@ -314,7 +289,6 @@ bind(context, 'i', MDFR_CTRL, if0_off); bind(context, '1', MDFR_CTRL, open_file_in_quotes); bind(context, '2', MDFR_CTRL, open_matching_file_cpp); bind(context, '0', MDFR_CMND, write_zero_struct); -bind(context, 'I', MDFR_CMND, list_all_functions_current_buffer); end_map(context); begin_map(context, default_lister_ui_map); bind_vanilla_keys(context, lister__write_character); @@ -366,10 +340,7 @@ Meta_Sub_Map *sub_maps; int32_t sub_map_count; LINK_PROCS(void (*fill_keys_proc)(Bind_Helper *context);) }; -static Meta_Key_Bind fcoder_binds_for_default_mapid_global[45] = { -{0, 112, 1, "open_panel_vsplit", 17, LINK_PROCS(open_panel_vsplit)}, -{0, 95, 1, "open_panel_hsplit", 17, LINK_PROCS(open_panel_hsplit)}, -{0, 80, 1, "close_panel", 11, LINK_PROCS(close_panel)}, +static Meta_Key_Bind fcoder_binds_for_default_mapid_global[36] = { {0, 44, 1, "change_active_panel", 19, LINK_PROCS(change_active_panel)}, {0, 60, 1, "change_active_panel_backwards", 29, LINK_PROCS(change_active_panel_backwards)}, {0, 110, 1, "interactive_new", 15, LINK_PROCS(interactive_new)}, @@ -379,7 +350,6 @@ static Meta_Key_Bind fcoder_binds_for_default_mapid_global[45] = { {0, 105, 1, "interactive_switch_buffer", 25, LINK_PROCS(interactive_switch_buffer)}, {0, 104, 1, "project_go_to_root_directory", 28, LINK_PROCS(project_go_to_root_directory)}, {0, 83, 1, "save_all_dirty_buffers", 22, LINK_PROCS(save_all_dirty_buffers)}, -{0, 99, 2, "open_color_tweaker", 18, LINK_PROCS(open_color_tweaker)}, {0, 46, 2, "change_to_build_panel", 21, LINK_PROCS(change_to_build_panel)}, {0, 44, 2, "close_build_panel", 17, LINK_PROCS(close_build_panel)}, {0, 110, 2, "goto_next_jump_no_skips_sticky", 30, LINK_PROCS(goto_next_jump_no_skips_sticky)}, @@ -388,14 +358,9 @@ static Meta_Key_Bind fcoder_binds_for_default_mapid_global[45] = { {0, 109, 2, "build_in_build_panel", 20, LINK_PROCS(build_in_build_panel)}, {0, 122, 2, "execute_any_cli", 15, LINK_PROCS(execute_any_cli)}, {0, 90, 2, "execute_previous_cli", 20, LINK_PROCS(execute_previous_cli)}, -{0, 120, 2, "execute_arbitrary_command", 25, LINK_PROCS(execute_arbitrary_command)}, -{0, 87, 2, "show_scrollbar", 14, LINK_PROCS(show_scrollbar)}, -{0, 119, 2, "hide_scrollbar", 14, LINK_PROCS(hide_scrollbar)}, -{0, 98, 2, "toggle_filebar", 14, LINK_PROCS(toggle_filebar)}, -{0, 64, 2, "toggle_mouse", 12, LINK_PROCS(toggle_mouse)}, +{0, 120, 2, "command_lister", 14, LINK_PROCS(command_lister)}, +{0, 73, 1, "list_all_functions_all_buffers_lister", 37, LINK_PROCS(list_all_functions_all_buffers_lister)}, {0, 69, 2, "exit_4coder", 11, LINK_PROCS(exit_4coder)}, -{0, 43, 1, "increase_face_size", 18, LINK_PROCS(increase_face_size)}, -{0, 45, 1, "decrease_face_size", 18, LINK_PROCS(decrease_face_size)}, {0, 55315, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, {0, 55316, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, {0, 55317, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, @@ -413,7 +378,7 @@ static Meta_Key_Bind fcoder_binds_for_default_mapid_global[45] = { {0, 55329, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, {0, 55330, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, }; -static Meta_Key_Bind fcoder_binds_for_default_mapid_file[66] = { +static Meta_Key_Bind fcoder_binds_for_default_mapid_file[62] = { {1, 0, 0, "write_character", 15, LINK_PROCS(write_character)}, {0, 55308, 0, "click_set_cursor", 16, LINK_PROCS(click_set_cursor)}, {0, 55310, 0, "click_set_mark", 14, LINK_PROCS(click_set_mark)}, @@ -455,7 +420,6 @@ static Meta_Key_Bind fcoder_binds_for_default_mapid_file[66] = { {0, 103, 1, "goto_line", 9, LINK_PROCS(goto_line)}, {0, 71, 1, "list_all_locations_of_selection", 31, LINK_PROCS(list_all_locations_of_selection)}, {0, 75, 1, "kill_buffer", 11, LINK_PROCS(kill_buffer)}, -{0, 108, 1, "toggle_line_wrap", 16, LINK_PROCS(toggle_line_wrap)}, {0, 76, 1, "duplicate_line", 14, LINK_PROCS(duplicate_line)}, {0, 109, 1, "cursor_mark_swap", 16, LINK_PROCS(cursor_mark_swap)}, {0, 79, 1, "reopen", 6, LINK_PROCS(reopen)}, @@ -464,24 +428,21 @@ static Meta_Key_Bind fcoder_binds_for_default_mapid_file[66] = { {0, 113, 2, "query_replace_selection", 23, LINK_PROCS(query_replace_selection)}, {0, 114, 1, "reverse_search", 14, LINK_PROCS(reverse_search)}, {0, 115, 1, "save", 4, LINK_PROCS(save)}, -{0, 115, 2, "save_to_query", 13, LINK_PROCS(save_to_query)}, {0, 116, 1, "search_identifier", 17, LINK_PROCS(search_identifier)}, {0, 84, 1, "list_all_locations_of_identifier", 32, LINK_PROCS(list_all_locations_of_identifier)}, {0, 118, 1, "paste_and_indent", 16, LINK_PROCS(paste_and_indent)}, -{0, 118, 2, "toggle_virtual_whitespace", 25, LINK_PROCS(toggle_virtual_whitespace)}, {0, 86, 1, "paste_next_and_indent", 21, LINK_PROCS(paste_next_and_indent)}, {0, 120, 1, "cut", 3, LINK_PROCS(cut)}, {0, 121, 1, "redo", 4, LINK_PROCS(redo)}, {0, 122, 1, "undo", 4, LINK_PROCS(undo)}, {0, 49, 1, "view_buffer_other_panel", 23, LINK_PROCS(view_buffer_other_panel)}, {0, 50, 1, "swap_buffers_between_panels", 27, LINK_PROCS(swap_buffers_between_panels)}, -{0, 63, 1, "toggle_show_whitespace", 22, LINK_PROCS(toggle_show_whitespace)}, -{0, 126, 1, "clean_all_lines", 15, LINK_PROCS(clean_all_lines)}, {0, 10, 0, "newline_or_goto_position_sticky", 31, LINK_PROCS(newline_or_goto_position_sticky)}, {0, 10, 8, "newline_or_goto_position_same_panel_sticky", 42, LINK_PROCS(newline_or_goto_position_same_panel_sticky)}, +{0, 62, 1, "view_jump_list_with_lister", 26, LINK_PROCS(view_jump_list_with_lister)}, {0, 32, 8, "write_character", 15, LINK_PROCS(write_character)}, }; -static Meta_Key_Bind fcoder_binds_for_default_default_code_map[32] = { +static Meta_Key_Bind fcoder_binds_for_default_default_code_map[31] = { {0, 55300, 1, "seek_alphanumeric_or_camel_right", 32, LINK_PROCS(seek_alphanumeric_or_camel_right)}, {0, 55299, 1, "seek_alphanumeric_or_camel_left", 31, LINK_PROCS(seek_alphanumeric_or_camel_left)}, {0, 10, 0, "write_and_auto_tab", 18, LINK_PROCS(write_and_auto_tab)}, @@ -513,7 +474,6 @@ static Meta_Key_Bind fcoder_binds_for_default_default_code_map[32] = { {0, 49, 2, "open_file_in_quotes", 19, LINK_PROCS(open_file_in_quotes)}, {0, 50, 2, "open_matching_file_cpp", 22, LINK_PROCS(open_matching_file_cpp)}, {0, 48, 1, "write_zero_struct", 17, LINK_PROCS(write_zero_struct)}, -{0, 73, 1, "list_all_functions_current_buffer", 33, LINK_PROCS(list_all_functions_current_buffer)}, }; static Meta_Key_Bind fcoder_binds_for_default_default_lister_ui_map[14] = { {1, 0, 0, "lister__write_character", 23, LINK_PROCS(lister__write_character)}, @@ -532,15 +492,12 @@ static Meta_Key_Bind fcoder_binds_for_default_default_lister_ui_map[14] = { {0, 55314, 0, "lister__repaint", 15, LINK_PROCS(lister__repaint)}, }; static Meta_Sub_Map fcoder_submaps_for_default[4] = { -{"mapid_global", 12, "The following bindings apply in all situations.", 47, 0, 0, fcoder_binds_for_default_mapid_global, 45}, -{"mapid_file", 10, "The following bindings apply in general text files and most apply in code files, but some are overriden by other commands specific to code files.", 145, 0, 0, fcoder_binds_for_default_mapid_file, 66}, -{"default_code_map", 16, "The following commands only apply in files where the lexer (syntax highlighting) is turned on.", 94, "mapid_file", 10, fcoder_binds_for_default_default_code_map, 32}, +{"mapid_global", 12, "The following bindings apply in all situations.", 47, 0, 0, fcoder_binds_for_default_mapid_global, 36}, +{"mapid_file", 10, "The following bindings apply in general text files and most apply in code files, but some are overriden by other commands specific to code files.", 145, 0, 0, fcoder_binds_for_default_mapid_file, 62}, +{"default_code_map", 16, "The following commands only apply in files where the lexer (syntax highlighting) is turned on.", 94, "mapid_file", 10, fcoder_binds_for_default_default_code_map, 31}, {"default_lister_ui_map", 21, "These commands apply in 'lister mode' such as when you open a file.", 67, 0, 0, fcoder_binds_for_default_default_lister_ui_map, 14}, }; -static Meta_Key_Bind fcoder_binds_for_mac_default_mapid_global[45] = { -{0, 112, 4, "open_panel_vsplit", 17, LINK_PROCS(open_panel_vsplit)}, -{0, 95, 4, "open_panel_hsplit", 17, LINK_PROCS(open_panel_hsplit)}, -{0, 80, 4, "close_panel", 11, LINK_PROCS(close_panel)}, +static Meta_Key_Bind fcoder_binds_for_mac_default_mapid_global[36] = { {0, 44, 4, "change_active_panel", 19, LINK_PROCS(change_active_panel)}, {0, 60, 4, "change_active_panel_backwards", 29, LINK_PROCS(change_active_panel_backwards)}, {0, 110, 4, "interactive_new", 15, LINK_PROCS(interactive_new)}, @@ -550,7 +507,6 @@ static Meta_Key_Bind fcoder_binds_for_mac_default_mapid_global[45] = { {0, 105, 4, "interactive_switch_buffer", 25, LINK_PROCS(interactive_switch_buffer)}, {0, 104, 4, "project_go_to_root_directory", 28, LINK_PROCS(project_go_to_root_directory)}, {0, 83, 4, "save_all_dirty_buffers", 22, LINK_PROCS(save_all_dirty_buffers)}, -{0, 99, 1, "open_color_tweaker", 18, LINK_PROCS(open_color_tweaker)}, {0, 46, 1, "change_to_build_panel", 21, LINK_PROCS(change_to_build_panel)}, {0, 44, 1, "close_build_panel", 17, LINK_PROCS(close_build_panel)}, {0, 110, 1, "goto_next_jump_sticky", 21, LINK_PROCS(goto_next_jump_sticky)}, @@ -559,14 +515,9 @@ static Meta_Key_Bind fcoder_binds_for_mac_default_mapid_global[45] = { {0, 109, 1, "build_in_build_panel", 20, LINK_PROCS(build_in_build_panel)}, {0, 122, 1, "execute_any_cli", 15, LINK_PROCS(execute_any_cli)}, {0, 90, 1, "execute_previous_cli", 20, LINK_PROCS(execute_previous_cli)}, -{0, 120, 1, "execute_arbitrary_command", 25, LINK_PROCS(execute_arbitrary_command)}, -{0, 87, 1, "show_scrollbar", 14, LINK_PROCS(show_scrollbar)}, -{0, 119, 1, "hide_scrollbar", 14, LINK_PROCS(hide_scrollbar)}, -{0, 98, 1, "toggle_filebar", 14, LINK_PROCS(toggle_filebar)}, -{0, 64, 1, "toggle_mouse", 12, LINK_PROCS(toggle_mouse)}, +{0, 120, 1, "command_lister", 14, LINK_PROCS(command_lister)}, +{0, 73, 4, "list_all_functions_all_buffers_lister", 37, LINK_PROCS(list_all_functions_all_buffers_lister)}, {0, 69, 1, "exit_4coder", 11, LINK_PROCS(exit_4coder)}, -{0, 43, 1, "increase_face_size", 18, LINK_PROCS(increase_face_size)}, -{0, 45, 1, "decrease_face_size", 18, LINK_PROCS(decrease_face_size)}, {0, 55315, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, {0, 55316, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, {0, 55317, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, @@ -584,7 +535,7 @@ static Meta_Key_Bind fcoder_binds_for_mac_default_mapid_global[45] = { {0, 55329, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, {0, 55330, 0, "project_fkey_command", 20, LINK_PROCS(project_fkey_command)}, }; -static Meta_Key_Bind fcoder_binds_for_mac_default_mapid_file[64] = { +static Meta_Key_Bind fcoder_binds_for_mac_default_mapid_file[62] = { {1, 0, 0, "write_character", 15, LINK_PROCS(write_character)}, {1, 0, 2, "write_character", 15, LINK_PROCS(write_character)}, {0, 55308, 0, "click_set_cursor", 16, LINK_PROCS(click_set_cursor)}, @@ -608,6 +559,8 @@ static Meta_Key_Bind fcoder_binds_for_mac_default_mapid_file[64] = { {0, 55299, 4, "seek_whitespace_left", 20, LINK_PROCS(seek_whitespace_left)}, {0, 55297, 4, "seek_whitespace_up_end_line", 27, LINK_PROCS(seek_whitespace_up_end_line)}, {0, 55298, 4, "seek_whitespace_down_end_line", 29, LINK_PROCS(seek_whitespace_down_end_line)}, +{0, 55297, 2, "move_line_up", 12, LINK_PROCS(move_line_up)}, +{0, 55298, 2, "move_line_down", 14, LINK_PROCS(move_line_down)}, {0, 55296, 4, "backspace_word", 14, LINK_PROCS(backspace_word)}, {0, 55301, 4, "delete_word", 11, LINK_PROCS(delete_word)}, {0, 55296, 1, "snipe_token_or_word", 19, LINK_PROCS(snipe_token_or_word)}, @@ -625,7 +578,6 @@ static Meta_Key_Bind fcoder_binds_for_mac_default_mapid_file[64] = { {0, 103, 4, "goto_line", 9, LINK_PROCS(goto_line)}, {0, 71, 4, "list_all_locations_of_selection", 31, LINK_PROCS(list_all_locations_of_selection)}, {0, 75, 4, "kill_buffer", 11, LINK_PROCS(kill_buffer)}, -{0, 108, 4, "toggle_line_wrap", 16, LINK_PROCS(toggle_line_wrap)}, {0, 76, 4, "duplicate_line", 14, LINK_PROCS(duplicate_line)}, {0, 109, 4, "cursor_mark_swap", 16, LINK_PROCS(cursor_mark_swap)}, {0, 79, 4, "reopen", 6, LINK_PROCS(reopen)}, @@ -633,24 +585,21 @@ static Meta_Key_Bind fcoder_binds_for_mac_default_mapid_file[64] = { {0, 81, 4, "query_replace_identifier", 24, LINK_PROCS(query_replace_identifier)}, {0, 114, 4, "reverse_search", 14, LINK_PROCS(reverse_search)}, {0, 115, 4, "save", 4, LINK_PROCS(save)}, -{0, 115, 1, "save_to_query", 13, LINK_PROCS(save_to_query)}, {0, 116, 4, "search_identifier", 17, LINK_PROCS(search_identifier)}, {0, 84, 4, "list_all_locations_of_identifier", 32, LINK_PROCS(list_all_locations_of_identifier)}, {0, 118, 4, "paste_and_indent", 16, LINK_PROCS(paste_and_indent)}, -{0, 118, 1, "toggle_virtual_whitespace", 25, LINK_PROCS(toggle_virtual_whitespace)}, {0, 86, 4, "paste_next_and_indent", 21, LINK_PROCS(paste_next_and_indent)}, {0, 120, 4, "cut", 3, LINK_PROCS(cut)}, {0, 121, 4, "redo", 4, LINK_PROCS(redo)}, {0, 122, 4, "undo", 4, LINK_PROCS(undo)}, {0, 49, 4, "view_buffer_other_panel", 23, LINK_PROCS(view_buffer_other_panel)}, {0, 50, 4, "swap_buffers_between_panels", 27, LINK_PROCS(swap_buffers_between_panels)}, -{0, 63, 4, "toggle_show_whitespace", 22, LINK_PROCS(toggle_show_whitespace)}, -{0, 126, 4, "clean_all_lines", 15, LINK_PROCS(clean_all_lines)}, {0, 10, 0, "newline_or_goto_position_sticky", 31, LINK_PROCS(newline_or_goto_position_sticky)}, {0, 10, 8, "newline_or_goto_position_same_panel_sticky", 42, LINK_PROCS(newline_or_goto_position_same_panel_sticky)}, +{0, 62, 4, "view_jump_list_with_lister", 26, LINK_PROCS(view_jump_list_with_lister)}, {0, 32, 8, "write_character", 15, LINK_PROCS(write_character)}, }; -static Meta_Key_Bind fcoder_binds_for_mac_default_default_code_map[32] = { +static Meta_Key_Bind fcoder_binds_for_mac_default_default_code_map[31] = { {0, 55300, 4, "seek_alphanumeric_or_camel_right", 32, LINK_PROCS(seek_alphanumeric_or_camel_right)}, {0, 55299, 4, "seek_alphanumeric_or_camel_left", 31, LINK_PROCS(seek_alphanumeric_or_camel_left)}, {0, 10, 0, "write_and_auto_tab", 18, LINK_PROCS(write_and_auto_tab)}, @@ -682,7 +631,6 @@ static Meta_Key_Bind fcoder_binds_for_mac_default_default_code_map[32] = { {0, 49, 1, "open_file_in_quotes", 19, LINK_PROCS(open_file_in_quotes)}, {0, 50, 1, "open_matching_file_cpp", 22, LINK_PROCS(open_matching_file_cpp)}, {0, 48, 4, "write_zero_struct", 17, LINK_PROCS(write_zero_struct)}, -{0, 73, 4, "list_all_functions_current_buffer", 33, LINK_PROCS(list_all_functions_current_buffer)}, }; static Meta_Key_Bind fcoder_binds_for_mac_default_default_lister_ui_map[14] = { {1, 0, 0, "lister__write_character", 23, LINK_PROCS(lister__write_character)}, @@ -701,9 +649,9 @@ static Meta_Key_Bind fcoder_binds_for_mac_default_default_lister_ui_map[14] = { {0, 55314, 0, "lister__repaint", 15, LINK_PROCS(lister__repaint)}, }; static Meta_Sub_Map fcoder_submaps_for_mac_default[4] = { -{"mapid_global", 12, "The following bindings apply in all situations.", 47, 0, 0, fcoder_binds_for_mac_default_mapid_global, 45}, -{"mapid_file", 10, "The following bindings apply in general text files and most apply in code files, but some are overriden by other commands specific to code files.", 145, 0, 0, fcoder_binds_for_mac_default_mapid_file, 64}, -{"default_code_map", 16, "The following commands only apply in files where the lexer (syntax highlighting) is turned on.", 94, "mapid_file", 10, fcoder_binds_for_mac_default_default_code_map, 32}, +{"mapid_global", 12, "The following bindings apply in all situations.", 47, 0, 0, fcoder_binds_for_mac_default_mapid_global, 36}, +{"mapid_file", 10, "The following bindings apply in general text files and most apply in code files, but some are overriden by other commands specific to code files.", 145, 0, 0, fcoder_binds_for_mac_default_mapid_file, 62}, +{"default_code_map", 16, "The following commands only apply in files where the lexer (syntax highlighting) is turned on.", 94, "mapid_file", 10, fcoder_binds_for_mac_default_default_code_map, 31}, {"default_lister_ui_map", 21, "These commands apply in 'lister mode' such as when you open a file.", 67, 0, 0, fcoder_binds_for_mac_default_default_lister_ui_map, 14}, }; static Meta_Mapping fcoder_meta_maps[2] = { diff --git a/4coder_jump_lister.cpp b/4coder_jump_lister.cpp new file mode 100644 index 00000000..8643a32f --- /dev/null +++ b/4coder_jump_lister.cpp @@ -0,0 +1,118 @@ +/* +4coder_jump_lister.cpp - Lister for jump buffers. +*/ + +// TOP + +static Lister_Activation_Code +activate_jump(Application_Links *app, View_Summary *view, String text_field, + void *user_data, bool32 activated_by_mouse){ + int32_t list_index = (int32_t)PtrAsInt(user_data); + Lister_State *state = view_get_lister_state(view); + Jump_Lister_Parameters *params = (Jump_Lister_Parameters*)state->lister.user_data; + Marker_List *list = get_marker_list_for_buffer(params->list_buffer_id); + if (list != 0){ + Lister_Activation_Code result_code = ListerActivation_Finished; + View_Summary target_view = {0}; + switch (params->activation_rule){ + case JumpListerActivation_OpenInUIView: + { + target_view = *view; + result_code = ListerActivation_Finished; + }break; + + case JumpListerActivation_OpenInTargetViewKeepUI: + { + target_view = get_view(app, params->target_view_id, AccessAll); + result_code = ListerActivation_Continue; + }break; + + case JumpListerActivation_OpenInTargetViewCloseUI: + { + target_view = get_view(app, params->target_view_id, AccessAll); + result_code = ListerActivation_Finished; + }break; + + case JumpListerActivation_OpenInNextViewKeepUI: + { + target_view = *view; + get_next_view_looped_primary_panels(app, &target_view, AccessAll); + result_code = ListerActivation_Continue; + }break; + + case JumpListerActivation_OpenInNextViewCloseUI: + { + target_view = *view; + get_next_view_looped_primary_panels(app, &target_view, AccessAll); + result_code = ListerActivation_Finished; + }break; + } + + ID_Pos_Jump_Location location = {0}; + if (get_jump_from_list(app, list, list_index, &location)){ + Buffer_Summary buffer = {0}; + if (get_jump_buffer(app, &buffer, &location)){ + set_active_view(app, &target_view); + jump_to_location(app, &target_view, &buffer, location); + } + } + + return(result_code); + } + return(ListerActivation_Finished); +} + +static void +open_jump_lister(Application_Links *app, Partition *scratch, Heap *heap, + View_Summary *ui_view, Buffer_ID list_buffer_id, + Jump_Lister_Activation_Rule activation_rule, View_Summary *optional_target_view){ + + Marker_List *list = get_or_make_list_for_buffer(app, scratch, heap, list_buffer_id); + if (list != 0){ + Buffer_Summary list_buffer = get_buffer(app, list_buffer_id, AccessAll); + + int32_t estimated_string_space_size = 0; + view_end_ui_mode(app, ui_view); + Temp_Memory temp = begin_temp_memory(scratch); + int32_t option_count = list->jump_count; + Lister_Option *options = push_array(scratch, Lister_Option, option_count); + Managed_Object stored_jumps = list->jump_array; + for (int32_t i = 0; i < option_count; i += 1){ + Sticky_Jump_Stored stored = {0}; + managed_object_load_data(app, stored_jumps, i, 1, &stored); + String line = {0}; + read_line(app, scratch, &list_buffer, stored.list_line, &line); + options[i].string = line.str; + options[i].status = 0; + options[i].user_data = IntAsPtr(i); + int32_t aligned_size = line.size + 1 + 7; + aligned_size = aligned_size - aligned_size%8; + estimated_string_space_size += aligned_size; + } + + Jump_Lister_Parameters jump_lister_params = {0}; + jump_lister_params.list_buffer_id = list_buffer_id; + jump_lister_params.activation_rule = activation_rule; + if (optional_target_view != 0){ + jump_lister_params.target_view_id = optional_target_view->view_id; + } + + begin_integrated_lister__basic_list(app, "Jump:", activate_jump, + &jump_lister_params, sizeof(jump_lister_params), + options, option_count, + estimated_string_space_size, + ui_view); + end_temp_memory(temp); + } +} + +CUSTOM_COMMAND_SIG(view_jump_list_with_lister) +CUSTOM_DOC("When executed on a buffer with jumps, creates a persistent lister for all the jumps") +{ + View_Summary view = get_active_view(app, AccessAll); + open_jump_lister(app, &global_part, &global_heap, + &view, view.buffer_id, JumpListerActivation_OpenInNextViewKeepUI, 0); +} + +// BOTTOM + diff --git a/4coder_jump_lister.h b/4coder_jump_lister.h new file mode 100644 index 00000000..4b0426ce --- /dev/null +++ b/4coder_jump_lister.h @@ -0,0 +1,22 @@ +/* +4coder_jump_lister.h - Lister for jump buffers. +*/ + +// TOP + +typedef int32_t Jump_Lister_Activation_Rule; +enum{ + JumpListerActivation_OpenInUIView = 0, + JumpListerActivation_OpenInTargetViewKeepUI = 1, + JumpListerActivation_OpenInTargetViewCloseUI = 2, + JumpListerActivation_OpenInNextViewKeepUI = 3, + JumpListerActivation_OpenInNextViewCloseUI = 4, +}; + +struct Jump_Lister_Parameters{ + Buffer_ID list_buffer_id; + Jump_Lister_Activation_Rule activation_rule; + View_ID target_view_id; +}; + +// BOTTOM \ No newline at end of file diff --git a/4coder_jump_sticky.cpp b/4coder_jump_sticky.cpp index a6cf49fe..d9dd53b2 100644 --- a/4coder_jump_sticky.cpp +++ b/4coder_jump_sticky.cpp @@ -205,7 +205,7 @@ get_marker_list_for_buffer(Buffer_ID buffer_id){ } static Marker_List* -get_or_make_list_for_buffer(Application_Links *app, Partition *part, Heap *heap, int32_t buffer_id){ +get_or_make_list_for_buffer(Application_Links *app, Partition *scratch, Heap *heap, Buffer_ID buffer_id){ Marker_List *result = get_marker_list_for_buffer(buffer_id); if (result != 0){ Buffer_Summary buffer = get_buffer(app, buffer_id, AccessAll); @@ -217,7 +217,11 @@ get_or_make_list_for_buffer(Application_Links *app, Partition *part, Heap *heap, } if (result == 0){ result = make_new_marker_list_for_buffer(heap, buffer_id); - init_marker_list(app, part, heap, buffer_id, result); + init_marker_list(app, scratch, heap, buffer_id, result); + if (result->jump_count == 0){ + delete_marker_list(result); + result = 0; + } } return(result); } diff --git a/4coder_lists.cpp b/4coder_lists.cpp index 850aa2fe..b4a3570a 100644 --- a/4coder_lists.cpp +++ b/4coder_lists.cpp @@ -264,7 +264,7 @@ CUSTOM_DOC("A lister mode command that handles input for the fixed sure to kill if (length > 0){ void *user_data = 0; bool32 did_shortcut_key = false; - for (Lister_Option_Node *node = state->lister.options.first; + for (Lister_Node *node = state->lister.options.first; node != 0; node = node->next){ char *hotkeys = (char*)(node + 1); @@ -306,8 +306,9 @@ lister_get_fixed_list_handlers(void){ } static void -begin_integrated_lister__with_refresh_handler(Application_Links *app, char *query_string, - Lister_Handlers handlers, void *user_data, +begin_integrated_lister__with_refresh_handler(Application_Links *app, char *query_string, + Lister_Handlers handlers, + void *user_data, int32_t user_data_size, View_Summary *view){ if (handlers.refresh != 0){ Partition *scratch = &global_part; @@ -316,10 +317,9 @@ begin_integrated_lister__with_refresh_handler(Application_Links *app, char *quer view_set_setting(app, view, ViewSetting_UICommandMap, default_lister_ui_map); Lister_State *state = view_get_lister_state(view); init_lister_state(state, heap); - lister_first_init(&state->lister); + lister_first_init(&state->arena, &state->lister, user_data, user_data_size); lister_set_query_string(&state->lister, query_string); state->lister.handlers = handlers; - state->lister.user_data = user_data; handlers.refresh(app, &state->arena, &state->lister); lister_update_ui(app, scratch, view, state); } @@ -333,9 +333,42 @@ begin_integrated_lister__with_refresh_handler(Application_Links *app, char *quer } } +static void +begin_integrated_lister__basic_list(Application_Links *app, char *query_string, + Lister_Activation_Function_Type *activate, + void *user_data, int32_t user_data_size, + Lister_Option *options, int32_t option_count, + int32_t estimated_string_space_size, + View_Summary *view){ + Partition *scratch = &global_part; + Heap *heap = &global_heap; + view_start_ui_mode(app, view); + view_set_setting(app, view, ViewSetting_UICommandMap, default_lister_ui_map); + Lister_State *state = view_get_lister_state(view); + int32_t arena_size = (user_data_size + option_count*sizeof(Lister_Node) + estimated_string_space_size); + arena_size = (arena_size + (4 << 10) - 1); + arena_size = arena_size - arena_size%(4 << 10); + if (arena_size < (64 << 10)){ + arena_size = (64 << 10); + } + init_lister_state(state, heap, arena_size); + lister_first_init(&state->arena, &state->lister, user_data, user_data_size); + for (int32_t i = 0; i < option_count; i += 1){ + lister_add_item(&state->arena, &state->lister, + make_string_slowly(options[i].string), + make_string_slowly(options[i].status), + options[i].user_data, 0); + } + lister_set_query_string(&state->lister, query_string); + state->lister.handlers = lister_get_default_handlers(); + state->lister.handlers.activate = activate; + lister_update_ui(app, scratch, view, state); +} + static void begin_integrated_lister__with_fixed_options(Application_Links *app, char *query_string, - Lister_Handlers handlers, void *user_data, + Lister_Handlers handlers, + void *user_data, int32_t user_data_size, Lister_Fixed_Option *options, int32_t option_count, View_Summary *view){ Partition *scratch = &global_part; @@ -344,7 +377,7 @@ begin_integrated_lister__with_fixed_options(Application_Links *app, char *query_ view_set_setting(app, view, ViewSetting_UICommandMap, default_lister_ui_map); Lister_State *state = view_get_lister_state(view); init_lister_state(state, heap); - lister_first_init(&state->lister); + lister_first_init(&state->arena, &state->lister, user_data, user_data_size); for (int32_t i = 0; i < option_count; i += 1){ char *shortcut_chars = options[i].shortcut_chars; int32_t shortcut_chars_length = str_size(shortcut_chars); @@ -358,26 +391,27 @@ begin_integrated_lister__with_fixed_options(Application_Links *app, char *query_ lister_set_query_string(&state->lister, query_string); state->lister.handlers = handlers; state->lister.handlers.refresh = 0; - state->lister.user_data = user_data; lister_update_ui(app, scratch, view, state); } static void begin_integrated_lister__with_fixed_options(Application_Links *app, char *query_string, - Lister_Activation_Function_Type *activate, void *user_data, + Lister_Activation_Function_Type *activate, + void *user_data, int32_t user_data_size, Lister_Fixed_Option *options, int32_t option_count, View_Summary *view){ Lister_Handlers handlers = lister_get_fixed_list_handlers(); handlers.activate = activate; begin_integrated_lister__with_fixed_options(app, query_string, - handlers, user_data, + handlers, user_data, user_data_size, options, option_count, view); } static void begin_integrated_lister__ui_list(Application_Links *app, char *query_string, - Lister_Handlers handlers, void *user_data, + Lister_Handlers handlers, + void *user_data, int32_t user_data_size, Lister_UI_Option *options, int32_t option_count, View_Summary *view){ Partition *scratch = &global_part; @@ -386,7 +420,7 @@ begin_integrated_lister__ui_list(Application_Links *app, char *query_string, view_set_setting(app, view, ViewSetting_UICommandMap, default_lister_ui_map); Lister_State *state = view_get_lister_state(view); init_lister_state(state, heap); - lister_first_init(&state->lister); + lister_first_init(&state->arena, &state->lister, user_data, user_data_size); state->lister.theme_list = true; for (int32_t i = 0; i < option_count; i += 1){ lister_add_ui_item(&state->arena, &state->lister, @@ -397,19 +431,19 @@ begin_integrated_lister__ui_list(Application_Links *app, char *query_string, lister_set_query_string(&state->lister, query_string); state->lister.handlers = handlers; state->lister.handlers.refresh = 0; - state->lister.user_data = user_data; lister_update_ui(app, scratch, view, state); } static void begin_integrated_lister__ui_list(Application_Links *app, char *query_string, - Lister_Activation_Function_Type *activate, void *user_data, + Lister_Activation_Function_Type *activate, + void *user_data, int32_t user_data_size, Lister_UI_Option *options, int32_t option_count, View_Summary *view){ Lister_Handlers handlers = lister_get_default_handlers(); handlers.activate = activate; begin_integrated_lister__ui_list(app, query_string, - handlers, user_data, + handlers, user_data, user_data_size, options, option_count, view); } @@ -420,8 +454,8 @@ static void generate_all_buffers_list__output_buffer(Partition *arena, Lister *lister, Buffer_Summary buffer){ String status = {0}; switch (buffer.dirty){ - case DirtyState_UnsavedChanges: status = make_lit_string(" *"); break; - case DirtyState_UnloadedChanges: status = make_lit_string(" !"); break; + case DirtyState_UnsavedChanges: status = make_lit_string("*"); break; + case DirtyState_UnloadedChanges: status = make_lit_string("!"); break; } String buffer_name = make_string(buffer.buffer_name, buffer.buffer_name_len); lister_add_item(arena, lister, buffer_name, status, IntAsPtr(buffer.buffer_id), 0); @@ -542,7 +576,7 @@ generate_hot_directory_file_list(Application_Links *app, Partition *arena, Liste end_temp_memory(path_temp); if (buffer.exists){ - is_loaded = " LOADED"; + is_loaded = "LOADED"; switch (buffer.dirty){ case DirtyState_UnsavedChanges: status_flag = " *"; break; case DirtyState_UnloadedChanges: status_flag = " !"; break; @@ -557,25 +591,28 @@ generate_hot_directory_file_list(Application_Links *app, Partition *arena, Liste static void begin_integrated_lister__buffer_list(Application_Links *app, char *query_string, - Lister_Activation_Function_Type *activate_procedure, void *user_data, + Lister_Activation_Function_Type *activate_procedure, + void *user_data, int32_t user_data_size, View_Summary *target_view){ Lister_Handlers handlers = lister_get_default_handlers(); handlers.activate = activate_procedure; handlers.refresh = generate_all_buffers_list; - begin_integrated_lister__with_refresh_handler(app, query_string, handlers, user_data, target_view); + begin_integrated_lister__with_refresh_handler(app, query_string, handlers, user_data, user_data_size, + target_view); } static void begin_integrated_lister__file_system_list(Application_Links *app, char *query_string, Lister_Activation_Function_Type *activate_procedure, - void *user_data, + void *user_data, int32_t user_data_size, View_Summary *target_view){ Lister_Handlers handlers = lister_get_default_handlers(); handlers.activate = activate_procedure; handlers.refresh = generate_hot_directory_file_list; handlers.write_character = lister__write_character__file_path; handlers.backspace = lister__backspace_text_field__file_path; - begin_integrated_lister__with_refresh_handler(app, query_string, handlers, user_data, target_view); + begin_integrated_lister__with_refresh_handler(app, query_string, handlers, user_data, user_data_size, + target_view); } //////////////////////////////// @@ -592,7 +629,7 @@ activate_confirm_kill(Application_Links *app, View_Summary *view, String text_fi void *user_data, bool32 clicked){ int32_t behavior = (int32_t)PtrAsInt(user_data); Lister_State *state = view_get_lister_state(view); - Buffer_ID buffer_id = (Buffer_ID)(PtrAsInt(state->lister.user_data)); + Buffer_ID buffer_id = *(Buffer_ID*)(state->lister.user_data); switch (behavior){ case SureToKill_No: {}break; @@ -630,7 +667,8 @@ do_gui_sure_to_kill(Application_Links *app, Buffer_Summary *buffer, View_Summary }; int32_t option_count = sizeof(options)/sizeof(options[0]); begin_integrated_lister__with_fixed_options(app, "There are unsaved changes, close anyway?", - activate_confirm_kill, IntAsPtr(buffer->buffer_id), + activate_confirm_kill, + &buffer->buffer_id, sizeof(buffer->buffer_id), options, option_count, view); } @@ -669,7 +707,8 @@ do_gui_sure_to_close_4coder(Application_Links *app, View_Summary *view){ int32_t option_count = sizeof(options)/sizeof(options[0]); begin_integrated_lister__with_fixed_options(app, "There are one or more buffers with unsave changes, close anyway?", - activate_confirm_close_4coder, 0, + activate_confirm_close_4coder, + 0, 0, options, option_count, view); } @@ -691,7 +730,7 @@ CUSTOM_DOC("Interactively switch to an open buffer.") { View_Summary view = get_active_view(app, AccessAll); view_end_ui_mode(app, &view); - begin_integrated_lister__buffer_list(app, "Switch: ", activate_switch_buffer, 0, &view); + begin_integrated_lister__buffer_list(app, "Switch:", activate_switch_buffer, 0, 0, &view); } static Lister_Activation_Code @@ -709,7 +748,7 @@ CUSTOM_DOC("Interactively kill an open buffer.") { View_Summary view = get_active_view(app, AccessAll); view_end_ui_mode(app, &view); - begin_integrated_lister__buffer_list(app, "Kill: ", activate_kill_buffer, 0, &view); + begin_integrated_lister__buffer_list(app, "Kill:", activate_kill_buffer, 0, 0, &view); } static Lister_Activation_Code @@ -778,7 +817,7 @@ CUSTOM_DOC("Interactively open a file out of the file system.") { View_Summary view = get_active_view(app, AccessAll); view_end_ui_mode(app, &view); - begin_integrated_lister__file_system_list(app, "Open: ", activate_open_or_new, 0, &view); + begin_integrated_lister__file_system_list(app, "Open:", activate_open_or_new, 0, 0, &view); } static Lister_Activation_Code @@ -811,7 +850,7 @@ CUSTOM_DOC("Interactively creates a new file.") { View_Summary view = get_active_view(app, AccessAll); view_end_ui_mode(app, &view); - begin_integrated_lister__file_system_list(app, "New: ", activate_new, 0, &view); + begin_integrated_lister__file_system_list(app, "New:", activate_new, 0, 0, &view); } static Lister_Activation_Code @@ -838,7 +877,7 @@ CUSTOM_DOC("Interactively opens a file.") { View_Summary view = get_active_view(app, AccessAll); view_end_ui_mode(app, &view); - begin_integrated_lister__file_system_list(app, "Open: ", activate_open, 0, &view); + begin_integrated_lister__file_system_list(app, "Open:", activate_open, 0, 0, &view); } static Lister_Activation_Code @@ -866,13 +905,48 @@ CUSTOM_DOC("Opens the 4coder theme selector list.") options[i].user_data = IntAsPtr(i); } begin_integrated_lister__ui_list(app, - "Select a theme: ", - activate_select_theme, 0, + "Select a theme:", + activate_select_theme, 0, 0, options, theme_count, &view); end_temp_memory(temp); } +//////////////////////////////// + +static Lister_Activation_Code +activate_command(Application_Links *app, View_Summary *view, String text_field, + void *user_data, bool32 activated_by_mouse){ + if (user_data != 0){ + Custom_Command_Function *command = (Custom_Command_Function*)user_data; + view_end_ui_mode(app, view); + command(app); + } + return(ListerActivation_Finished); +} + +CUSTOM_COMMAND_SIG(command_lister) +CUSTOM_DOC("Opens an interactive list of all registered commands.") +{ + Partition *arena = &global_part; + + View_Summary view = get_active_view(app, AccessAll); + view_end_ui_mode(app, &view); + Temp_Memory temp = begin_temp_memory(arena); + int32_t option_count = command_one_past_last_id; + Lister_Option *options = push_array(arena, Lister_Option, option_count); + for (int32_t i = 0; i < command_one_past_last_id; i += 1){ + options[i].string = fcoder_metacmd_table[i].name; + options[i].status = fcoder_metacmd_table[i].description; + options[i].user_data = fcoder_metacmd_table[i].proc; + } + begin_integrated_lister__basic_list(app, "Command:", activate_command, 0, 0, + options, option_count, + 0, + &view); + end_temp_memory(temp); +} + // BOTTOM diff --git a/4coder_long_command_switch.cpp b/4coder_long_command_switch.cpp deleted file mode 100644 index 2ea5eb79..00000000 --- a/4coder_long_command_switch.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* -4coder_long_command_switch.cpp - Implementation of a command for executing uncommon commands -by inputting key words. -*/ - -// TOP - -CUSTOM_COMMAND_SIG(execute_arbitrary_command) -CUSTOM_DOC("Execute a 'long form' command.") -{ - Query_Bar bar = {0}; - char space[1024]; - bar.prompt = make_lit_string("Command: "); - bar.string = make_fixed_width_string(space); - if (!query_user_string(app, &bar)) return; - end_query_bar(app, &bar, 0); - - if (match(bar.string, make_lit_string("toggle fullscreen"))){ - toggle_fullscreen(app); - } - else if (match(bar.string, make_lit_string("load project"))){ - load_project(app); - } - else if (match(bar.string, make_lit_string("open all code"))){ - open_all_code(app); - } - else if (match(bar.string, make_lit_string("open all code recursive"))){ - open_all_code_recursive(app); - } - else if(match(bar.string, make_lit_string("close all code"))){ - close_all_code(app); - } - else if (match(bar.string, make_lit_string("dos lines")) || - match(bar.string, make_lit_string("dosify"))){ - eol_dosify(app); - } - else if (match(bar.string, make_lit_string("nix lines")) || - match(bar.string, make_lit_string("nixify"))){ - eol_nixify(app); - } - else if (match(bar.string, make_lit_string("remap"))){ - remap_interactive(app); - } - else if (match(bar.string, make_lit_string("new project"))){ - setup_new_project(app); - } - else if (match(bar.string, make_lit_string("new bat"))){ - setup_build_bat(app); - } - else if (match(bar.string, make_lit_string("new sh"))){ - setup_build_sh(app); - } - else if (match(bar.string, make_lit_string("new scripts"))){ - setup_build_bat_and_sh(app); - } - else if (match(bar.string, make_lit_string("delete file"))){ - delete_file_query(app); - } - else if (match(bar.string, make_lit_string("rename file"))){ - rename_file_query(app); - } - else if (match(bar.string, make_lit_string("mkdir"))){ - make_directory_query(app); - } - else if (match(bar.string, make_lit_string("reload themes"))){ - reload_themes(app); - } - else{ - print_message(app, literal("unrecognized command\n")); - } -} - -// BOTTOM - diff --git a/4coder_ui_helper.cpp b/4coder_ui_helper.cpp index dff01650..a17270b8 100644 --- a/4coder_ui_helper.cpp +++ b/4coder_ui_helper.cpp @@ -195,7 +195,7 @@ view_get_lister_state(View_Summary *view){ } static void -init_lister_state(Lister_State *state, Heap *heap){ +init_lister_state(Lister_State *state, Heap *heap, int32_t arena_size){ state->initialized = true; state->hot_user_data = 0; state->item_index = 0; @@ -204,11 +204,16 @@ init_lister_state(Lister_State *state, Heap *heap){ if (state->arena.base != 0){ heap_free(heap, state->arena.base); } - int32_t arena_size = (64 << 10); state->arena = make_part(heap_allocate(heap, arena_size), arena_size); memset(&state->lister, 0, sizeof(state->lister)); } +static void +init_lister_state(Lister_State *state, Heap *heap){ + int32_t arena_size = (64 << 10); + init_lister_state(state, heap, arena_size); +} + UI_QUIT_FUNCTION(lister_quit_function){ Lister_State *state = view_get_lister_state(&view); state->initialized = false; @@ -261,13 +266,13 @@ lister_update_ui(Application_Links *app, Partition *scratch, View_Summary *view, state->raw_item_index = -1; int32_t node_count = state->lister.options.count; - Lister_Option_Node_Ptr_Array exact_matches = {0}; - exact_matches.node_ptrs = push_array(scratch, Lister_Option_Node*, 1); - Lister_Option_Node_Ptr_Array before_extension_matches = {0}; - before_extension_matches.node_ptrs = push_array(scratch, Lister_Option_Node*, node_count); - Lister_Option_Node_Ptr_Array substring_matches = {0}; - substring_matches.node_ptrs = push_array(scratch, Lister_Option_Node*, node_count); - for (Lister_Option_Node *node = state->lister.options.first; + Lister_Node_Ptr_Array exact_matches = {0}; + exact_matches.node_ptrs = push_array(scratch, Lister_Node*, 1); + Lister_Node_Ptr_Array before_extension_matches = {0}; + before_extension_matches.node_ptrs = push_array(scratch, Lister_Node*, node_count); + Lister_Node_Ptr_Array substring_matches = {0}; + substring_matches.node_ptrs = push_array(scratch, Lister_Node*, node_count); + for (Lister_Node *node = state->lister.options.first; node != 0; node = node->next){ if (state->lister.key_string.size == 0 || @@ -286,7 +291,7 @@ lister_update_ui(Application_Links *app, Partition *scratch, View_Summary *view, } } - Lister_Option_Node_Ptr_Array node_ptr_arrays[] = { + Lister_Node_Ptr_Array node_ptr_arrays[] = { exact_matches, before_extension_matches, substring_matches, @@ -297,11 +302,10 @@ lister_update_ui(Application_Links *app, Partition *scratch, View_Summary *view, UI_Item *hot_item = 0; UI_Item *hovered_item = 0; int32_t item_index_counter = 0; - int32_t raw_index_counter = 0; for (int32_t array_index = 0; array_index < ArrayCount(node_ptr_arrays); array_index += 1){ - Lister_Option_Node_Ptr_Array node_ptr_array = node_ptr_arrays[array_index]; + Lister_Node_Ptr_Array node_ptr_array = node_ptr_arrays[array_index]; for (int32_t node_index = 0; node_index < node_ptr_array.count; node_index += 1){ - Lister_Option_Node *node = node_ptr_array.node_ptrs[node_index]; + Lister_Node *node = node_ptr_array.node_ptrs[node_index]; i32_Rect item_rect = {0}; item_rect.x0 = x0; @@ -331,15 +335,14 @@ lister_update_ui(Application_Links *app, Partition *scratch, View_Summary *view, item_rect.y0 <= my && my < item_rect.y1){ hovered_item = item_ptr; } - if (item_index_counter == state->item_index){ + if (state->item_index == item_index_counter){ highlighted_item = item_ptr; - state->raw_item_index = raw_index_counter; + state->raw_item_index = node->raw_index; } item_index_counter += 1; if (node->user_data == state->hot_user_data && hot_item != 0){ hot_item = item_ptr; } - raw_index_counter += 1; } } state->option_item_count = item_index_counter; @@ -400,11 +403,16 @@ lister_prealloced(String string){ } static void -lister_first_init(Lister *lister){ +lister_first_init(Partition *arena, Lister *lister, void *user_data, int32_t user_data_size){ memset(lister, 0, sizeof(*lister)); lister->query = make_fixed_width_string(lister->query_space); lister->text_field = make_fixed_width_string(lister->text_field_space); lister->key_string = make_fixed_width_string(lister->key_string_space); + if (user_data != 0){ + lister->user_data = push_array(arena, char, user_data_size); + push_align(arena, 8); + memcpy(lister->user_data, user_data, user_data_size); + } } static void @@ -416,10 +424,11 @@ static void* lister_add_item(Partition *arena, Lister *lister, Lister_Prealloced_String string, Lister_Prealloced_String status, void *user_data, int32_t extra_space){ - Lister_Option_Node *node = push_array(arena, Lister_Option_Node, 1); + Lister_Node *node = push_array(arena, Lister_Node, 1); node->string = string.string; node->status = status.string; node->user_data = user_data; + node->raw_index = lister->options.count; zdll_push_back(lister->options.first, lister->options.last, node); lister->options.count += 1; void *result = push_array(arena, char, extra_space); @@ -461,7 +470,7 @@ static void* lister_add_ui_item(Partition *arena, Lister *lister, Lister_Prealloced_String string, int32_t index, void *user_data, int32_t extra_space){ - Lister_Option_Node *node = push_array(arena, Lister_Option_Node, 1); + Lister_Node *node = push_array(arena, Lister_Node, 1); node->string = string.string; node->index = index; node->user_data = user_data; @@ -486,7 +495,7 @@ static void* lister_get_user_data(Lister *lister, int32_t index){ if (0 <= index && index < lister->options.count){ int32_t counter = 0; - for (Lister_Option_Node *node = lister->options.first; + for (Lister_Node *node = lister->options.first; node != 0; node = node->next){ if (counter == index){ @@ -526,8 +535,14 @@ lister_call_activate_handler(Application_Links *app, Partition *scratch, Heap *h } }break; + case ListerActivation_Continue: + { + view_start_ui_mode(app, view); + }break; + case ListerActivation_ContinueAndRefresh: { + view_start_ui_mode(app, view); state->item_index = 0; lister_call_refresh_handler(app, &state->arena, lister); lister_update_ui(app, scratch, view, state); diff --git a/4coder_ui_helper.h b/4coder_ui_helper.h index 377e77c3..94b916ad 100644 --- a/4coder_ui_helper.h +++ b/4coder_ui_helper.h @@ -19,25 +19,26 @@ typedef Lister_Activation_Code Lister_Activation_Function_Type(Application_Links typedef void Lister_Regenerate_List_Function_Type(Application_Links *app, Partition *arena, struct Lister *lister); -struct Lister_Option_Node{ - Lister_Option_Node *next; - Lister_Option_Node *prev; +struct Lister_Node{ + Lister_Node *next; + Lister_Node *prev; String string; union{ String status; int32_t index; }; void *user_data; + int32_t raw_index; }; struct Lister_Option_List{ - Lister_Option_Node *first; - Lister_Option_Node *last; + Lister_Node *first; + Lister_Node *last; int32_t count; }; -struct Lister_Option_Node_Ptr_Array{ - Lister_Option_Node **node_ptrs; +struct Lister_Node_Ptr_Array{ + Lister_Node **node_ptrs; int32_t count; }; @@ -83,6 +84,12 @@ struct Lister_State{ //////////////////////////////// +struct Lister_Option{ + char *string; + char *status; + void *user_data; +}; + struct Lister_Fixed_Option{ char *string; char *status; diff --git a/4ed_dynamic_variables.cpp b/4ed_dynamic_variables.cpp index 5eaf7921..62396c9c 100644 --- a/4ed_dynamic_variables.cpp +++ b/4ed_dynamic_variables.cpp @@ -553,6 +553,7 @@ lifetime_get_or_create_intersection_key(Heap *heap, Lifetime_Allocator *lifetime new_key = lifetime_allocator->free_keys.first; } zdll_remove(lifetime_allocator->free_keys.first, lifetime_allocator->free_keys.last, new_key); + memset(new_key, 0, sizeof(*new_key)); // Add to Objects Lifetime_Object **object_ptr = object_ptr_array; diff --git a/4ed_view_ui.cpp b/4ed_view_ui.cpp index 62bd6f33..d432e836 100644 --- a/4ed_view_ui.cpp +++ b/4ed_view_ui.cpp @@ -323,6 +323,7 @@ do_render_file_view(System_Functions *system, View *view, Models *models, GUI_Sc i32 x = (i32)inner.x0 + 3; i32 y = (i32)inner.y0 + line_height/2 - 1; x = ceil32(draw_string(system, target, font_id, item->option.string, x, y, text_color)); + x += (i32)font_string_width(system, target, font_id, " "); draw_string(system, target, font_id, item->option.status, x, y, pop_color); }break; @@ -335,6 +336,7 @@ do_render_file_view(System_Functions *system, View *view, Models *models, GUI_Sc i32 x = (i32)item_rect.x0; i32 y = (i32)item_rect.y0 + 2; x = ceil32(draw_string(system, target, font_id, item->text_field.query, x, y, text2_color)); + x += (i32)font_string_width(system, target, font_id, " "); draw_string(system, target, font_id, item->text_field.string, x, y, text1_color); }break; diff --git a/meta/4ed_metagen.cpp b/meta/4ed_metagen.cpp index 302ba912..ee4ff149 100644 --- a/meta/4ed_metagen.cpp +++ b/meta/4ed_metagen.cpp @@ -676,9 +676,6 @@ generate_remapping_code_and_data(){ // NOTE(allen): GLOBAL begin_map(mappings, mapid_global, "The following bindings apply in all situations."); - bind(mappings, 'p', MDFR_CTRL, open_panel_vsplit); - bind(mappings, '_', MDFR_CTRL, open_panel_hsplit); - bind(mappings, 'P', MDFR_CTRL, close_panel); bind(mappings, ',', MDFR_CTRL, change_active_panel); bind(mappings, '<', MDFR_CTRL, change_active_panel_backwards); @@ -690,8 +687,6 @@ generate_remapping_code_and_data(){ bind(mappings, 'h', MDFR_CTRL, project_go_to_root_directory); bind(mappings, 'S', MDFR_CTRL, save_all_dirty_buffers); - bind(mappings, 'c', MDFR_ALT, open_color_tweaker); - bind(mappings, '.', MDFR_ALT, change_to_build_panel); bind(mappings, ',', MDFR_ALT, close_build_panel); bind(mappings, 'n', MDFR_ALT, goto_next_jump_no_skips_sticky); @@ -702,18 +697,11 @@ generate_remapping_code_and_data(){ bind(mappings, 'z', MDFR_ALT, execute_any_cli); bind(mappings, 'Z', MDFR_ALT, execute_previous_cli); - bind(mappings, 'x', MDFR_ALT, execute_arbitrary_command); + bind(mappings, 'x', MDFR_ALT, command_lister); - bind(mappings, 'W', MDFR_ALT, show_scrollbar); - bind(mappings, 'w', MDFR_ALT, hide_scrollbar); - bind(mappings, 'b', MDFR_ALT, toggle_filebar); - - bind(mappings, '@', MDFR_ALT, toggle_mouse); + bind(mappings, 'I', MDFR_CTRL, list_all_functions_current_buffer_lister); bind(mappings, 'E', MDFR_ALT, exit_4coder); - bind(mappings, '+', MDFR_CTRL, increase_face_size); - bind(mappings, '-', MDFR_CTRL, decrease_face_size); - bind(mappings, key_f1, MDFR_NONE, project_fkey_command); bind(mappings, key_f2, MDFR_NONE, project_fkey_command); bind(mappings, key_f3, MDFR_NONE, project_fkey_command); @@ -786,7 +774,6 @@ generate_remapping_code_and_data(){ bind(mappings, 'g', MDFR_CTRL, goto_line); bind(mappings, 'G', MDFR_CTRL, list_all_locations_of_selection); bind(mappings, 'K', MDFR_CTRL, kill_buffer); - bind(mappings, 'l', MDFR_CTRL, toggle_line_wrap); bind(mappings, 'L', MDFR_CTRL, duplicate_line); bind(mappings, 'm', MDFR_CTRL, cursor_mark_swap); bind(mappings, 'O', MDFR_CTRL, reopen); @@ -795,11 +782,9 @@ generate_remapping_code_and_data(){ bind(mappings, 'q', MDFR_ALT , query_replace_selection); bind(mappings, 'r', MDFR_CTRL, reverse_search); bind(mappings, 's', MDFR_CTRL, save); - bind(mappings, 's', MDFR_ALT , save_to_query); bind(mappings, 't', MDFR_CTRL, search_identifier); bind(mappings, 'T', MDFR_CTRL, list_all_locations_of_identifier); bind(mappings, 'v', MDFR_CTRL, paste_and_indent); - bind(mappings, 'v', MDFR_ALT , toggle_virtual_whitespace); bind(mappings, 'V', MDFR_CTRL, paste_next_and_indent); bind(mappings, 'x', MDFR_CTRL, cut); bind(mappings, 'y', MDFR_CTRL, redo); @@ -808,10 +793,9 @@ generate_remapping_code_and_data(){ bind(mappings, '1', MDFR_CTRL, view_buffer_other_panel); bind(mappings, '2', MDFR_CTRL, swap_buffers_between_panels); - bind(mappings, '?', MDFR_CTRL, toggle_show_whitespace); - bind(mappings, '~', MDFR_CTRL, clean_all_lines); bind(mappings, '\n', MDFR_NONE, newline_or_goto_position_sticky); bind(mappings, '\n', MDFR_SHIFT, newline_or_goto_position_same_panel_sticky); + bind(mappings, '>', MDFR_CTRL, view_jump_list_with_lister); bind(mappings, ' ', MDFR_SHIFT, write_character); end_map(mappings); @@ -860,7 +844,6 @@ generate_remapping_code_and_data(){ bind(mappings, '1', MDFR_ALT, open_file_in_quotes); bind(mappings, '2', MDFR_ALT, open_matching_file_cpp); bind(mappings, '0', MDFR_CTRL, write_zero_struct); - bind(mappings, 'I', MDFR_CTRL, list_all_functions_current_buffer); end_map(mappings); @@ -892,9 +875,6 @@ generate_remapping_code_and_data(){ // NOTE(allen): GLOBAL begin_map(mappings, mapid_global, "The following bindings apply in all situations."); - bind(mappings, 'p', MDFR_CMND, open_panel_vsplit); - bind(mappings, '_', MDFR_CMND, open_panel_hsplit); - bind(mappings, 'P', MDFR_CMND, close_panel); bind(mappings, ',', MDFR_CMND, change_active_panel); bind(mappings, '<', MDFR_CMND, change_active_panel_backwards); @@ -906,8 +886,6 @@ generate_remapping_code_and_data(){ bind(mappings, 'h', MDFR_CMND, project_go_to_root_directory); bind(mappings, 'S', MDFR_CMND, save_all_dirty_buffers); - bind(mappings, 'c', MDFR_CTRL, open_color_tweaker); - bind(mappings, '.', MDFR_CTRL, change_to_build_panel); bind(mappings, ',', MDFR_CTRL, close_build_panel); bind(mappings, 'n', MDFR_CTRL, goto_next_jump_sticky); @@ -918,18 +896,11 @@ generate_remapping_code_and_data(){ bind(mappings, 'z', MDFR_CTRL, execute_any_cli); bind(mappings, 'Z', MDFR_CTRL, execute_previous_cli); - bind(mappings, 'x', MDFR_CTRL, execute_arbitrary_command); + bind(mappings, 'x', MDFR_CTRL, command_lister); - bind(mappings, 'W', MDFR_CTRL, show_scrollbar); - bind(mappings, 'w', MDFR_CTRL, hide_scrollbar); - bind(mappings, 'b', MDFR_CTRL, toggle_filebar); - - bind(mappings, '@', MDFR_CTRL, toggle_mouse); + bind(mappings, 'I', MDFR_CMND, list_all_functions_current_buffer_lister); bind(mappings, 'E', MDFR_CTRL, exit_4coder); - bind(mappings, '+', MDFR_CTRL, increase_face_size); - bind(mappings, '-', MDFR_CTRL, decrease_face_size); - bind(mappings, key_f1, MDFR_NONE, project_fkey_command); bind(mappings, key_f2, MDFR_NONE, project_fkey_command); bind(mappings, key_f3, MDFR_NONE, project_fkey_command); @@ -982,6 +953,9 @@ generate_remapping_code_and_data(){ bind(mappings, key_up, MDFR_CMND, seek_whitespace_up_end_line); bind(mappings, key_down, MDFR_CMND, seek_whitespace_down_end_line); + bind(mappings, key_up, MDFR_ALT, move_line_up); + bind(mappings, key_down, MDFR_ALT, move_line_down); + bind(mappings, key_back, MDFR_CMND, backspace_word); bind(mappings, key_del, MDFR_CMND, delete_word); bind(mappings, key_back, MDFR_CTRL, snipe_token_or_word); @@ -1000,7 +974,6 @@ generate_remapping_code_and_data(){ bind(mappings, 'g', MDFR_CMND, goto_line); bind(mappings, 'G', MDFR_CMND, list_all_locations_of_selection); bind(mappings, 'K', MDFR_CMND, kill_buffer); - bind(mappings, 'l', MDFR_CMND, toggle_line_wrap); bind(mappings, 'L', MDFR_CMND, duplicate_line); bind(mappings, 'm', MDFR_CMND, cursor_mark_swap); bind(mappings, 'O', MDFR_CMND, reopen); @@ -1008,11 +981,9 @@ generate_remapping_code_and_data(){ bind(mappings, 'Q', MDFR_CMND, query_replace_identifier); bind(mappings, 'r', MDFR_CMND, reverse_search); bind(mappings, 's', MDFR_CMND, save); - bind(mappings, 's', MDFR_CTRL, save_to_query); bind(mappings, 't', MDFR_CMND, search_identifier); bind(mappings, 'T', MDFR_CMND, list_all_locations_of_identifier); bind(mappings, 'v', MDFR_CMND, paste_and_indent); - bind(mappings, 'v', MDFR_CTRL, toggle_virtual_whitespace); bind(mappings, 'V', MDFR_CMND, paste_next_and_indent); bind(mappings, 'x', MDFR_CMND, cut); bind(mappings, 'y', MDFR_CMND, redo); @@ -1021,10 +992,9 @@ generate_remapping_code_and_data(){ bind(mappings, '1', MDFR_CMND, view_buffer_other_panel); bind(mappings, '2', MDFR_CMND, swap_buffers_between_panels); - bind(mappings, '?', MDFR_CMND, toggle_show_whitespace); - bind(mappings, '~', MDFR_CMND, clean_all_lines); bind(mappings, '\n', MDFR_NONE, newline_or_goto_position_sticky); bind(mappings, '\n', MDFR_SHIFT, newline_or_goto_position_same_panel_sticky); + bind(mappings, '>', MDFR_CMND, view_jump_list_with_lister); bind(mappings, ' ', MDFR_SHIFT, write_character); end_map(mappings); @@ -1073,7 +1043,6 @@ generate_remapping_code_and_data(){ bind(mappings, '1', MDFR_CTRL, open_file_in_quotes); bind(mappings, '2', MDFR_CTRL, open_matching_file_cpp); bind(mappings, '0', MDFR_CMND, write_zero_struct); - bind(mappings, 'I', MDFR_CMND, list_all_functions_current_buffer); end_map(mappings); diff --git a/site/source_material/binding_list.txt b/site/source_material/binding_list.txt index e358d74b..a2d37501 100644 --- a/site/source_material/binding_list.txt +++ b/site/source_material/binding_list.txt @@ -27,9 +27,6 @@ Long name commands that can be typed in after using the "long command" command f \SECTION{mapid-global} The following bindings apply in all situations. \LIST -\ITEM \STYLE{code} \END Create a new panel by vertically splitting the active panel. -\ITEM \STYLE{code} \END Create a new panel by horizontally splitting the active panel. -\ITEM \STYLE{code} \END Closes the currently active panel if it is not the only panel open. \ITEM \STYLE{code} \END Change the currently active panel, moving to the panel with the next highest view_id. \ITEM \STYLE{code} \END Change the currently active panel, moving to the panel with the next lowest view_id. \ITEM \STYLE{code} \END Interactively creates a new file. @@ -39,7 +36,6 @@ The following bindings apply in all situations. \ITEM \STYLE{code} \END Interactively switch to an open buffer. \ITEM \STYLE{code} \END Changes 4coder's hot directory to the root directory of the currently loaded project. With no loaded project nothing hapepns. \ITEM \STYLE{code} \END Saves all buffers marked dirty (showing the '*' indicator). -\ITEM \STYLE{code} \END Opens the 4coder theme selector list. \ITEM \STYLE{code} \END If the special build panel is open, makes the build panel the active panel. \ITEM \STYLE{code} \END If the special build panel is open, closes it. \ITEM \STYLE{code} \END 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. @@ -48,14 +44,8 @@ The following bindings apply in all situations. \ITEM \STYLE{code} \END 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. \ITEM \STYLE{code} \END Queries for an output buffer name and system command, runs the system command as a CLI and prints the output to the specified buffer. \ITEM \STYLE{code} \END If the command execute_any_cli has already been used, this will execute a CLI reusing the most recent buffer name and command. -\ITEM \STYLE{code} \END Execute a 'long form' command. -\ITEM \STYLE{code} \END Sets the current view to show it's scrollbar. -\ITEM \STYLE{code} \END Sets the current view to hide it's scrollbar. -\ITEM \STYLE{code} \END Toggles the visibility status of the current view's filebar. -\ITEM \STYLE{code} \END Toggles the mouse suppression mode, see suppress_mouse and allow_mouse. +\ITEM \STYLE{code} \END Opens an interactive list of all registered commands. \ITEM \STYLE{code} \END Attempts to close 4coder. -\ITEM \STYLE{code} \END Increase the size of the face used by the current buffer. -\ITEM \STYLE{code} \END Decrease the size of the face used by the current buffer. \ITEM \STYLE{code} \END 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. \ITEM \STYLE{code} \END 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. \ITEM \STYLE{code} \END 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. @@ -118,7 +108,6 @@ The following bindings apply in general text files and most apply in code files, \ITEM \STYLE{code} \END Queries the user for a number, and jumps the cursor to the corresponding line. \ITEM \STYLE{code} \END Reads the string in the selected range and lists all exact case-sensitive mathces in all open buffers. \ITEM \STYLE{code} \END Kills the current buffer. -\ITEM \STYLE{code} \END Toggles the current buffer's line wrapping status. \ITEM \STYLE{code} \END Create a copy of the line on which the cursor sits. \ITEM \STYLE{code} \END Swaps the position of the cursor and the mark. \ITEM \STYLE{code} \END Reopen the current buffer from the hard drive. @@ -127,21 +116,18 @@ The following bindings apply in general text files and most apply in code files, \ITEM \STYLE{code} \END Queries the user for a string, and incrementally replace every occurence of the string found in the selected range with the specified string. \ITEM \STYLE{code} \END Begins an incremental search up through the current buffer for a user specified string. \ITEM \STYLE{code} \END Saves the current buffer. -\ITEM \STYLE{code} \END Queries the user for a name and saves the contents of the current buffer, altering the buffer's name too. \ITEM \STYLE{code} \END Begins an incremental search down through the current buffer for the word or token under the cursor. \ITEM \STYLE{code} \END Reads a token or word under the cursor and lists all exact case-sensitive mathces in all open buffers. \ITEM \STYLE{code} \END Paste from the top of clipboard and run auto-indent on the newly pasted text. -\ITEM \STYLE{code} \END Toggles the current buffer's virtual whitespace status. \ITEM \STYLE{code} \END Paste the next item on the clipboard and run auto-indent on the newly pasted text. \ITEM \STYLE{code} \END Cut the text in the range from the cursor to the mark onto the clipboard. \ITEM \STYLE{code} \END Advances forewards through the undo history. \ITEM \STYLE{code} \END Advances backwards through the undo history. \ITEM \STYLE{code} \END Set the other non-active panel to view the buffer that the active panel views, and switch to that panel. \ITEM \STYLE{code} \END Set the other non-active panel to view the buffer that the active panel views, and switch to that panel. -\ITEM \STYLE{code} \END Toggles the current buffer's whitespace visibility status. -\ITEM \STYLE{code} \END Removes trailing whitespace from all lines in the current buffer. \ITEM \STYLE{code} \END If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor. \ITEM \STYLE{code} \END If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor_same_panel. +\ITEM \STYLE{code} > \END When executed on a buffer with jumps, creates a persistent lister for all the jumps \ITEM \STYLE{code} \END Inserts whatever character was used to trigger this command. \END \END @@ -179,7 +165,7 @@ The following commands only apply in files where the lexer (syntax highlighting) \ITEM \STYLE{code} \END Reads a filename from surrounding '"' characters and attempts to open the corresponding file. \ITEM \STYLE{code} \END If the current file is a *.cpp or *.h, attempts to open the corresponding *.h or *.cpp file in the other view. \ITEM \STYLE{code} \END At the cursor, insert a ' = {0};'. -\ITEM \STYLE{code} \END Creates a jump list of lines of the current buffer that appear to define or declare functions. +\ITEM \STYLE{code} \END Creates a lister of locations that look like function definitions and declarations in the buffer. \END \END \SECTION{default-lister-ui-map} diff --git a/todo.txt b/todo.txt index 2f5d6520..aeac259b 100644 --- a/todo.txt +++ b/todo.txt @@ -3,8 +3,24 @@ { Features { - [] Command Lister - [] Function Lister + [] fix the thing with thing in the lister thing with lister command things. + [] Cool Listers + { + [x] Command Lister + [x] Convert Jump List to Lister + [x] Function Lister + { + [x] Automatically Make Lister for Function List + [x] Make List For All Buffers + } + [] Snippet Lister + [] Turbo-Word-Complete Lister + [] Project Command Lister + [] Project FKey Remapper + [] Project Mode Lister + } + [] Clip-Box inside UI rects (or at least stop the string before it overflows.) + [] Automatically insert a space after the main name [] Color Pallette Expansion For Keywords [] Color Pallette Expansion For Paren/Brace Matching [] Visible Markers