From 23e2c5489f4519de25a93801e0953a156bd1a74d Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Fri, 10 Aug 2018 14:52:57 -0700 Subject: [PATCH 1/4] Color Theme Lister --- 4coder_API/types.h | 18 +- 4coder_base_commands.cpp | 12 - 4coder_generated/app_functions.h | 21 ++ 4coder_generated/command_metadata.h | 402 ++++++++++++++-------------- 4coder_helper.h | 9 +- 4coder_lists.cpp | 92 ++++++- 4coder_ui_helper.cpp | 52 +++- 4coder_ui_helper.h | 12 +- 4ed_api_implementation.cpp | 91 ++++++- 4ed_defines.h | 5 + 4ed_math.h | 10 + 4ed_style.h | 3 +- 4ed_view_ui.cpp | 55 +++- themes/theme-sunlight.4coder | 38 +++ 14 files changed, 570 insertions(+), 250 deletions(-) create mode 100644 themes/theme-sunlight.4coder diff --git a/4coder_API/types.h b/4coder_API/types.h index 5268ffa8..e456b483 100644 --- a/4coder_API/types.h +++ b/4coder_API/types.h @@ -698,6 +698,7 @@ STRUCT Event_Message{ ENUM(int16_t, UI_Item_Type){ UIType_Option, UIType_TextField, + UIType_ColorTheme, }; ENUM(int8_t, UI_Activation_Level){ @@ -718,10 +719,19 @@ STRUCT UI_Item{ UI_Coordinate_System coordinates; // 32-bits of padding to fill here union{ - String query; - String status; + struct{ + String string; + String status; + } option; + struct{ + String query; + String string; + } text_field; + struct{ + String string; + int32_t index; + } color_theme; }; - String string; void *user_data; i32_Rect rectangle; }; @@ -832,7 +842,7 @@ STRUCT Buffer_Batch_Edit{ TYPEDEF void Custom_Command_Function(struct Application_Links *app); #if defined(CUSTOM_COMMAND_SIG) || defined(CUSTOM_DOC) || defined(CUSTOM_ALIAS) -#error Please don't define CUSTOM_COMMAND_SIG, CUSTOM_DOC, or CUSTOM_ALIAS +#error Please do not define CUSTOM_COMMAND_SIG, CUSTOM_DOC, or CUSTOM_ALIAS #endif #if !defined(META_PASS) diff --git a/4coder_base_commands.cpp b/4coder_base_commands.cpp index 720136c9..5f8ca3a5 100644 --- a/4coder_base_commands.cpp +++ b/4coder_base_commands.cpp @@ -1462,18 +1462,6 @@ CUSTOM_DOC("Saves the current buffer.") exec_command(app, cmdid_save); } -CUSTOM_COMMAND_SIG(open_color_tweaker) -CUSTOM_DOC("Opens the 4coder colors and fonts selector menu.") -{ - // TODO(allen): TODO(allen): TODO(allen): TODO(allen): TODO(allen): TODO(allen): TODO(allen): - // TODO(allen): TODO(allen): TODO(allen): TODO(allen): TODO(allen): TODO(allen): - // TODO(allen): TODO(allen): TODO(allen): TODO(allen): TODO(allen): - // TODO(allen): TODO(allen): TODO(allen): TODO(allen): - // TODO(allen): TODO(allen): TODO(allen): - // TODO(allen): TODO(allen): - // TODO(allen): -} - //////////////////////////////// CUSTOM_COMMAND_SIG(open_in_other) diff --git a/4coder_generated/app_functions.h b/4coder_generated/app_functions.h index 44ab436c..f76cadcf 100644 --- a/4coder_generated/app_functions.h +++ b/4coder_generated/app_functions.h @@ -62,8 +62,11 @@ struct Application_Links; #define START_QUERY_BAR_SIG(n) bool32 n(Application_Links *app, Query_Bar *bar, uint32_t flags) #define END_QUERY_BAR_SIG(n) void n(Application_Links *app, Query_Bar *bar, uint32_t flags) #define PRINT_MESSAGE_SIG(n) void n(Application_Links *app, char *str, int32_t len) +#define GET_THEME_COUNT_SIG(n) int32_t n(Application_Links *app) +#define GET_THEME_NAME_SIG(n) String n(Application_Links *app, Partition *arena, int32_t index) #define CREATE_THEME_SIG(n) void n(Application_Links *app, Theme *theme, char *name, int32_t len) #define CHANGE_THEME_SIG(n) void n(Application_Links *app, char *name, int32_t len) +#define CHANGE_THEME_BY_INDEX_SIG(n) bool32 n(Application_Links *app, int32_t index) #define GET_LARGEST_FACE_ID_SIG(n) Face_ID n(Application_Links *app) #define SET_GLOBAL_FACE_SIG(n) bool32 n(Application_Links *app, Face_ID id, bool32 apply_to_all_buffers) #define BUFFER_SET_FACE_SIG(n) bool32 n(Application_Links *app, Buffer_Summary *buffer, Face_ID id) @@ -155,8 +158,11 @@ typedef GET_MOUSE_STATE_SIG(Get_Mouse_State_Function); typedef START_QUERY_BAR_SIG(Start_Query_Bar_Function); typedef END_QUERY_BAR_SIG(End_Query_Bar_Function); typedef PRINT_MESSAGE_SIG(Print_Message_Function); +typedef GET_THEME_COUNT_SIG(Get_Theme_Count_Function); +typedef GET_THEME_NAME_SIG(Get_Theme_Name_Function); typedef CREATE_THEME_SIG(Create_Theme_Function); typedef CHANGE_THEME_SIG(Change_Theme_Function); +typedef CHANGE_THEME_BY_INDEX_SIG(Change_Theme_By_Index_Function); typedef GET_LARGEST_FACE_ID_SIG(Get_Largest_Face_ID_Function); typedef SET_GLOBAL_FACE_SIG(Set_Global_Face_Function); typedef BUFFER_SET_FACE_SIG(Buffer_Set_Face_Function); @@ -250,8 +256,11 @@ Get_Mouse_State_Function *get_mouse_state; Start_Query_Bar_Function *start_query_bar; End_Query_Bar_Function *end_query_bar; Print_Message_Function *print_message; +Get_Theme_Count_Function *get_theme_count; +Get_Theme_Name_Function *get_theme_name; Create_Theme_Function *create_theme; Change_Theme_Function *change_theme; +Change_Theme_By_Index_Function *change_theme_by_index; Get_Largest_Face_ID_Function *get_largest_face_id; Set_Global_Face_Function *set_global_face; Buffer_Set_Face_Function *buffer_set_face; @@ -344,8 +353,11 @@ Get_Mouse_State_Function *get_mouse_state_; Start_Query_Bar_Function *start_query_bar_; End_Query_Bar_Function *end_query_bar_; Print_Message_Function *print_message_; +Get_Theme_Count_Function *get_theme_count_; +Get_Theme_Name_Function *get_theme_name_; Create_Theme_Function *create_theme_; Change_Theme_Function *change_theme_; +Change_Theme_By_Index_Function *change_theme_by_index_; Get_Largest_Face_ID_Function *get_largest_face_id_; Set_Global_Face_Function *set_global_face_; Buffer_Set_Face_Function *buffer_set_face_; @@ -446,8 +458,11 @@ app_links->get_mouse_state_ = Get_Mouse_State;\ app_links->start_query_bar_ = Start_Query_Bar;\ app_links->end_query_bar_ = End_Query_Bar;\ app_links->print_message_ = Print_Message;\ +app_links->get_theme_count_ = Get_Theme_Count;\ +app_links->get_theme_name_ = Get_Theme_Name;\ app_links->create_theme_ = Create_Theme;\ app_links->change_theme_ = Change_Theme;\ +app_links->change_theme_by_index_ = Change_Theme_By_Index;\ app_links->get_largest_face_id_ = Get_Largest_Face_ID;\ app_links->set_global_face_ = Set_Global_Face;\ app_links->buffer_set_face_ = Buffer_Set_Face;\ @@ -540,8 +555,11 @@ static inline Mouse_State get_mouse_state(Application_Links *app){return(app->ge static inline bool32 start_query_bar(Application_Links *app, Query_Bar *bar, uint32_t flags){return(app->start_query_bar(app, bar, flags));} static inline void end_query_bar(Application_Links *app, Query_Bar *bar, uint32_t flags){(app->end_query_bar(app, bar, flags));} static inline void print_message(Application_Links *app, char *str, int32_t len){(app->print_message(app, str, len));} +static inline int32_t get_theme_count(Application_Links *app){return(app->get_theme_count(app));} +static inline String get_theme_name(Application_Links *app, Partition *arena, int32_t index){return(app->get_theme_name(app, arena, index));} static inline void create_theme(Application_Links *app, Theme *theme, char *name, int32_t len){(app->create_theme(app, theme, name, len));} static inline void change_theme(Application_Links *app, char *name, int32_t len){(app->change_theme(app, name, len));} +static inline bool32 change_theme_by_index(Application_Links *app, int32_t index){return(app->change_theme_by_index(app, index));} static inline Face_ID get_largest_face_id(Application_Links *app){return(app->get_largest_face_id(app));} static inline bool32 set_global_face(Application_Links *app, Face_ID id, bool32 apply_to_all_buffers){return(app->set_global_face(app, id, apply_to_all_buffers));} static inline bool32 buffer_set_face(Application_Links *app, Buffer_Summary *buffer, Face_ID id){return(app->buffer_set_face(app, buffer, id));} @@ -634,8 +652,11 @@ static inline Mouse_State get_mouse_state(Application_Links *app){return(app->ge static inline bool32 start_query_bar(Application_Links *app, Query_Bar *bar, uint32_t flags){return(app->start_query_bar_(app, bar, flags));} static inline void end_query_bar(Application_Links *app, Query_Bar *bar, uint32_t flags){(app->end_query_bar_(app, bar, flags));} static inline void print_message(Application_Links *app, char *str, int32_t len){(app->print_message_(app, str, len));} +static inline int32_t get_theme_count(Application_Links *app){return(app->get_theme_count_(app));} +static inline String get_theme_name(Application_Links *app, Partition *arena, int32_t index){return(app->get_theme_name_(app, arena, index));} static inline void create_theme(Application_Links *app, Theme *theme, char *name, int32_t len){(app->create_theme_(app, theme, name, len));} static inline void change_theme(Application_Links *app, char *name, int32_t len){(app->change_theme_(app, name, len));} +static inline bool32 change_theme_by_index(Application_Links *app, int32_t index){return(app->change_theme_by_index_(app, index));} static inline Face_ID get_largest_face_id(Application_Links *app){return(app->get_largest_face_id_(app));} static inline bool32 set_global_face(Application_Links *app, Face_ID id, bool32 apply_to_all_buffers){return(app->set_global_face_(app, id, apply_to_all_buffers));} static inline bool32 buffer_set_face(Application_Links *app, Buffer_Summary *buffer, Face_ID id){return(app->buffer_set_face_(app, buffer, id));} diff --git a/4coder_generated/command_metadata.h b/4coder_generated/command_metadata.h index c6388db5..658a8d1b 100644 --- a/4coder_generated/command_metadata.h +++ b/4coder_generated/command_metadata.h @@ -222,207 +222,207 @@ int32_t source_name_len; int32_t line_number; }; static Command_Metadata fcoder_metacmd_table[201] = { -{ 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", 43, 191 }, -{ 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", 37, 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", 37, 733 }, -{ PROC_LINKS(auto_tab_whole_file, 0), "auto_tab_whole_file", 19, "Audo-indents the entire current buffer.", 39, "w:\\4ed\\code\\4coder_auto_indent.cpp", 37, 712 }, -{ PROC_LINKS(backspace_char, 0), "backspace_char", 14, "Deletes the character to the left of the cursor.", 48, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 67 }, -{ PROC_LINKS(backspace_word, 0), "backspace_word", 14, "Delete characters between the cursor position and the first alphanumeric boundary to the left.", 94, "w:\\4ed\\code\\4coder_seek.cpp", 30, 1247 }, -{ PROC_LINKS(basic_change_active_panel, 0), "basic_change_active_panel", 25, "Change the currently active panel, moving to the panel with the next highest view_id. Will not skipe the build panel if it is open.", 132, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 433 }, -{ PROC_LINKS(build_in_build_panel, 0), "build_in_build_panel", 20, "Looks for a build.bat, build.sh, or makefile in the current and parent directories. Runs the first that it finds and prints the output to *compilation*. Puts the *compilation* buffer in a panel at the footer of the current view.", 230, "w:\\4ed\\code\\4coder_build_commands.cpp", 40, 187 }, -{ PROC_LINKS(build_search, 0), "build_search", 12, "Looks for a build.bat, build.sh, or makefile in the current and parent directories. Runs the first that it finds and prints the output to *compilation*.", 153, "w:\\4ed\\code\\4coder_build_commands.cpp", 40, 155 }, -{ PROC_LINKS(center_view, 0), "center_view", 11, "Centers the view vertically on the line on which the cursor sits.", 65, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 120 }, -{ PROC_LINKS(change_active_panel, 0), "change_active_panel", 19, "Change the currently active panel, moving to the panel with the next highest view_id.", 85, "w:\\4ed\\code\\4coder_default_framework.cpp", 43, 133 }, -{ PROC_LINKS(change_active_panel_backwards, 0), "change_active_panel_backwards", 29, "Change the currently active panel, moving to the panel with the next lowest view_id.", 84, "w:\\4ed\\code\\4coder_default_framework.cpp", 43, 143 }, -{ PROC_LINKS(change_to_build_panel, 0), "change_to_build_panel", 21, "If the special build panel is open, makes the build panel the active panel.", 75, "w:\\4ed\\code\\4coder_build_commands.cpp", 40, 209 }, -{ PROC_LINKS(clean_all_lines, 0), "clean_all_lines", 15, "Removes trailing whitespace from all lines in the current buffer.", 65, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 368 }, -{ PROC_LINKS(click_set_cursor, 0), "click_set_cursor", 16, "Sets the cursor position to the mouse position.", 47, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 174 }, -{ PROC_LINKS(click_set_mark, 0), "click_set_mark", 14, "Sets the mark position to the mouse position.", 45, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 187 }, -{ PROC_LINKS(close_all_code, 0), "close_all_code", 14, "Closes any buffer with a filename ending with an extension configured to be recognized as a code file type.", 107, "w:\\4ed\\code\\4coder_project_commands.cpp", 42, 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", 40, 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", 39, 441 }, -{ 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", 35, 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", 39, 95 }, -{ 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", 35, 35 }, -{ PROC_LINKS(decrease_face_size, 0), "decrease_face_size", 18, "Decrease the size of the face used by the current buffer.", 57, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 531 }, -{ PROC_LINKS(decrease_line_wrap, 0), "decrease_line_wrap", 18, "Decrases the current buffer's width for line wrapping.", 54, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 508 }, -{ PROC_LINKS(delete_char, 0), "delete_char", 11, "Deletes the character to the right of the cursor.", 49, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 49 }, -{ PROC_LINKS(delete_current_scope, 0), "delete_current_scope", 20, "Deletes the braces surrounding the currently selected scope. Leaves the contents within the scope.", 99, "w:\\4ed\\code\\4coder_scope_commands.cpp", 40, 487 }, -{ PROC_LINKS(delete_file_query, 0), "delete_file_query", 17, "Deletes the file of the current buffer if 4coder has the appropriate access rights. Will ask the user for confirmation first.", 125, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 1012 }, -{ PROC_LINKS(delete_line, 0), "delete_line", 11, "Delete the line the on which the cursor sits.", 45, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 1262 }, -{ PROC_LINKS(delete_range, 0), "delete_range", 12, "Deletes the text in the range between the cursor and the mark.", 62, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 107 }, -{ PROC_LINKS(delete_word, 0), "delete_word", 11, "Delete characters between the cursor position and the first alphanumeric boundary to the right.", 95, "w:\\4ed\\code\\4coder_seek.cpp", 30, 1253 }, -{ PROC_LINKS(duplicate_line, 0), "duplicate_line", 14, "Create a copy of the line on which the cursor sits.", 51, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 1240 }, -{ PROC_LINKS(eol_dosify, 0), "eol_dosify", 10, "Puts the buffer in DOS line ending mode.", 40, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 561 }, -{ PROC_LINKS(eol_nixify, 0), "eol_nixify", 10, "Puts the buffer in NIX line ending mode.", 40, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 569 }, -{ PROC_LINKS(execute_any_cli, 0), "execute_any_cli", 15, "Queries for an output buffer name and system command, runs the system command as a CLI and prints the output to the specified buffer.", 133, "w:\\4ed\\code\\4coder_system_command.cpp", 40, 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", 45, 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", 40, 7 }, -{ PROC_LINKS(exit_4coder, 0), "exit_4coder", 11, "Attempts to close 4coder.", 25, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 577 }, -{ 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", 30, 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", 30, 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", 37, 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", 37, 533 }, -{ PROC_LINKS(goto_first_jump_sticky, 0), "goto_first_jump_sticky", 22, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer.", 95, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 37, 515 }, -{ PROC_LINKS(goto_jump_at_cursor_direct, 0), "goto_jump_at_cursor_direct", 26, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in another view and changes the active panel to the view containing the jump.", 187, "w:\\4ed\\code\\4coder_jump_direct.cpp", 37, 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", 37, 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", 37, 365 }, -{ PROC_LINKS(goto_jump_at_cursor_sticky, 0), "goto_jump_at_cursor_sticky", 26, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in another view and changes the active panel to the view containing the jump.", 187, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 37, 337 }, -{ 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", 39, 585 }, -{ PROC_LINKS(goto_next_jump_direct, 0), "goto_next_jump_direct", 21, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, skipping sub jump locations.", 123, "w:\\4ed\\code\\4coder_jump_direct.cpp", 37, 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", 37, 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", 37, 484 }, -{ PROC_LINKS(goto_next_jump_sticky, 0), "goto_next_jump_sticky", 21, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, skipping sub jump locations.", 123, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 37, 454 }, -{ PROC_LINKS(goto_prev_jump_direct, 0), "goto_prev_jump_direct", 21, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, skipping sub jump locations.", 127, "w:\\4ed\\code\\4coder_jump_direct.cpp", 37, 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", 37, 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", 37, 500 }, -{ PROC_LINKS(goto_prev_jump_sticky, 0), "goto_prev_jump_sticky", 21, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, skipping sub jump locations.", 127, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 37, 470 }, -{ 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", 39, 471 }, -{ 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", 39, 457 }, -{ PROC_LINKS(highlight_next_scope_absolute, 0), "highlight_next_scope_absolute", 29, "Finds the first scope started by '{' after the cursor and puts the cursor and mark on the '{' and '}'.", 102, "w:\\4ed\\code\\4coder_scope_commands.cpp", 40, 363 }, -{ PROC_LINKS(highlight_prev_scope_absolute, 0), "highlight_prev_scope_absolute", 29, "Finds the first scope started by '{' before the cursor and puts the cursor and mark on the '{' and '}'.", 103, "w:\\4ed\\code\\4coder_scope_commands.cpp", 40, 382 }, -{ PROC_LINKS(highlight_surrounding_scope, 0), "highlight_surrounding_scope", 27, "Finds the scope enclosed by '{' '}' surrounding the cursor and puts the cursor and mark on the '{' and '}'.", 107, "w:\\4ed\\code\\4coder_scope_commands.cpp", 40, 341 }, -{ PROC_LINKS(if0_off, 0), "if0_off", 7, "Surround the range between the cursor and mark with an '#if 0' and an '#endif'", 78, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 49, 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", 39, 519 }, -{ 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", 39, 497 }, -{ PROC_LINKS(interactive_kill_buffer, 0), "interactive_kill_buffer", 23, "Interactively kill an open buffer.", 34, "w:\\4ed\\code\\4coder_lists.cpp", 31, 608 }, -{ PROC_LINKS(interactive_new, 0), "interactive_new", 15, "Interactively creates a new file.", 33, "w:\\4ed\\code\\4coder_lists.cpp", 31, 710 }, -{ PROC_LINKS(interactive_open, 0), "interactive_open", 16, "Interactively opens a file.", 27, "w:\\4ed\\code\\4coder_lists.cpp", 31, 737 }, -{ 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", 31, 677 }, -{ PROC_LINKS(interactive_switch_buffer, 0), "interactive_switch_buffer", 25, "Interactively switch to an open buffer.", 39, "w:\\4ed\\code\\4coder_lists.cpp", 31, 590 }, -{ PROC_LINKS(kill_buffer, 0), "kill_buffer", 11, "Kills the current buffer.", 25, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 1432 }, -{ 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", 39, 135 }, -{ PROC_LINKS(list_all_functions_current_buffer, 0), "list_all_functions_current_buffer", 33, "Creates a jump list of lines of the current buffer that appear to define or declare functions.", 94, "w:\\4ed\\code\\4coder_function_list.cpp", 39, 318 }, -{ PROC_LINKS(list_all_locations, 0), "list_all_locations", 18, "Queries the user for a string and lists all exact case-sensitive matches found in all open buffers.", 99, "w:\\4ed\\code\\4coder_search.cpp", 32, 741 }, -{ PROC_LINKS(list_all_locations_case_insensitive, 0), "list_all_locations_case_insensitive", 35, "Queries the user for a string and lists all exact case-insensitive matches found in all open buffers.", 101, "w:\\4ed\\code\\4coder_search.cpp", 32, 753 }, -{ PROC_LINKS(list_all_locations_of_identifier, 0), "list_all_locations_of_identifier", 32, "Reads a token or word under the cursor and lists all exact case-sensitive mathces in all open buffers.", 102, "w:\\4ed\\code\\4coder_search.cpp", 32, 765 }, -{ PROC_LINKS(list_all_locations_of_identifier_case_insensitive, 0), "list_all_locations_of_identifier_case_insensitive", 49, "Reads a token or word under the cursor and lists all exact case-insensitive mathces in all open buffers.", 104, "w:\\4ed\\code\\4coder_search.cpp", 32, 771 }, -{ PROC_LINKS(list_all_locations_of_selection, 0), "list_all_locations_of_selection", 31, "Reads the string in the selected range and lists all exact case-sensitive mathces in all open buffers.", 102, "w:\\4ed\\code\\4coder_search.cpp", 32, 777 }, -{ PROC_LINKS(list_all_locations_of_selection_case_insensitive, 0), "list_all_locations_of_selection_case_insensitive", 48, "Reads the string in the selected range and lists all exact case-insensitive mathces in all open buffers.", 104, "w:\\4ed\\code\\4coder_search.cpp", 32, 783 }, -{ PROC_LINKS(list_all_locations_of_type_definition, 0), "list_all_locations_of_type_definition", 37, "Queries user for string, lists all locations of strings that appear to define a type whose name matches the input string.", 121, "w:\\4ed\\code\\4coder_search.cpp", 32, 789 }, -{ PROC_LINKS(list_all_locations_of_type_definition_of_identifier, 0), "list_all_locations_of_type_definition_of_identifier", 51, "Reads a token or word under the cursor and lists all locations of strings that appear to define a type whose name matches it.", 125, "w:\\4ed\\code\\4coder_search.cpp", 32, 800 }, -{ PROC_LINKS(list_all_substring_locations, 0), "list_all_substring_locations", 28, "Queries the user for a string and lists all case-sensitive substring matches found in all open buffers.", 103, "w:\\4ed\\code\\4coder_search.cpp", 32, 747 }, -{ PROC_LINKS(list_all_substring_locations_case_insensitive, 0), "list_all_substring_locations_case_insensitive", 45, "Queries the user for a string and lists all case-insensitive substring matches found in all open buffers.", 105, "w:\\4ed\\code\\4coder_search.cpp", 32, 759 }, -{ PROC_LINKS(lister__activate, 0), "lister__activate", 16, "A lister mode command that activates the list's action on the highlighted item.", 79, "w:\\4ed\\code\\4coder_lists.cpp", 31, 17 }, -{ PROC_LINKS(lister__backspace_text_field, 0), "lister__backspace_text_field", 28, "A lister mode command that dispatches to the lister's backspace text field handler.", 83, "w:\\4ed\\code\\4coder_lists.cpp", 31, 44 }, -{ PROC_LINKS(lister__backspace_text_field__default, 0), "lister__backspace_text_field__default", 37, "A lister mode command that backspaces one character from the text field.", 72, "w:\\4ed\\code\\4coder_lists.cpp", 31, 149 }, -{ PROC_LINKS(lister__backspace_text_field__file_path, 0), "lister__backspace_text_field__file_path", 39, "A lister mode command that backspaces one character from the text field of a file system list.", 94, "w:\\4ed\\code\\4coder_lists.cpp", 31, 221 }, -{ PROC_LINKS(lister__mouse_press, 0), "lister__mouse_press", 19, "A lister mode command that beings a click interaction with a list item under the mouse.", 87, "w:\\4ed\\code\\4coder_lists.cpp", 31, 89 }, -{ PROC_LINKS(lister__mouse_release, 0), "lister__mouse_release", 21, "A lister mode command that ends a click interaction with a list item under the mouse, possibly activating it.", 109, "w:\\4ed\\code\\4coder_lists.cpp", 31, 101 }, -{ PROC_LINKS(lister__move_down, 0), "lister__move_down", 17, "A lister mode command that dispatches to the lister's navigate down handler.", 76, "w:\\4ed\\code\\4coder_lists.cpp", 31, 64 }, -{ PROC_LINKS(lister__move_down__default, 0), "lister__move_down__default", 26, "A lister mode command that moves the highlighted item one down in the list.", 75, "w:\\4ed\\code\\4coder_lists.cpp", 31, 180 }, -{ PROC_LINKS(lister__move_up, 0), "lister__move_up", 15, "A lister mode command that dispatches to the lister's navigate up handler.", 74, "w:\\4ed\\code\\4coder_lists.cpp", 31, 54 }, -{ PROC_LINKS(lister__move_up__default, 0), "lister__move_up__default", 24, "A lister mode command that moves the highlighted item one up in the list.", 73, "w:\\4ed\\code\\4coder_lists.cpp", 31, 164 }, -{ PROC_LINKS(lister__quit, 0), "lister__quit", 12, "A lister mode command that quits the list without executing any actions.", 72, "w:\\4ed\\code\\4coder_lists.cpp", 31, 8 }, -{ PROC_LINKS(lister__repaint, 0), "lister__repaint", 15, "A lister mode command that updates the lists UI data.", 53, "w:\\4ed\\code\\4coder_lists.cpp", 31, 118 }, -{ PROC_LINKS(lister__wheel_scroll, 0), "lister__wheel_scroll", 20, "A lister mode command that scrolls the list in response to the mouse wheel.", 75, "w:\\4ed\\code\\4coder_lists.cpp", 31, 74 }, -{ PROC_LINKS(lister__write_character, 0), "lister__write_character", 23, "A lister mode command that dispatches to the lister's write character handler.", 78, "w:\\4ed\\code\\4coder_lists.cpp", 31, 34 }, -{ PROC_LINKS(lister__write_character__default, 0), "lister__write_character__default", 32, "A lister mode command that inserts a new character to the text field.", 69, "w:\\4ed\\code\\4coder_lists.cpp", 31, 129 }, -{ PROC_LINKS(lister__write_character__file_path, 0), "lister__write_character__file_path", 34, "A lister mode command that inserts a character into the text field of a file system list.", 89, "w:\\4ed\\code\\4coder_lists.cpp", 31, 196 }, -{ PROC_LINKS(lister__write_character__fixed_list, 0), "lister__write_character__fixed_list", 35, "A lister mode command that handles input for the fixed sure to kill list.", 73, "w:\\4ed\\code\\4coder_lists.cpp", 31, 256 }, -{ PROC_LINKS(load_project, 0), "load_project", 12, "Looks for a project.4coder file in the current directory and tries to load it. Looks in parent directories until a project file is found or there are no more parents.", 167, "w:\\4ed\\code\\4coder_project_commands.cpp", 42, 1071 }, -{ PROC_LINKS(make_directory_query, 0), "make_directory_query", 20, "Queries the user for a name and creates a new directory with the given name.", 76, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 1120 }, -{ PROC_LINKS(move_down, 0), "move_down", 9, "Moves the cursor down one line.", 31, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 250 }, -{ PROC_LINKS(move_down_10, 0), "move_down_10", 12, "Moves the cursor down ten lines.", 32, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 262 }, -{ PROC_LINKS(move_down_textual, 0), "move_down_textual", 17, "Moves down to the next line of actual text, regardless of line wrapping.", 72, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 268 }, -{ PROC_LINKS(move_left, 0), "move_left", 9, "Moves the cursor one character to the left.", 43, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 299 }, -{ PROC_LINKS(move_line_down, 0), "move_line_down", 14, "Swaps the line under the cursor with the line below it, and moves the cursor down with it.", 90, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 1217 }, -{ PROC_LINKS(move_line_up, 0), "move_line_up", 12, "Swaps the line under the cursor with the line above it, and moves the cursor up with it.", 88, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 1153 }, -{ PROC_LINKS(move_right, 0), "move_right", 10, "Moves the cursor one character to the right.", 44, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 308 }, -{ PROC_LINKS(move_up, 0), "move_up", 7, "Moves the cursor up one line.", 29, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 244 }, -{ PROC_LINKS(move_up_10, 0), "move_up_10", 10, "Moves the cursor up ten lines.", 30, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 256 }, -{ 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", 37, 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", 37, 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", 37, 571 }, -{ PROC_LINKS(newline_or_goto_position_sticky, 0), "newline_or_goto_position_sticky", 31, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor.", 106, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 37, 556 }, -{ PROC_LINKS(open_all_code, 0), "open_all_code", 13, "Open all code in the current directory. File types are determined by extensions. An extension is considered code based on the extensions specified in 4coder.config.", 164, "w:\\4ed\\code\\4coder_project_commands.cpp", 42, 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", 42, 1062 }, -{ PROC_LINKS(open_color_tweaker, 0), "open_color_tweaker", 18, "Opens the 4coder colors and fonts selector menu.", 48, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 1465 }, -{ 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", 39, 1339 }, -{ 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", 39, 1479 }, -{ 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", 49, 58 }, -{ PROC_LINKS(open_long_braces_break, 0), "open_long_braces_break", 22, "At the cursor, insert a '{' and '}break;' separated by a blank line.", 68, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 49, 74 }, -{ PROC_LINKS(open_long_braces_semicolon, 0), "open_long_braces_semicolon", 26, "At the cursor, insert a '{' and '};' separated by a blank line.", 63, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 49, 66 }, -{ PROC_LINKS(open_matching_file_cpp, 0), "open_matching_file_cpp", 22, "If the current file is a *.cpp or *.h, attempts to open the corresponding *.h or *.cpp file in the other view.", 110, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 1375 }, -{ PROC_LINKS(open_panel_hsplit, 0), "open_panel_hsplit", 17, "Create a new panel by horizontally splitting the active panel.", 62, "w:\\4ed\\code\\4coder_default_framework.cpp", 43, 162 }, -{ PROC_LINKS(open_panel_vsplit, 0), "open_panel_vsplit", 17, "Create a new panel by vertically splitting the active panel.", 60, "w:\\4ed\\code\\4coder_default_framework.cpp", 43, 153 }, -{ PROC_LINKS(page_down, 0), "page_down", 9, "Scrolls the view down one view height and moves the cursor down one view height.", 80, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 288 }, -{ PROC_LINKS(page_up, 0), "page_up", 7, "Scrolls the view up one view height and moves the cursor up one view height.", 76, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 279 }, -{ PROC_LINKS(paste, 0), "paste", 5, "At the cursor, insert the text at the top of the clipboard.", 59, "w:\\4ed\\code\\4coder_clipboard.cpp", 35, 46 }, -{ PROC_LINKS(paste_and_indent, 0), "paste_and_indent", 16, "Paste from the top of clipboard and run auto-indent on the newly pasted text.", 77, "w:\\4ed\\code\\4coder_clipboard.cpp", 35, 130 }, -{ PROC_LINKS(paste_next, 0), "paste_next", 10, "If the previous command was paste or paste_next, replaces the paste range with the next text down on the clipboard, otherwise operates as the paste command.", 156, "w:\\4ed\\code\\4coder_clipboard.cpp", 35, 83 }, -{ PROC_LINKS(paste_next_and_indent, 0), "paste_next_and_indent", 21, "Paste the next item on the clipboard and run auto-indent on the newly pasted text.", 82, "w:\\4ed\\code\\4coder_clipboard.cpp", 35, 137 }, -{ PROC_LINKS(place_in_scope, 0), "place_in_scope", 14, "Wraps the code contained in the range between cursor and mark with a new curly brace scope.", 91, "w:\\4ed\\code\\4coder_scope_commands.cpp", 40, 481 }, -{ PROC_LINKS(project_fkey_command, 0), "project_fkey_command", 20, "Run an 'fkey command' configured in a project.4coder file. Determines the index of the 'fkey command' by which function key or numeric key was pressed to trigger the command.", 175, "w:\\4ed\\code\\4coder_project_commands.cpp", 42, 1078 }, -{ PROC_LINKS(project_go_to_root_directory, 0), "project_go_to_root_directory", 28, "Changes 4coder's hot directory to the root directory of the currently loaded project. With no loaded project nothing hapepns.", 125, "w:\\4ed\\code\\4coder_project_commands.cpp", 42, 1103 }, -{ PROC_LINKS(query_replace, 0), "query_replace", 13, "Queries the user for two strings, and incrementally replaces every occurence of the first string with the second string.", 120, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 912 }, -{ PROC_LINKS(query_replace_identifier, 0), "query_replace_identifier", 24, "Queries the user for a string, and incrementally replace every occurence of the word or token found at the cursor with the specified string.", 140, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 932 }, -{ PROC_LINKS(query_replace_selection, 0), "query_replace_selection", 23, "Queries the user for a string, and incrementally replace every occurence of the string found in the selected range with the specified string.", 141, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 950 }, -{ PROC_LINKS(redo, 0), "redo", 4, "Advances forewards through the undo history.", 44, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 1447 }, -{ PROC_LINKS(remap_interactive, 0), "remap_interactive", 17, "Switch to a named key binding map.", 34, "w:\\4ed\\code\\4coder_default_framework.cpp", 43, 211 }, -{ PROC_LINKS(rename_file_query, 0), "rename_file_query", 17, "Queries the user for a new name and renames the file of the current buffer, altering the buffer's name too.", 107, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 1078 }, -{ PROC_LINKS(reopen, 0), "reopen", 6, "Reopen the current buffer from the hard drive.", 46, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 1453 }, -{ PROC_LINKS(replace_in_range, 0), "replace_in_range", 16, "Queries the user for two strings, and replaces all occurences of the first string in the range between the cursor and the mark with the second string.", 150, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 810 }, -{ PROC_LINKS(reverse_search, 0), "reverse_search", 14, "Begins an incremental search up through the current buffer for a user specified string.", 87, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 781 }, -{ 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", 39, 799 }, -{ PROC_LINKS(save, 0), "save", 4, "Saves the current buffer.", 25, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 1459 }, -{ 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", 39, 977 }, -{ 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", 39, 1038 }, -{ 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", 40, 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", 39, 774 }, -{ 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", 39, 788 }, -{ PROC_LINKS(seek_alphanumeric_left, 0), "seek_alphanumeric_left", 22, "Seek left for boundary between alphanumeric characters and non-alphanumeric characters.", 87, "w:\\4ed\\code\\4coder_seek.cpp", 30, 1227 }, -{ PROC_LINKS(seek_alphanumeric_or_camel_left, 0), "seek_alphanumeric_or_camel_left", 31, "Seek left for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 106, "w:\\4ed\\code\\4coder_seek.cpp", 30, 1239 }, -{ PROC_LINKS(seek_alphanumeric_or_camel_right, 0), "seek_alphanumeric_or_camel_right", 32, "Seek right for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 107, "w:\\4ed\\code\\4coder_seek.cpp", 30, 1233 }, -{ PROC_LINKS(seek_alphanumeric_right, 0), "seek_alphanumeric_right", 23, "Seek right for boundary between alphanumeric characters and non-alphanumeric characters.", 88, "w:\\4ed\\code\\4coder_seek.cpp", 30, 1221 }, -{ PROC_LINKS(seek_beginning_of_line, 0), "seek_beginning_of_line", 22, "Seeks the cursor to the beginning of the visual line.", 53, "w:\\4ed\\code\\4coder_seek.cpp", 30, 1126 }, -{ PROC_LINKS(seek_beginning_of_textual_line, 0), "seek_beginning_of_textual_line", 30, "Seeks the cursor to the beginning of the line across all text.", 62, "w:\\4ed\\code\\4coder_seek.cpp", 30, 1108 }, -{ PROC_LINKS(seek_end_of_line, 0), "seek_end_of_line", 16, "Seeks the cursor to the end of the visual line.", 47, "w:\\4ed\\code\\4coder_seek.cpp", 30, 1137 }, -{ PROC_LINKS(seek_end_of_textual_line, 0), "seek_end_of_textual_line", 24, "Seeks the cursor to the end of the line across all text.", 56, "w:\\4ed\\code\\4coder_seek.cpp", 30, 1117 }, -{ PROC_LINKS(seek_token_left, 0), "seek_token_left", 15, "Seek left for the next beginning of a token.", 44, "w:\\4ed\\code\\4coder_seek.cpp", 30, 1203 }, -{ PROC_LINKS(seek_token_right, 0), "seek_token_right", 16, "Seek right for the next end of a token.", 39, "w:\\4ed\\code\\4coder_seek.cpp", 30, 1197 }, -{ PROC_LINKS(seek_white_or_token_left, 0), "seek_white_or_token_left", 24, "Seek left for the next end of a token or boundary between whitespace and non-whitespace.", 88, "w:\\4ed\\code\\4coder_seek.cpp", 30, 1215 }, -{ PROC_LINKS(seek_white_or_token_right, 0), "seek_white_or_token_right", 25, "Seek right for the next end of a token or boundary between whitespace and non-whitespace.", 89, "w:\\4ed\\code\\4coder_seek.cpp", 30, 1209 }, -{ PROC_LINKS(seek_whitespace_down, 0), "seek_whitespace_down", 20, "Seeks the cursor down to the next blank line.", 45, "w:\\4ed\\code\\4coder_seek.cpp", 30, 1099 }, -{ PROC_LINKS(seek_whitespace_down_end_line, 0), "seek_whitespace_down_end_line", 29, "Seeks the cursor down to the next blank line and places it at the end of the line.", 82, "w:\\4ed\\code\\4coder_seek.cpp", 30, 1158 }, -{ PROC_LINKS(seek_whitespace_left, 0), "seek_whitespace_left", 20, "Seek left for the next boundary between whitespace and non-whitespace.", 70, "w:\\4ed\\code\\4coder_seek.cpp", 30, 1191 }, -{ PROC_LINKS(seek_whitespace_right, 0), "seek_whitespace_right", 21, "Seek right for the next boundary between whitespace and non-whitespace.", 71, "w:\\4ed\\code\\4coder_seek.cpp", 30, 1185 }, -{ PROC_LINKS(seek_whitespace_up, 0), "seek_whitespace_up", 18, "Seeks the cursor up to the next blank line.", 43, "w:\\4ed\\code\\4coder_seek.cpp", 30, 1090 }, -{ PROC_LINKS(seek_whitespace_up_end_line, 0), "seek_whitespace_up_end_line", 27, "Seeks the cursor up to the next blank line and places it at the end of the line.", 80, "w:\\4ed\\code\\4coder_seek.cpp", 30, 1148 }, -{ PROC_LINKS(select_all, 0), "select_all", 10, "Puts the cursor at the top of the file, and the mark at the bottom of the file.", 79, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 317 }, -{ PROC_LINKS(set_bindings_choose, 0), "set_bindings_choose", 19, "Remap keybindings using the 'choose' mapping rule.", 50, "w:\\4ed\\code\\4coder_remapping_commands.cpp", 44, 47 }, -{ PROC_LINKS(set_bindings_default, 0), "set_bindings_default", 20, "Remap keybindings using the 'default' mapping rule.", 51, "w:\\4ed\\code\\4coder_remapping_commands.cpp", 44, 61 }, -{ PROC_LINKS(set_bindings_mac_default, 0), "set_bindings_mac_default", 24, "Remap keybindings using the 'mac-default' mapping rule.", 55, "w:\\4ed\\code\\4coder_remapping_commands.cpp", 44, 75 }, -{ PROC_LINKS(set_mark, 0), "set_mark", 8, "Sets the mark to the current position of the cursor.", 52, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 86 }, -{ PROC_LINKS(setup_build_bat, 0), "setup_build_bat", 15, "Queries the user for several configuration options and initializes a new build batch script.", 92, "w:\\4ed\\code\\4coder_project_commands.cpp", 42, 1488 }, -{ PROC_LINKS(setup_build_bat_and_sh, 0), "setup_build_bat_and_sh", 22, "Queries the user for several configuration options and initializes a new build batch script.", 92, "w:\\4ed\\code\\4coder_project_commands.cpp", 42, 1500 }, -{ PROC_LINKS(setup_build_sh, 0), "setup_build_sh", 14, "Queries the user for several configuration options and initializes a new build shell script.", 92, "w:\\4ed\\code\\4coder_project_commands.cpp", 42, 1494 }, -{ PROC_LINKS(setup_new_project, 0), "setup_new_project", 17, "Queries the user for several configuration options and initializes a new 4coder project with build scripts for every OS.", 120, "w:\\4ed\\code\\4coder_project_commands.cpp", 42, 1481 }, -{ PROC_LINKS(show_filebar, 0), "show_filebar", 12, "Sets the current view to show it's filebar.", 43, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 464 }, -{ PROC_LINKS(show_scrollbar, 0), "show_scrollbar", 14, "Sets the current view to show it's scrollbar.", 45, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 450 }, -{ PROC_LINKS(snipe_token_or_word, 0), "snipe_token_or_word", 19, "Delete a single, whole token on or to the left of the cursor and post it to the clipboard.", 90, "w:\\4ed\\code\\4coder_seek.cpp", 30, 1259 }, -{ PROC_LINKS(snipe_token_or_word_right, 0), "snipe_token_or_word_right", 25, "Delete a single, whole token on or to the right of the cursor and post it to the clipboard.", 91, "w:\\4ed\\code\\4coder_seek.cpp", 30, 1265 }, -{ PROC_LINKS(suppress_mouse, 0), "suppress_mouse", 14, "Hides the mouse and causes all mosue input (clicks, position, wheel) to be ignored.", 83, "w:\\4ed\\code\\4coder_default_framework.cpp", 43, 185 }, -{ PROC_LINKS(swap_buffers_between_panels, 0), "swap_buffers_between_panels", 27, "Set the other non-active panel to view the buffer that the active panel views, and switch to that panel.", 104, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 1399 }, -{ PROC_LINKS(to_lowercase, 0), "to_lowercase", 12, "Converts all ascii text in the range between the cursor and the mark to lowercase.", 82, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 348 }, -{ PROC_LINKS(to_uppercase, 0), "to_uppercase", 12, "Converts all ascii text in the range between the cursor and the mark to uppercase.", 82, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 328 }, -{ PROC_LINKS(toggle_filebar, 0), "toggle_filebar", 14, "Toggles the visibility status of the current view's filebar.", 60, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 478 }, -{ PROC_LINKS(toggle_fullscreen, 0), "toggle_fullscreen", 17, "Toggle fullscreen mode on or off. The change(s) do not take effect until the next frame.", 89, "w:\\4ed\\code\\4coder_default_framework.cpp", 43, 203 }, -{ PROC_LINKS(toggle_line_wrap, 0), "toggle_line_wrap", 16, "Toggles the current buffer's line wrapping status.", 50, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 487 }, -{ PROC_LINKS(toggle_mouse, 0), "toggle_mouse", 12, "Toggles the mouse suppression mode, see suppress_mouse and allow_mouse.", 71, "w:\\4ed\\code\\4coder_default_framework.cpp", 43, 197 }, -{ PROC_LINKS(toggle_show_whitespace, 0), "toggle_show_whitespace", 22, "Toggles the current buffer's whitespace visibility status.", 58, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 554 }, -{ 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", 39, 543 }, -{ PROC_LINKS(undo, 0), "undo", 4, "Advances backwards through the undo history.", 44, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 1441 }, -{ 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", 39, 1389 }, -{ 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", 32, 820 }, -{ PROC_LINKS(write_and_auto_tab, 0), "write_and_auto_tab", 18, "Inserts a character and auto-indents the line on which the cursor sits.", 71, "w:\\4ed\\code\\4coder_auto_indent.cpp", 37, 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", 49, 106 }, -{ PROC_LINKS(write_character, 0), "write_character", 15, "Inserts whatever character was used to trigger this command.", 60, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 33 }, -{ PROC_LINKS(write_hack, 0), "write_hack", 10, "At the cursor, insert a '// HACK' comment, includes user name if it was specified in config.4coder.", 99, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 49, 94 }, -{ PROC_LINKS(write_note, 0), "write_note", 10, "At the cursor, insert a '// NOTE' comment, includes user name if it was specified in config.4coder.", 99, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 49, 100 }, -{ PROC_LINKS(write_todo, 0), "write_todo", 10, "At the cursor, insert a '// TODO' comment, includes user name if it was specified in config.4coder.", 99, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 49, 88 }, -{ PROC_LINKS(write_underscore, 0), "write_underscore", 16, "Inserts an underscore.", 22, "w:\\4ed\\code\\4coder_base_commands.cpp", 39, 42 }, -{ PROC_LINKS(write_zero_struct, 0), "write_zero_struct", 17, "At the cursor, insert a ' = {0};'.", 34, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 49, 112 }, +{ PROC_LINKS(allow_mouse, 0), "allow_mouse", 11, "Shows the mouse and causes all mouse input to be processed normally.", 68, "/home/allen/4ed/code/4coder_default_framework.cpp", 49, 191 }, +{ PROC_LINKS(auto_tab_line_at_cursor, 0), "auto_tab_line_at_cursor", 23, "Auto-indents the line on which the cursor sits.", 47, "/home/allen/4ed/code/4coder_auto_indent.cpp", 43, 722 }, +{ PROC_LINKS(auto_tab_range, 0), "auto_tab_range", 14, "Auto-indents the range between the cursor and the mark.", 55, "/home/allen/4ed/code/4coder_auto_indent.cpp", 43, 733 }, +{ PROC_LINKS(auto_tab_whole_file, 0), "auto_tab_whole_file", 19, "Audo-indents the entire current buffer.", 39, "/home/allen/4ed/code/4coder_auto_indent.cpp", 43, 712 }, +{ PROC_LINKS(backspace_char, 0), "backspace_char", 14, "Deletes the character to the left of the cursor.", 48, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 67 }, +{ PROC_LINKS(backspace_word, 0), "backspace_word", 14, "Delete characters between the cursor position and the first alphanumeric boundary to the left.", 94, "/home/allen/4ed/code/4coder_seek.cpp", 36, 1247 }, +{ PROC_LINKS(basic_change_active_panel, 0), "basic_change_active_panel", 25, "Change the currently active panel, moving to the panel with the next highest view_id. Will not skipe the build panel if it is open.", 132, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 433 }, +{ PROC_LINKS(build_in_build_panel, 0), "build_in_build_panel", 20, "Looks for a build.bat, build.sh, or makefile in the current and parent directories. Runs the first that it finds and prints the output to *compilation*. Puts the *compilation* buffer in a panel at the footer of the current view.", 230, "/home/allen/4ed/code/4coder_build_commands.cpp", 46, 187 }, +{ PROC_LINKS(build_search, 0), "build_search", 12, "Looks for a build.bat, build.sh, or makefile in the current and parent directories. Runs the first that it finds and prints the output to *compilation*.", 153, "/home/allen/4ed/code/4coder_build_commands.cpp", 46, 155 }, +{ PROC_LINKS(center_view, 0), "center_view", 11, "Centers the view vertically on the line on which the cursor sits.", 65, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 120 }, +{ PROC_LINKS(change_active_panel, 0), "change_active_panel", 19, "Change the currently active panel, moving to the panel with the next highest view_id.", 85, "/home/allen/4ed/code/4coder_default_framework.cpp", 49, 133 }, +{ PROC_LINKS(change_active_panel_backwards, 0), "change_active_panel_backwards", 29, "Change the currently active panel, moving to the panel with the next lowest view_id.", 84, "/home/allen/4ed/code/4coder_default_framework.cpp", 49, 143 }, +{ PROC_LINKS(change_to_build_panel, 0), "change_to_build_panel", 21, "If the special build panel is open, makes the build panel the active panel.", 75, "/home/allen/4ed/code/4coder_build_commands.cpp", 46, 209 }, +{ PROC_LINKS(clean_all_lines, 0), "clean_all_lines", 15, "Removes trailing whitespace from all lines in the current buffer.", 65, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 368 }, +{ PROC_LINKS(click_set_cursor, 0), "click_set_cursor", 16, "Sets the cursor position to the mouse position.", 47, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 174 }, +{ PROC_LINKS(click_set_mark, 0), "click_set_mark", 14, "Sets the mark position to the mouse position.", 45, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 187 }, +{ PROC_LINKS(close_all_code, 0), "close_all_code", 14, "Closes any buffer with a filename ending with an extension configured to be recognized as a code file type.", 107, "/home/allen/4ed/code/4coder_project_commands.cpp", 48, 1048 }, +{ PROC_LINKS(close_build_panel, 0), "close_build_panel", 17, "If the special build panel is open, closes it.", 46, "/home/allen/4ed/code/4coder_build_commands.cpp", 46, 203 }, +{ PROC_LINKS(close_panel, 0), "close_panel", 11, "Closes the currently active panel if it is not the only panel open.", 67, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 441 }, +{ PROC_LINKS(copy, 0), "copy", 4, "Copy the text in the range from the cursor to the mark onto the clipboard.", 74, "/home/allen/4ed/code/4coder_clipboard.cpp", 41, 26 }, +{ PROC_LINKS(cursor_mark_swap, 0), "cursor_mark_swap", 16, "Swaps the position of the cursor and the mark.", 46, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 95 }, +{ PROC_LINKS(cut, 0), "cut", 3, "Cut the text in the range from the cursor to the mark onto the clipboard.", 73, "/home/allen/4ed/code/4coder_clipboard.cpp", 41, 35 }, +{ PROC_LINKS(decrease_face_size, 0), "decrease_face_size", 18, "Decrease the size of the face used by the current buffer.", 57, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 531 }, +{ PROC_LINKS(decrease_line_wrap, 0), "decrease_line_wrap", 18, "Decrases the current buffer's width for line wrapping.", 54, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 508 }, +{ PROC_LINKS(delete_char, 0), "delete_char", 11, "Deletes the character to the right of the cursor.", 49, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 49 }, +{ PROC_LINKS(delete_current_scope, 0), "delete_current_scope", 20, "Deletes the braces surrounding the currently selected scope. Leaves the contents within the scope.", 99, "/home/allen/4ed/code/4coder_scope_commands.cpp", 46, 487 }, +{ PROC_LINKS(delete_file_query, 0), "delete_file_query", 17, "Deletes the file of the current buffer if 4coder has the appropriate access rights. Will ask the user for confirmation first.", 125, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1012 }, +{ PROC_LINKS(delete_line, 0), "delete_line", 11, "Delete the line the on which the cursor sits.", 45, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1262 }, +{ PROC_LINKS(delete_range, 0), "delete_range", 12, "Deletes the text in the range between the cursor and the mark.", 62, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 107 }, +{ PROC_LINKS(delete_word, 0), "delete_word", 11, "Delete characters between the cursor position and the first alphanumeric boundary to the right.", 95, "/home/allen/4ed/code/4coder_seek.cpp", 36, 1253 }, +{ PROC_LINKS(duplicate_line, 0), "duplicate_line", 14, "Create a copy of the line on which the cursor sits.", 51, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1240 }, +{ PROC_LINKS(eol_dosify, 0), "eol_dosify", 10, "Puts the buffer in DOS line ending mode.", 40, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 561 }, +{ PROC_LINKS(eol_nixify, 0), "eol_nixify", 10, "Puts the buffer in NIX line ending mode.", 40, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 569 }, +{ PROC_LINKS(execute_any_cli, 0), "execute_any_cli", 15, "Queries for an output buffer name and system command, runs the system command as a CLI and prints the output to the specified buffer.", 133, "/home/allen/4ed/code/4coder_system_command.cpp", 46, 23 }, +{ PROC_LINKS(execute_arbitrary_command, 0), "execute_arbitrary_command", 25, "Execute a 'long form' command.", 30, "/home/allen/4ed/code/4coder_long_command_switch.cpp", 51, 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, "/home/allen/4ed/code/4coder_system_command.cpp", 46, 7 }, +{ PROC_LINKS(exit_4coder, 0), "exit_4coder", 11, "Attempts to close 4coder.", 25, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 577 }, +{ PROC_LINKS(goto_beginning_of_file, 0), "goto_beginning_of_file", 22, "Sets the cursor to the beginning of the file.", 45, "/home/allen/4ed/code/4coder_seek.cpp", 36, 1168 }, +{ PROC_LINKS(goto_end_of_file, 0), "goto_end_of_file", 16, "Sets the cursor to the end of the file.", 39, "/home/allen/4ed/code/4coder_seek.cpp", 36, 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, "/home/allen/4ed/code/4coder_jump_direct.cpp", 43, 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, "/home/allen/4ed/code/4coder_jump_sticky.cpp", 43, 533 }, +{ PROC_LINKS(goto_first_jump_sticky, 0), "goto_first_jump_sticky", 22, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer.", 95, "/home/allen/4ed/code/4coder_jump_sticky.cpp", 43, 515 }, +{ PROC_LINKS(goto_jump_at_cursor_direct, 0), "goto_jump_at_cursor_direct", 26, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in another view and changes the active panel to the view containing the jump.", 187, "/home/allen/4ed/code/4coder_jump_direct.cpp", 43, 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, "/home/allen/4ed/code/4coder_jump_direct.cpp", 43, 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, "/home/allen/4ed/code/4coder_jump_sticky.cpp", 43, 365 }, +{ PROC_LINKS(goto_jump_at_cursor_sticky, 0), "goto_jump_at_cursor_sticky", 26, "If the cursor is found to be on a jump location, parses the jump location and brings up the file and position in another view and changes the active panel to the view containing the jump.", 187, "/home/allen/4ed/code/4coder_jump_sticky.cpp", 43, 337 }, +{ PROC_LINKS(goto_line, 0), "goto_line", 9, "Queries the user for a number, and jumps the cursor to the corresponding line.", 78, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 585 }, +{ PROC_LINKS(goto_next_jump_direct, 0), "goto_next_jump_direct", 21, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, skipping sub jump locations.", 123, "/home/allen/4ed/code/4coder_jump_direct.cpp", 43, 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, "/home/allen/4ed/code/4coder_jump_direct.cpp", 43, 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, "/home/allen/4ed/code/4coder_jump_sticky.cpp", 43, 484 }, +{ PROC_LINKS(goto_next_jump_sticky, 0), "goto_next_jump_sticky", 21, "If a buffer containing jump locations has been locked in, goes to the next jump in the buffer, skipping sub jump locations.", 123, "/home/allen/4ed/code/4coder_jump_sticky.cpp", 43, 454 }, +{ PROC_LINKS(goto_prev_jump_direct, 0), "goto_prev_jump_direct", 21, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, skipping sub jump locations.", 127, "/home/allen/4ed/code/4coder_jump_direct.cpp", 43, 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, "/home/allen/4ed/code/4coder_jump_direct.cpp", 43, 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, "/home/allen/4ed/code/4coder_jump_sticky.cpp", 43, 500 }, +{ PROC_LINKS(goto_prev_jump_sticky, 0), "goto_prev_jump_sticky", 21, "If a buffer containing jump locations has been locked in, goes to the previous jump in the buffer, skipping sub jump locations.", 127, "/home/allen/4ed/code/4coder_jump_sticky.cpp", 43, 470 }, +{ PROC_LINKS(hide_filebar, 0), "hide_filebar", 12, "Sets the current view to hide it's filebar.", 43, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 471 }, +{ PROC_LINKS(hide_scrollbar, 0), "hide_scrollbar", 14, "Sets the current view to hide it's scrollbar.", 45, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 457 }, +{ PROC_LINKS(highlight_next_scope_absolute, 0), "highlight_next_scope_absolute", 29, "Finds the first scope started by '{' after the cursor and puts the cursor and mark on the '{' and '}'.", 102, "/home/allen/4ed/code/4coder_scope_commands.cpp", 46, 363 }, +{ PROC_LINKS(highlight_prev_scope_absolute, 0), "highlight_prev_scope_absolute", 29, "Finds the first scope started by '{' before the cursor and puts the cursor and mark on the '{' and '}'.", 103, "/home/allen/4ed/code/4coder_scope_commands.cpp", 46, 382 }, +{ PROC_LINKS(highlight_surrounding_scope, 0), "highlight_surrounding_scope", 27, "Finds the scope enclosed by '{' '}' surrounding the cursor and puts the cursor and mark on the '{' and '}'.", 107, "/home/allen/4ed/code/4coder_scope_commands.cpp", 46, 341 }, +{ PROC_LINKS(if0_off, 0), "if0_off", 7, "Surround the range between the cursor and mark with an '#if 0' and an '#endif'", 78, "/home/allen/4ed/code/4coder_combined_write_commands.cpp", 55, 82 }, +{ PROC_LINKS(increase_face_size, 0), "increase_face_size", 18, "Increase the size of the face used by the current buffer.", 57, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 519 }, +{ PROC_LINKS(increase_line_wrap, 0), "increase_line_wrap", 18, "Increases the current buffer's width for line wrapping.", 55, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 497 }, +{ PROC_LINKS(interactive_kill_buffer, 0), "interactive_kill_buffer", 23, "Interactively kill an open buffer.", 34, "/home/allen/4ed/code/4coder_lists.cpp", 37, 647 }, +{ PROC_LINKS(interactive_new, 0), "interactive_new", 15, "Interactively creates a new file.", 33, "/home/allen/4ed/code/4coder_lists.cpp", 37, 749 }, +{ PROC_LINKS(interactive_open, 0), "interactive_open", 16, "Interactively opens a file.", 27, "/home/allen/4ed/code/4coder_lists.cpp", 37, 776 }, +{ PROC_LINKS(interactive_open_or_new, 0), "interactive_open_or_new", 23, "Interactively open a file out of the file system.", 49, "/home/allen/4ed/code/4coder_lists.cpp", 37, 716 }, +{ PROC_LINKS(interactive_switch_buffer, 0), "interactive_switch_buffer", 25, "Interactively switch to an open buffer.", 39, "/home/allen/4ed/code/4coder_lists.cpp", 37, 629 }, +{ PROC_LINKS(kill_buffer, 0), "kill_buffer", 11, "Kills the current buffer.", 25, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1432 }, +{ 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, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 135 }, +{ PROC_LINKS(list_all_functions_current_buffer, 0), "list_all_functions_current_buffer", 33, "Creates a jump list of lines of the current buffer that appear to define or declare functions.", 94, "/home/allen/4ed/code/4coder_function_list.cpp", 45, 318 }, +{ PROC_LINKS(list_all_locations, 0), "list_all_locations", 18, "Queries the user for a string and lists all exact case-sensitive matches found in all open buffers.", 99, "/home/allen/4ed/code/4coder_search.cpp", 38, 741 }, +{ PROC_LINKS(list_all_locations_case_insensitive, 0), "list_all_locations_case_insensitive", 35, "Queries the user for a string and lists all exact case-insensitive matches found in all open buffers.", 101, "/home/allen/4ed/code/4coder_search.cpp", 38, 753 }, +{ PROC_LINKS(list_all_locations_of_identifier, 0), "list_all_locations_of_identifier", 32, "Reads a token or word under the cursor and lists all exact case-sensitive mathces in all open buffers.", 102, "/home/allen/4ed/code/4coder_search.cpp", 38, 765 }, +{ PROC_LINKS(list_all_locations_of_identifier_case_insensitive, 0), "list_all_locations_of_identifier_case_insensitive", 49, "Reads a token or word under the cursor and lists all exact case-insensitive mathces in all open buffers.", 104, "/home/allen/4ed/code/4coder_search.cpp", 38, 771 }, +{ PROC_LINKS(list_all_locations_of_selection, 0), "list_all_locations_of_selection", 31, "Reads the string in the selected range and lists all exact case-sensitive mathces in all open buffers.", 102, "/home/allen/4ed/code/4coder_search.cpp", 38, 777 }, +{ PROC_LINKS(list_all_locations_of_selection_case_insensitive, 0), "list_all_locations_of_selection_case_insensitive", 48, "Reads the string in the selected range and lists all exact case-insensitive mathces in all open buffers.", 104, "/home/allen/4ed/code/4coder_search.cpp", 38, 783 }, +{ PROC_LINKS(list_all_locations_of_type_definition, 0), "list_all_locations_of_type_definition", 37, "Queries user for string, lists all locations of strings that appear to define a type whose name matches the input string.", 121, "/home/allen/4ed/code/4coder_search.cpp", 38, 789 }, +{ PROC_LINKS(list_all_locations_of_type_definition_of_identifier, 0), "list_all_locations_of_type_definition_of_identifier", 51, "Reads a token or word under the cursor and lists all locations of strings that appear to define a type whose name matches it.", 125, "/home/allen/4ed/code/4coder_search.cpp", 38, 800 }, +{ PROC_LINKS(list_all_substring_locations, 0), "list_all_substring_locations", 28, "Queries the user for a string and lists all case-sensitive substring matches found in all open buffers.", 103, "/home/allen/4ed/code/4coder_search.cpp", 38, 747 }, +{ PROC_LINKS(list_all_substring_locations_case_insensitive, 0), "list_all_substring_locations_case_insensitive", 45, "Queries the user for a string and lists all case-insensitive substring matches found in all open buffers.", 105, "/home/allen/4ed/code/4coder_search.cpp", 38, 759 }, +{ PROC_LINKS(lister__activate, 0), "lister__activate", 16, "A lister mode command that activates the list's action on the highlighted item.", 79, "/home/allen/4ed/code/4coder_lists.cpp", 37, 17 }, +{ PROC_LINKS(lister__backspace_text_field, 0), "lister__backspace_text_field", 28, "A lister mode command that dispatches to the lister's backspace text field handler.", 83, "/home/allen/4ed/code/4coder_lists.cpp", 37, 44 }, +{ PROC_LINKS(lister__backspace_text_field__default, 0), "lister__backspace_text_field__default", 37, "A lister mode command that backspaces one character from the text field.", 72, "/home/allen/4ed/code/4coder_lists.cpp", 37, 149 }, +{ PROC_LINKS(lister__backspace_text_field__file_path, 0), "lister__backspace_text_field__file_path", 39, "A lister mode command that backspaces one character from the text field of a file system list.", 94, "/home/allen/4ed/code/4coder_lists.cpp", 37, 221 }, +{ PROC_LINKS(lister__mouse_press, 0), "lister__mouse_press", 19, "A lister mode command that beings a click interaction with a list item under the mouse.", 87, "/home/allen/4ed/code/4coder_lists.cpp", 37, 89 }, +{ PROC_LINKS(lister__mouse_release, 0), "lister__mouse_release", 21, "A lister mode command that ends a click interaction with a list item under the mouse, possibly activating it.", 109, "/home/allen/4ed/code/4coder_lists.cpp", 37, 101 }, +{ PROC_LINKS(lister__move_down, 0), "lister__move_down", 17, "A lister mode command that dispatches to the lister's navigate down handler.", 76, "/home/allen/4ed/code/4coder_lists.cpp", 37, 64 }, +{ PROC_LINKS(lister__move_down__default, 0), "lister__move_down__default", 26, "A lister mode command that moves the highlighted item one down in the list.", 75, "/home/allen/4ed/code/4coder_lists.cpp", 37, 180 }, +{ PROC_LINKS(lister__move_up, 0), "lister__move_up", 15, "A lister mode command that dispatches to the lister's navigate up handler.", 74, "/home/allen/4ed/code/4coder_lists.cpp", 37, 54 }, +{ PROC_LINKS(lister__move_up__default, 0), "lister__move_up__default", 24, "A lister mode command that moves the highlighted item one up in the list.", 73, "/home/allen/4ed/code/4coder_lists.cpp", 37, 164 }, +{ PROC_LINKS(lister__quit, 0), "lister__quit", 12, "A lister mode command that quits the list without executing any actions.", 72, "/home/allen/4ed/code/4coder_lists.cpp", 37, 8 }, +{ PROC_LINKS(lister__repaint, 0), "lister__repaint", 15, "A lister mode command that updates the lists UI data.", 53, "/home/allen/4ed/code/4coder_lists.cpp", 37, 118 }, +{ PROC_LINKS(lister__wheel_scroll, 0), "lister__wheel_scroll", 20, "A lister mode command that scrolls the list in response to the mouse wheel.", 75, "/home/allen/4ed/code/4coder_lists.cpp", 37, 74 }, +{ PROC_LINKS(lister__write_character, 0), "lister__write_character", 23, "A lister mode command that dispatches to the lister's write character handler.", 78, "/home/allen/4ed/code/4coder_lists.cpp", 37, 34 }, +{ PROC_LINKS(lister__write_character__default, 0), "lister__write_character__default", 32, "A lister mode command that inserts a new character to the text field.", 69, "/home/allen/4ed/code/4coder_lists.cpp", 37, 129 }, +{ PROC_LINKS(lister__write_character__file_path, 0), "lister__write_character__file_path", 34, "A lister mode command that inserts a character into the text field of a file system list.", 89, "/home/allen/4ed/code/4coder_lists.cpp", 37, 196 }, +{ PROC_LINKS(lister__write_character__fixed_list, 0), "lister__write_character__fixed_list", 35, "A lister mode command that handles input for the fixed sure to kill list.", 73, "/home/allen/4ed/code/4coder_lists.cpp", 37, 256 }, +{ PROC_LINKS(load_project, 0), "load_project", 12, "Looks for a project.4coder file in the current directory and tries to load it. Looks in parent directories until a project file is found or there are no more parents.", 167, "/home/allen/4ed/code/4coder_project_commands.cpp", 48, 1071 }, +{ PROC_LINKS(make_directory_query, 0), "make_directory_query", 20, "Queries the user for a name and creates a new directory with the given name.", 76, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1120 }, +{ PROC_LINKS(move_down, 0), "move_down", 9, "Moves the cursor down one line.", 31, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 250 }, +{ PROC_LINKS(move_down_10, 0), "move_down_10", 12, "Moves the cursor down ten lines.", 32, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 262 }, +{ PROC_LINKS(move_down_textual, 0), "move_down_textual", 17, "Moves down to the next line of actual text, regardless of line wrapping.", 72, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 268 }, +{ PROC_LINKS(move_left, 0), "move_left", 9, "Moves the cursor one character to the left.", 43, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 299 }, +{ PROC_LINKS(move_line_down, 0), "move_line_down", 14, "Swaps the line under the cursor with the line below it, and moves the cursor down with it.", 90, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1217 }, +{ PROC_LINKS(move_line_up, 0), "move_line_up", 12, "Swaps the line under the cursor with the line above it, and moves the cursor up with it.", 88, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1153 }, +{ PROC_LINKS(move_right, 0), "move_right", 10, "Moves the cursor one character to the right.", 44, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 308 }, +{ PROC_LINKS(move_up, 0), "move_up", 7, "Moves the cursor up one line.", 29, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 244 }, +{ PROC_LINKS(move_up_10, 0), "move_up_10", 10, "Moves the cursor up ten lines.", 30, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 256 }, +{ 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, "/home/allen/4ed/code/4coder_jump_direct.cpp", 43, 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, "/home/allen/4ed/code/4coder_jump_direct.cpp", 43, 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, "/home/allen/4ed/code/4coder_jump_sticky.cpp", 43, 571 }, +{ PROC_LINKS(newline_or_goto_position_sticky, 0), "newline_or_goto_position_sticky", 31, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor.", 106, "/home/allen/4ed/code/4coder_jump_sticky.cpp", 43, 556 }, +{ PROC_LINKS(open_all_code, 0), "open_all_code", 13, "Open all code in the current directory. File types are determined by extensions. An extension is considered code based on the extensions specified in 4coder.config.", 164, "/home/allen/4ed/code/4coder_project_commands.cpp", 48, 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, "/home/allen/4ed/code/4coder_project_commands.cpp", 48, 1062 }, +{ PROC_LINKS(open_color_tweaker, 0), "open_color_tweaker", 18, "Opens the 4coder theme selector list.", 37, "/home/allen/4ed/code/4coder_lists.cpp", 37, 792 }, +{ 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, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1339 }, +{ PROC_LINKS(open_in_other, 0), "open_in_other", 13, "Interactively opens a file in the other panel.", 46, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1467 }, +{ PROC_LINKS(open_long_braces, 0), "open_long_braces", 16, "At the cursor, insert a '{' and '}' separated by a blank line.", 62, "/home/allen/4ed/code/4coder_combined_write_commands.cpp", 55, 58 }, +{ PROC_LINKS(open_long_braces_break, 0), "open_long_braces_break", 22, "At the cursor, insert a '{' and '}break;' separated by a blank line.", 68, "/home/allen/4ed/code/4coder_combined_write_commands.cpp", 55, 74 }, +{ PROC_LINKS(open_long_braces_semicolon, 0), "open_long_braces_semicolon", 26, "At the cursor, insert a '{' and '};' separated by a blank line.", 63, "/home/allen/4ed/code/4coder_combined_write_commands.cpp", 55, 66 }, +{ PROC_LINKS(open_matching_file_cpp, 0), "open_matching_file_cpp", 22, "If the current file is a *.cpp or *.h, attempts to open the corresponding *.h or *.cpp file in the other view.", 110, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1375 }, +{ PROC_LINKS(open_panel_hsplit, 0), "open_panel_hsplit", 17, "Create a new panel by horizontally splitting the active panel.", 62, "/home/allen/4ed/code/4coder_default_framework.cpp", 49, 162 }, +{ PROC_LINKS(open_panel_vsplit, 0), "open_panel_vsplit", 17, "Create a new panel by vertically splitting the active panel.", 60, "/home/allen/4ed/code/4coder_default_framework.cpp", 49, 153 }, +{ PROC_LINKS(page_down, 0), "page_down", 9, "Scrolls the view down one view height and moves the cursor down one view height.", 80, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 288 }, +{ PROC_LINKS(page_up, 0), "page_up", 7, "Scrolls the view up one view height and moves the cursor up one view height.", 76, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 279 }, +{ PROC_LINKS(paste, 0), "paste", 5, "At the cursor, insert the text at the top of the clipboard.", 59, "/home/allen/4ed/code/4coder_clipboard.cpp", 41, 46 }, +{ PROC_LINKS(paste_and_indent, 0), "paste_and_indent", 16, "Paste from the top of clipboard and run auto-indent on the newly pasted text.", 77, "/home/allen/4ed/code/4coder_clipboard.cpp", 41, 130 }, +{ PROC_LINKS(paste_next, 0), "paste_next", 10, "If the previous command was paste or paste_next, replaces the paste range with the next text down on the clipboard, otherwise operates as the paste command.", 156, "/home/allen/4ed/code/4coder_clipboard.cpp", 41, 83 }, +{ PROC_LINKS(paste_next_and_indent, 0), "paste_next_and_indent", 21, "Paste the next item on the clipboard and run auto-indent on the newly pasted text.", 82, "/home/allen/4ed/code/4coder_clipboard.cpp", 41, 137 }, +{ PROC_LINKS(place_in_scope, 0), "place_in_scope", 14, "Wraps the code contained in the range between cursor and mark with a new curly brace scope.", 91, "/home/allen/4ed/code/4coder_scope_commands.cpp", 46, 481 }, +{ PROC_LINKS(project_fkey_command, 0), "project_fkey_command", 20, "Run an 'fkey command' configured in a project.4coder file. Determines the index of the 'fkey command' by which function key or numeric key was pressed to trigger the command.", 175, "/home/allen/4ed/code/4coder_project_commands.cpp", 48, 1078 }, +{ PROC_LINKS(project_go_to_root_directory, 0), "project_go_to_root_directory", 28, "Changes 4coder's hot directory to the root directory of the currently loaded project. With no loaded project nothing hapepns.", 125, "/home/allen/4ed/code/4coder_project_commands.cpp", 48, 1103 }, +{ PROC_LINKS(query_replace, 0), "query_replace", 13, "Queries the user for two strings, and incrementally replaces every occurence of the first string with the second string.", 120, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 912 }, +{ PROC_LINKS(query_replace_identifier, 0), "query_replace_identifier", 24, "Queries the user for a string, and incrementally replace every occurence of the word or token found at the cursor with the specified string.", 140, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 932 }, +{ PROC_LINKS(query_replace_selection, 0), "query_replace_selection", 23, "Queries the user for a string, and incrementally replace every occurence of the string found in the selected range with the specified string.", 141, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 950 }, +{ PROC_LINKS(redo, 0), "redo", 4, "Advances forewards through the undo history.", 44, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1447 }, +{ PROC_LINKS(remap_interactive, 0), "remap_interactive", 17, "Switch to a named key binding map.", 34, "/home/allen/4ed/code/4coder_default_framework.cpp", 49, 211 }, +{ PROC_LINKS(rename_file_query, 0), "rename_file_query", 17, "Queries the user for a new name and renames the file of the current buffer, altering the buffer's name too.", 107, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1078 }, +{ PROC_LINKS(reopen, 0), "reopen", 6, "Reopen the current buffer from the hard drive.", 46, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1453 }, +{ PROC_LINKS(replace_in_range, 0), "replace_in_range", 16, "Queries the user for two strings, and replaces all occurences of the first string in the range between the cursor and the mark with the second string.", 150, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 810 }, +{ PROC_LINKS(reverse_search, 0), "reverse_search", 14, "Begins an incremental search up through the current buffer for a user specified string.", 87, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 781 }, +{ 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, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 799 }, +{ PROC_LINKS(save, 0), "save", 4, "Saves the current buffer.", 25, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1459 }, +{ PROC_LINKS(save_all_dirty_buffers, 0), "save_all_dirty_buffers", 22, "Saves all buffers marked dirty (showing the '*' indicator).", 59, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 977 }, +{ 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, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1038 }, +{ 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, "/home/allen/4ed/code/4coder_scope_commands.cpp", 46, 738 }, +{ PROC_LINKS(search, 0), "search", 6, "Begins an incremental search down through the current buffer for a user specified string.", 89, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 774 }, +{ 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, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 788 }, +{ PROC_LINKS(seek_alphanumeric_left, 0), "seek_alphanumeric_left", 22, "Seek left for boundary between alphanumeric characters and non-alphanumeric characters.", 87, "/home/allen/4ed/code/4coder_seek.cpp", 36, 1227 }, +{ PROC_LINKS(seek_alphanumeric_or_camel_left, 0), "seek_alphanumeric_or_camel_left", 31, "Seek left for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 106, "/home/allen/4ed/code/4coder_seek.cpp", 36, 1239 }, +{ PROC_LINKS(seek_alphanumeric_or_camel_right, 0), "seek_alphanumeric_or_camel_right", 32, "Seek right for boundary between alphanumeric characters or camel case word and non-alphanumeric characters.", 107, "/home/allen/4ed/code/4coder_seek.cpp", 36, 1233 }, +{ PROC_LINKS(seek_alphanumeric_right, 0), "seek_alphanumeric_right", 23, "Seek right for boundary between alphanumeric characters and non-alphanumeric characters.", 88, "/home/allen/4ed/code/4coder_seek.cpp", 36, 1221 }, +{ PROC_LINKS(seek_beginning_of_line, 0), "seek_beginning_of_line", 22, "Seeks the cursor to the beginning of the visual line.", 53, "/home/allen/4ed/code/4coder_seek.cpp", 36, 1126 }, +{ PROC_LINKS(seek_beginning_of_textual_line, 0), "seek_beginning_of_textual_line", 30, "Seeks the cursor to the beginning of the line across all text.", 62, "/home/allen/4ed/code/4coder_seek.cpp", 36, 1108 }, +{ PROC_LINKS(seek_end_of_line, 0), "seek_end_of_line", 16, "Seeks the cursor to the end of the visual line.", 47, "/home/allen/4ed/code/4coder_seek.cpp", 36, 1137 }, +{ PROC_LINKS(seek_end_of_textual_line, 0), "seek_end_of_textual_line", 24, "Seeks the cursor to the end of the line across all text.", 56, "/home/allen/4ed/code/4coder_seek.cpp", 36, 1117 }, +{ PROC_LINKS(seek_token_left, 0), "seek_token_left", 15, "Seek left for the next beginning of a token.", 44, "/home/allen/4ed/code/4coder_seek.cpp", 36, 1203 }, +{ PROC_LINKS(seek_token_right, 0), "seek_token_right", 16, "Seek right for the next end of a token.", 39, "/home/allen/4ed/code/4coder_seek.cpp", 36, 1197 }, +{ PROC_LINKS(seek_white_or_token_left, 0), "seek_white_or_token_left", 24, "Seek left for the next end of a token or boundary between whitespace and non-whitespace.", 88, "/home/allen/4ed/code/4coder_seek.cpp", 36, 1215 }, +{ PROC_LINKS(seek_white_or_token_right, 0), "seek_white_or_token_right", 25, "Seek right for the next end of a token or boundary between whitespace and non-whitespace.", 89, "/home/allen/4ed/code/4coder_seek.cpp", 36, 1209 }, +{ PROC_LINKS(seek_whitespace_down, 0), "seek_whitespace_down", 20, "Seeks the cursor down to the next blank line.", 45, "/home/allen/4ed/code/4coder_seek.cpp", 36, 1099 }, +{ PROC_LINKS(seek_whitespace_down_end_line, 0), "seek_whitespace_down_end_line", 29, "Seeks the cursor down to the next blank line and places it at the end of the line.", 82, "/home/allen/4ed/code/4coder_seek.cpp", 36, 1158 }, +{ PROC_LINKS(seek_whitespace_left, 0), "seek_whitespace_left", 20, "Seek left for the next boundary between whitespace and non-whitespace.", 70, "/home/allen/4ed/code/4coder_seek.cpp", 36, 1191 }, +{ PROC_LINKS(seek_whitespace_right, 0), "seek_whitespace_right", 21, "Seek right for the next boundary between whitespace and non-whitespace.", 71, "/home/allen/4ed/code/4coder_seek.cpp", 36, 1185 }, +{ PROC_LINKS(seek_whitespace_up, 0), "seek_whitespace_up", 18, "Seeks the cursor up to the next blank line.", 43, "/home/allen/4ed/code/4coder_seek.cpp", 36, 1090 }, +{ PROC_LINKS(seek_whitespace_up_end_line, 0), "seek_whitespace_up_end_line", 27, "Seeks the cursor up to the next blank line and places it at the end of the line.", 80, "/home/allen/4ed/code/4coder_seek.cpp", 36, 1148 }, +{ PROC_LINKS(select_all, 0), "select_all", 10, "Puts the cursor at the top of the file, and the mark at the bottom of the file.", 79, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 317 }, +{ PROC_LINKS(set_bindings_choose, 0), "set_bindings_choose", 19, "Remap keybindings using the 'choose' mapping rule.", 50, "/home/allen/4ed/code/4coder_remapping_commands.cpp", 50, 47 }, +{ PROC_LINKS(set_bindings_default, 0), "set_bindings_default", 20, "Remap keybindings using the 'default' mapping rule.", 51, "/home/allen/4ed/code/4coder_remapping_commands.cpp", 50, 61 }, +{ PROC_LINKS(set_bindings_mac_default, 0), "set_bindings_mac_default", 24, "Remap keybindings using the 'mac-default' mapping rule.", 55, "/home/allen/4ed/code/4coder_remapping_commands.cpp", 50, 75 }, +{ PROC_LINKS(set_mark, 0), "set_mark", 8, "Sets the mark to the current position of the cursor.", 52, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 86 }, +{ PROC_LINKS(setup_build_bat, 0), "setup_build_bat", 15, "Queries the user for several configuration options and initializes a new build batch script.", 92, "/home/allen/4ed/code/4coder_project_commands.cpp", 48, 1488 }, +{ PROC_LINKS(setup_build_bat_and_sh, 0), "setup_build_bat_and_sh", 22, "Queries the user for several configuration options and initializes a new build batch script.", 92, "/home/allen/4ed/code/4coder_project_commands.cpp", 48, 1500 }, +{ PROC_LINKS(setup_build_sh, 0), "setup_build_sh", 14, "Queries the user for several configuration options and initializes a new build shell script.", 92, "/home/allen/4ed/code/4coder_project_commands.cpp", 48, 1494 }, +{ PROC_LINKS(setup_new_project, 0), "setup_new_project", 17, "Queries the user for several configuration options and initializes a new 4coder project with build scripts for every OS.", 120, "/home/allen/4ed/code/4coder_project_commands.cpp", 48, 1481 }, +{ PROC_LINKS(show_filebar, 0), "show_filebar", 12, "Sets the current view to show it's filebar.", 43, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 464 }, +{ PROC_LINKS(show_scrollbar, 0), "show_scrollbar", 14, "Sets the current view to show it's scrollbar.", 45, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 450 }, +{ PROC_LINKS(snipe_token_or_word, 0), "snipe_token_or_word", 19, "Delete a single, whole token on or to the left of the cursor and post it to the clipboard.", 90, "/home/allen/4ed/code/4coder_seek.cpp", 36, 1259 }, +{ PROC_LINKS(snipe_token_or_word_right, 0), "snipe_token_or_word_right", 25, "Delete a single, whole token on or to the right of the cursor and post it to the clipboard.", 91, "/home/allen/4ed/code/4coder_seek.cpp", 36, 1265 }, +{ PROC_LINKS(suppress_mouse, 0), "suppress_mouse", 14, "Hides the mouse and causes all mosue input (clicks, position, wheel) to be ignored.", 83, "/home/allen/4ed/code/4coder_default_framework.cpp", 49, 185 }, +{ PROC_LINKS(swap_buffers_between_panels, 0), "swap_buffers_between_panels", 27, "Set the other non-active panel to view the buffer that the active panel views, and switch to that panel.", 104, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1399 }, +{ PROC_LINKS(to_lowercase, 0), "to_lowercase", 12, "Converts all ascii text in the range between the cursor and the mark to lowercase.", 82, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 348 }, +{ PROC_LINKS(to_uppercase, 0), "to_uppercase", 12, "Converts all ascii text in the range between the cursor and the mark to uppercase.", 82, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 328 }, +{ PROC_LINKS(toggle_filebar, 0), "toggle_filebar", 14, "Toggles the visibility status of the current view's filebar.", 60, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 478 }, +{ PROC_LINKS(toggle_fullscreen, 0), "toggle_fullscreen", 17, "Toggle fullscreen mode on or off. The change(s) do not take effect until the next frame.", 89, "/home/allen/4ed/code/4coder_default_framework.cpp", 49, 203 }, +{ PROC_LINKS(toggle_line_wrap, 0), "toggle_line_wrap", 16, "Toggles the current buffer's line wrapping status.", 50, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 487 }, +{ PROC_LINKS(toggle_mouse, 0), "toggle_mouse", 12, "Toggles the mouse suppression mode, see suppress_mouse and allow_mouse.", 71, "/home/allen/4ed/code/4coder_default_framework.cpp", 49, 197 }, +{ PROC_LINKS(toggle_show_whitespace, 0), "toggle_show_whitespace", 22, "Toggles the current buffer's whitespace visibility status.", 58, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 554 }, +{ PROC_LINKS(toggle_virtual_whitespace, 0), "toggle_virtual_whitespace", 25, "Toggles the current buffer's virtual whitespace status.", 55, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 543 }, +{ PROC_LINKS(undo, 0), "undo", 4, "Advances backwards through the undo history.", 44, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1441 }, +{ 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, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1389 }, +{ 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, "/home/allen/4ed/code/4coder_search.cpp", 38, 820 }, +{ PROC_LINKS(write_and_auto_tab, 0), "write_and_auto_tab", 18, "Inserts a character and auto-indents the line on which the cursor sits.", 71, "/home/allen/4ed/code/4coder_auto_indent.cpp", 43, 745 }, +{ PROC_LINKS(write_block, 0), "write_block", 11, "At the cursor, insert a block comment.", 38, "/home/allen/4ed/code/4coder_combined_write_commands.cpp", 55, 106 }, +{ PROC_LINKS(write_character, 0), "write_character", 15, "Inserts whatever character was used to trigger this command.", 60, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 33 }, +{ PROC_LINKS(write_hack, 0), "write_hack", 10, "At the cursor, insert a '// HACK' comment, includes user name if it was specified in config.4coder.", 99, "/home/allen/4ed/code/4coder_combined_write_commands.cpp", 55, 94 }, +{ PROC_LINKS(write_note, 0), "write_note", 10, "At the cursor, insert a '// NOTE' comment, includes user name if it was specified in config.4coder.", 99, "/home/allen/4ed/code/4coder_combined_write_commands.cpp", 55, 100 }, +{ PROC_LINKS(write_todo, 0), "write_todo", 10, "At the cursor, insert a '// TODO' comment, includes user name if it was specified in config.4coder.", 99, "/home/allen/4ed/code/4coder_combined_write_commands.cpp", 55, 88 }, +{ PROC_LINKS(write_underscore, 0), "write_underscore", 16, "Inserts an underscore.", 22, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 42 }, +{ PROC_LINKS(write_zero_struct, 0), "write_zero_struct", 17, "At the cursor, insert a ' = {0};'.", 34, "/home/allen/4ed/code/4coder_combined_write_commands.cpp", 55, 112 }, }; static int32_t fcoder_metacmd_ID_allow_mouse = 0; static int32_t fcoder_metacmd_ID_auto_tab_line_at_cursor = 1; diff --git a/4coder_helper.h b/4coder_helper.h index a348098f..595cf6af 100644 --- a/4coder_helper.h +++ b/4coder_helper.h @@ -46,6 +46,7 @@ struct Bind_Buffer{ #define PtrAsInt(a) PtrDif(a,0) #define OffsetOfMember(S,m) PtrAsInt(&Member(S,m)) #define CastFromMember(S,m,ptr) (S*)( (uint8_t*)(ptr) - OffsetOfMember(S,m) ) +#define IntAsPtr(a) (void*)(((uint8_t*)0) + a) #if !defined(max_f32) inline float @@ -86,8 +87,8 @@ struct File_Name_Data{ struct File_Name_Path_Data{ String file_name; String path; -String data; - }; + String data; +}; //////////////////////////////// @@ -95,8 +96,8 @@ struct Buffer_Rect{ int32_t char0; int32_t line0; int32_t char1; -int32_t line1; - }; + int32_t line1; +}; //////////////////////////////// diff --git a/4coder_lists.cpp b/4coder_lists.cpp index 432c0197..929c57c3 100644 --- a/4coder_lists.cpp +++ b/4coder_lists.cpp @@ -378,6 +378,45 @@ begin_integrated_lister__with_fixed_options(Application_Links *app, char *query_ view); } +static void +begin_integrated_lister__ui_list(Application_Links *app, char *query_string, + Lister_Handlers handlers, void *user_data, + Lister_UI_Option *options, int32_t option_count, + View_Summary *view){ + Partition *scratch = &global_part; + General_Memory *general = &global_general; + 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); + init_lister_state(state, general); + lister_first_init(&state->lister); + state->lister.theme_list = true; + for (int32_t i = 0; i < option_count; i += 1){ + lister_add_ui_item(&state->arena, &state->lister, + make_string_slowly(options[i].string), + options[i].index, + options[i].user_data, 0); + } + 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_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, + options, option_count, + view); +} + //////////////////////////////// static void @@ -394,7 +433,7 @@ generate_all_buffers_list(Application_Links *app, Partition *arena, Lister *list case DirtyState_UnsavedChanges: status = make_lit_string(" *"); break; case DirtyState_UnloadedChanges: status = make_lit_string(" !"); break; } - lister_add_item(arena, lister, buffer_name, status, (void*)buffer_id, 0); + lister_add_item(arena, lister, buffer_name, status, IntAsPtr(buffer_id), 0); } } @@ -491,9 +530,9 @@ enum{ static Lister_Activation_Code activate_confirm_kill(Application_Links *app, View_Summary *view, String text_field, void *user_data, bool32 clicked){ - int32_t behavior = (int32_t)user_data; + int32_t behavior = PtrAsInt(user_data); Lister_State *state = view_get_lister_state(view); - Buffer_ID buffer_id = (Buffer_ID)(state->lister.user_data); + Buffer_ID buffer_id = (Buffer_ID)(PtrAsInt(state->lister.user_data)); switch (behavior){ case SureToKill_No: {}break; @@ -525,13 +564,13 @@ activate_confirm_kill(Application_Links *app, View_Summary *view, String text_fi static void do_gui_sure_to_kill(Application_Links *app, Buffer_Summary *buffer, View_Summary *view){ Lister_Fixed_Option options[] = { - {"(N)o" , "", "Nn", (void*)SureToKill_No }, - {"(Y)es" , "", "Yy", (void*)SureToKill_Yes }, - {"(S)ave and Kill", "", "Ss", (void*)SureToKill_Save}, + {"(N)o" , "", "Nn", IntAsPtr(SureToKill_No) }, + {"(Y)es" , "", "Yy", IntAsPtr(SureToKill_Yes) }, + {"(S)ave and Kill", "", "Ss", IntAsPtr(SureToKill_Save)}, }; 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, (void*)buffer->buffer_id, + activate_confirm_kill, IntAsPtr(buffer->buffer_id), options, option_count, view); } @@ -539,7 +578,7 @@ do_gui_sure_to_kill(Application_Links *app, Buffer_Summary *buffer, View_Summary static Lister_Activation_Code activate_confirm_close_4coder(Application_Links *app, View_Summary *view, String text_field, void *user_data, bool32 clicked){ - int32_t behavior = (int32_t)user_data; + int32_t behavior = PtrAsInt(user_data); switch (behavior){ case SureToKill_No: {}break; @@ -581,7 +620,7 @@ static Lister_Activation_Code activate_switch_buffer(Application_Links *app, View_Summary *view, String text_field, void *user_data, bool32 activated_by_mouse){ if (user_data != 0){ - Buffer_ID buffer_id = (Buffer_ID)(user_data); + Buffer_ID buffer_id = (Buffer_ID)(PtrAsInt(user_data)); view_set_buffer(app, view, buffer_id, SetBuffer_KeepOriginalGUI); } return(ListerActivation_Finished); @@ -599,7 +638,7 @@ static Lister_Activation_Code activate_kill_buffer(Application_Links *app, View_Summary *view, String text_field, void *user_data, bool32 activated_by_mouse){ if (user_data != 0){ - Buffer_ID buffer_id = (Buffer_ID)(user_data); + Buffer_ID buffer_id = (Buffer_ID)(PtrAsInt(user_data)); kill_buffer(app, buffer_identifier(buffer_id), view->view_id, 0); } return(ListerActivation_Finished); @@ -742,5 +781,38 @@ CUSTOM_DOC("Interactively opens a file.") begin_integrated_lister__file_system_list(app, "Open: ", activate_open, 0, &view); } +static Lister_Activation_Code +activate_select_theme(Application_Links *app, View_Summary *view, String text_field, + void *user_data, bool32 clicked){ + Lister_Activation_Code result = ListerActivation_Finished; + change_theme_by_index(app, PtrAsInt(user_data)); + return(result); +} + +CUSTOM_COMMAND_SIG(open_color_tweaker) +CUSTOM_DOC("Opens the 4coder theme selector list.") +{ + Partition *scratch = &global_part; + Temp_Memory temp = begin_temp_memory(scratch); + + View_Summary view = get_active_view(app, AccessAll); + for (;view_end_ui_mode(app, &view);); + int32_t theme_count = get_theme_count(app); + Lister_UI_Option *options = push_array(scratch, Lister_UI_Option, theme_count); + for (int32_t i = 0; i < theme_count; i += 1){ + String name = get_theme_name(app, scratch, i); + options[i].string = name.str; + options[i].index = i; + options[i].user_data = IntAsPtr(i); + } + begin_integrated_lister__ui_list(app, + "Select a theme: ", + activate_select_theme, 0, + options, theme_count, + &view); + + end_temp_memory(temp); +} + // BOTTOM diff --git a/4coder_ui_helper.cpp b/4coder_ui_helper.cpp index 95f9bdd6..0abb3919 100644 --- a/4coder_ui_helper.cpp +++ b/4coder_ui_helper.cpp @@ -231,10 +231,18 @@ lister_get_clicked_item(Application_Links *app, View_Summary *view, Partition *s static void lister_update_ui(Application_Links *app, Partition *scratch, View_Summary *view, Lister_State *state){ + bool32 is_theme_list = state->lister.theme_list; + int32_t x0 = 0; int32_t x1 = view->view_region.x1 - view->view_region.x0; int32_t line_height = (int32_t)view->line_height; - int32_t block_height = line_height*2; + int32_t block_height = 0; + if (is_theme_list){ + block_height = line_height*3 + 6; + } + else{ + block_height = line_height*2; + } Temp_Memory full_temp = begin_temp_memory(scratch); @@ -266,11 +274,18 @@ lister_update_ui(Application_Links *app, Partition *scratch, View_Summary *view, y_pos = item_rect.y1; UI_Item item = {0}; - item.type = UIType_Option; + if (!is_theme_list){ + item.type = UIType_Option; + item.option.string = node->string; + item.option.status = node->status; + } + else{ + item.type = UIType_ColorTheme; + item.color_theme.string = node->string; + item.color_theme.index = node->index; + } item.activation_level = UIActivation_None; item.coordinates = UICoordinates_Scrolled; - item.string = node->string; - item.status = node->status; item.user_data = node->user_data; item.rectangle = item_rect; @@ -327,8 +342,8 @@ lister_update_ui(Application_Links *app, Partition *scratch, View_Summary *view, item.type = UIType_TextField; item.activation_level = UIActivation_Active; item.coordinates = UICoordinates_ViewRelative; - item.query = state->lister.query; - item.string = state->lister.text_field; + item.text_field.query = state->lister.query; + item.text_field.string = state->lister.text_field; item.user_data = 0; item.rectangle = item_rect; ui_list_add_item(scratch, &list, item); @@ -405,6 +420,31 @@ lister_add_item(Partition *arena, Lister *lister, user_data, extra_space)); } +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); + node->string = string.string; + node->index = index; + node->user_data = user_data; + zdll_push_back(lister->options.first, lister->options.last, node); + lister->options.count += 1; + void *result = push_array(arena, char, extra_space); + push_align(arena, 8); + return(result); +} + +static void* +lister_add_ui_item(Partition *arena, Lister *lister, + String string, int32_t index, + void *user_data, int32_t extra_space){ + return(lister_add_ui_item(arena, lister, + lister_prealloced(push_string_copy(arena, string)), + index, + user_data, extra_space)); +} + static void* lister_get_user_data(Lister *lister, int32_t index){ if (0 <= index && index < lister->options.count){ diff --git a/4coder_ui_helper.h b/4coder_ui_helper.h index 13dc3467..cbdd2f3a 100644 --- a/4coder_ui_helper.h +++ b/4coder_ui_helper.h @@ -23,7 +23,10 @@ struct Lister_Option_Node{ Lister_Option_Node *next; Lister_Option_Node *prev; String string; - String status; + union{ + String status; + int32_t index; + }; void *user_data; }; @@ -55,6 +58,7 @@ struct Lister{ char key_string_space[256]; String key_string; Lister_Option_List options; + bool32 theme_list; }; struct Lister_Prealloced_String{ @@ -81,6 +85,12 @@ struct Lister_Fixed_Option{ void *user_data; }; +struct Lister_UI_Option{ + char *string; + int32_t index; + void *user_data; +}; + #endif // BOTTOM diff --git a/4ed_api_implementation.cpp b/4ed_api_implementation.cpp index a8947655..b90278b1 100644 --- a/4ed_api_implementation.cpp +++ b/4ed_api_implementation.cpp @@ -95,7 +95,6 @@ fill_view_summary(System_Functions *system, View_Summary *view, View *vptr, Live } } - inline void fill_view_summary(System_Functions *system, View_Summary *view, View *vptr, Command_Data *cmd){ fill_view_summary(system, view, vptr, &cmd->models->live_set, &cmd->models->working_set); @@ -2281,8 +2280,24 @@ View_Set_UI(Application_Links *app, View_Summary *view, UI_Control *control){ for (UI_Item *item = control->items, *one_past_last = control->items + control->count; item < one_past_last; item += 1){ - string_size += item->query.size; - string_size += item->string.size; + switch (item->type){ + case UIType_Option: + { + string_size += item->option.string.size; + string_size += item->option.status.size; + }break; + + case UIType_TextField: + { + string_size += item->text_field.query.size; + string_size += item->text_field.string.size; + }break; + + case UIType_ColorTheme: + { + string_size += item->color_theme.string.size; + }break; + } } i32 all_items_size = sizeof(UI_Item)*control->count; @@ -2296,10 +2311,30 @@ View_Set_UI(Application_Links *app, View_Summary *view, UI_Control *control){ for (UI_Item *item = new_items, *one_past_last = new_items + count; item < one_past_last; item += 1){ + String *fixup[2]; - fixup[0] = &item->query; - fixup[1] = &item->string; - for (i32 i = 0; i < ArrayCount(fixup); i += 1){ + int32_t fixup_count = 0; + switch (item->type){ + case UIType_Option: + { + fixup[0] = &item->option.string; + fixup[1] = &item->option.status; + fixup_count = 2; + }break; + case UIType_TextField: + { + fixup[0] = &item->text_field.query; + fixup[1] = &item->text_field.string; + fixup_count = 2; + }break; + case UIType_ColorTheme: + { + fixup[0] = &item->color_theme.string; + fixup_count = 1; + }break; + } + + for (i32 i = 0; i < fixup_count; i += 1){ String old = *fixup[i]; char *new_str = push_array(&string_alloc, char, old.size); fixup[i]->str = new_str; @@ -2472,6 +2507,35 @@ DOC(This call posts a string to the *messages* buffer.) do_feedback_message(cmd->system, models, make_string(str, len)); } +API_EXPORT int32_t +Get_Theme_Count(Application_Links *app) +{ + Command_Data *cmd = (Command_Data*)app->cmd_context; + Style_Library *library = &cmd->models->styles; + return(library->count); +} + +API_EXPORT String +Get_Theme_Name(Application_Links *app, Partition *arena, int32_t index){ + Command_Data *cmd = (Command_Data*)app->cmd_context; + Style_Library *library = &cmd->models->styles; + + String str = {0}; + if (0 <= index && index < library->count){ + Style *style = &library->styles[index]; + char *mem = push_array(arena, char, style->name.size + 1); + if (mem != 0){ + str.str = mem; + str.size = style->name.size; + str.memory_size = str.size + 1; + memcpy(str.str, style->name.str, str.size); + str.str[str.size] = 0; + } + } + + return(str); +} + API_EXPORT void Create_Theme(Application_Links *app, Theme *theme, char *name, int32_t len) /* @@ -2518,13 +2582,26 @@ DOC(This call changes 4coder's color pallet to one of the built in themes.) i32 count = styles->count; Style *s = styles->styles; for (i32 i = 0; i < count; ++i, ++s){ - if (match_ss(s->name, theme_name)){ + if (match(s->name, theme_name)){ style_copy(&styles->styles[0], s); break; } } } +API_EXPORT bool32 +Change_Theme_By_Index(Application_Links *app, int32_t index) +{ + Command_Data *cmd = (Command_Data*)app->cmd_context; + Style_Library *styles = &cmd->models->styles; + i32 count = styles->count; + if (0 <= index && index < count){ + style_copy(&styles->styles[0], &styles->styles[index]); + return(true); + } + return(false); +} + API_EXPORT Face_ID Get_Largest_Face_ID(Application_Links *app) /* diff --git a/4ed_defines.h b/4ed_defines.h index 36425651..4eee4161 100644 --- a/4ed_defines.h +++ b/4ed_defines.h @@ -71,6 +71,11 @@ typedef double f64; #if !defined(Member) # define Member(T, m) (((T*)0)->m) #endif +#define PtrDif(a,b) ((uint8_t*)(a) - (uint8_t*)(b)) +#define PtrAsInt(a) PtrDif(a,0) +#define OffsetOfMember(S,m) PtrAsInt(&Member(S,m)) +#define CastFromMember(S,m,ptr) (S*)( (uint8_t*)(ptr) - OffsetOfMember(S,m) ) +#define IntAsPtr(a) (void*)(((uint8_t*)0) + a) #define STR__(s) #s #define STR_(s) STR__(s) diff --git a/4ed_math.h b/4ed_math.h index e7995acc..dc45505d 100644 --- a/4ed_math.h +++ b/4ed_math.h @@ -598,6 +598,16 @@ i32R(int32_t l, int32_t t, int32_t r, int32_t b){ return(rect); } +inline i32_Rect +i32R(f32_Rect r){ + i32_Rect rect; + rect.x0 = (i32)r.x0; + rect.y0 = (i32)r.y0; + rect.x1 = (i32)r.x1; + rect.y1 = (i32)r.y1; + return(rect); +} + inline f32_Rect f32R(float l, float t, float r, float b){ f32_Rect rect; diff --git a/4ed_style.h b/4ed_style.h index b3d19250..424d695e 100644 --- a/4ed_style.h +++ b/4ed_style.h @@ -40,7 +40,8 @@ style_set_name(Style *style, String name){ struct Style_Library{ Style styles[64]; - i32 count, max; + i32 count; + i32 max; }; #endif diff --git a/4ed_view_ui.cpp b/4ed_view_ui.cpp index 9f71358a..8f87b1fe 100644 --- a/4ed_view_ui.cpp +++ b/4ed_view_ui.cpp @@ -241,6 +241,10 @@ do_render_file_view(System_Functions *system, View *view, Models *models, GUI_Sc i32 line_height = view->transient.line_height; Style *style = &models->styles.styles[0]; Face_ID font_id = file->settings.font_id; + char font_name_space[256]; + String font_name = make_fixed_width_string(font_name_space); + font_name.size = system->font.get_name_by_id(font_id, font_name.str, font_name.memory_size); + Font_Pointers font = system->font.get_pointers_by_id(font_id); if (!view->transient.hide_file_bar){ i32_Rect top_bar_rect = {0}; @@ -318,8 +322,8 @@ do_render_file_view(System_Functions *system, View *view, Models *models, GUI_Sc draw_margin(target, item_rect, inner, margin_color); i32 x = (i32)inner.x0 + 3; i32 y = (i32)inner.y0 + line_height/2 - 1; - x = ceil32(draw_string(system, target, font_id, item->string, x, y, text_color)); - draw_string(system, target, font_id, item->status, x, y, pop_color); + x = ceil32(draw_string(system, target, font_id, item->option.string, x, y, text_color)); + draw_string(system, target, font_id, item->option.status, x, y, pop_color); }break; case UIType_TextField: @@ -330,8 +334,51 @@ do_render_file_view(System_Functions *system, View *view, Models *models, GUI_Sc draw_rectangle(target, item_rect, back_color); i32 x = (i32)item_rect.x0; i32 y = (i32)item_rect.y0 + 2; - x = ceil32(draw_string(system, target, font_id, item->query, x, y, text2_color)); - draw_string(system, target, font_id, item->string, x, y, text1_color); + x = ceil32(draw_string(system, target, font_id, item->text_field.query, x, y, text2_color)); + draw_string(system, target, font_id, item->text_field.string, x, y, text1_color); + }break; + + case UIType_ColorTheme: + { + Style *style_preview = &models->styles.styles[item->color_theme.index]; + u32 margin_color = style_get_margin_color(item->activation_level, style_preview); + u32 back = style_preview->main.back_color; + u32 text_color = style_preview->main.default_color; + u32 keyword_color = style_preview->main.keyword_color; + u32 int_constant_color = style_preview->main.int_constant_color; + u32 comment_color = style_preview->main.comment_color; + + f32_Rect inner = get_inner_rect(item_rect, 3); + + draw_margin(target, item_rect, inner, margin_color); + draw_rectangle(target, inner, back); + + i32 y = (i32)inner.y0; + i32 x = (i32)inner.x0; + String str = item->color_theme.string; + if (str.str == 0){ + str = style_preview->name; + } + x = ceil32(draw_string(system, target, font_id, str, x, y, text_color)); + i32 font_x = (i32)(inner.x1 - font_string_width(system, target, font_id, font_name)); + if (font_x > x + 10){ + draw_string(system, target, font_id, font_name, font_x, y, text_color); + } + + i32 height = font.metrics->height; + x = inner.x0; + y += height; + x = ceil32(draw_string(system, target, font_id, "if", x, y, keyword_color)); + x = ceil32(draw_string(system, target, font_id, "(x < ", x, y, text_color)); + x = ceil32(draw_string(system, target, font_id, "0", x, y, int_constant_color)); + x = ceil32(draw_string(system, target, font_id, ") { x = ", x, y, text_color)); + x = ceil32(draw_string(system, target, font_id, "0", x, y, int_constant_color)); + x = ceil32(draw_string(system, target, font_id, "; } ", x, y, text_color)); + x = ceil32(draw_string(system, target, font_id, "// comment", x, y, comment_color)); + + x = inner.x0; + y += height; + draw_string(system, target, font_id, "[] () {}; * -> +-/ <>= ! && || % ^", x, y, text_color); }break; } } diff --git a/themes/theme-sunlight.4coder b/themes/theme-sunlight.4coder new file mode 100644 index 00000000..83907010 --- /dev/null +++ b/themes/theme-sunlight.4coder @@ -0,0 +1,38 @@ +name = "sunlight"; + +Back = 0xFFDFDFDF; +Margin = 0xFFC7C7C7; +Margin_Hover = 0xFFBFBFBF; +Margin_Active = 0xFFB7B7B7; +List_Item = Margin; +List_Item_Hover = Margin_Hover; +List_Item_Active = Margin_Active; +Cursor = 0xFF222222; +At_Cursor = Back; +Mark = 0xFF797979; +Highlight = 0xFFFF9979; +At_Highlight = Back; +Default = 0xFF47474F; +Comment = 0xFF953FFF; +Keyword = 0xFF002255; +Str_Constant = Keyword; +Char_Constant = Str_Constant; +Int_Constant = Str_Constant; +Float_Constant = Str_Constant; +Bool_Constant = Str_Constant; +Include = Str_Constant; +Preproc = 0xFF000000; +Special_Character = 0xFF00FFFF; +Ghost_Character = 0xFF929292; + +Paste = 0xFFFF0000; +Undo = 0xFF00FF00; + +Highlight_Junk = 0xFFB7DFDF; +Highlight_White = 0xFFC7C7C7; + +Bar = 0xFF909090; +Bar_Active = 0xFFC1C1C1; +Base = 0xFFFFFFFF; +Pop1 = 0xFFFF4F2F; +Pop2 = 0xFF00C5FF; From fc5df0c118809383a10ba58459015f55da262a73 Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Fri, 10 Aug 2018 15:57:46 -0700 Subject: [PATCH 2/4] Reload themes --- 4coder_base_commands.cpp | 43 ++++++- 4coder_config.cpp | 5 +- 4coder_generated/command_metadata.h | 173 ++++++++++++++-------------- 4coder_long_command_switch.cpp | 3 + 4ed_api_implementation.cpp | 9 +- 5 files changed, 138 insertions(+), 95 deletions(-) diff --git a/4coder_base_commands.cpp b/4coder_base_commands.cpp index 5f8ca3a5..6a2117a2 100644 --- a/4coder_base_commands.cpp +++ b/4coder_base_commands.cpp @@ -974,18 +974,30 @@ CUSTOM_DOC("Queries the user for a string, and incrementally replace every occur //////////////////////////////// -CUSTOM_COMMAND_SIG(save_all_dirty_buffers) -CUSTOM_DOC("Saves all buffers marked dirty (showing the '*' indicator).") -{ +static void +save_all_dirty_buffers_with_postfix(Application_Links *app, String postfix){ for (Buffer_Summary buffer = get_buffer_first(app, AccessOpen); buffer.exists; get_buffer_next(app, &buffer, AccessOpen)){ if (buffer.dirty == DirtyState_UnsavedChanges){ - save_buffer(app, &buffer, buffer.file_name, buffer.file_name_len, 0); + String file_name = make_string(buffer.file_name, buffer.file_name_len); + if (file_name.size >= postfix.size){ + String file_name_post = substr_tail(file_name, file_name.size - postfix.size); + if (match(file_name_post, postfix)){ + save_buffer(app, &buffer, buffer.file_name, buffer.file_name_len, 0); + } + } } } } +CUSTOM_COMMAND_SIG(save_all_dirty_buffers) +CUSTOM_DOC("Saves all buffers marked dirty (showing the '*' indicator).") +{ + String empty = {0}; + save_all_dirty_buffers_with_postfix(app, empty); +} + static void delete_file_base(Application_Links *app, String file_name, Buffer_ID buffer_id){ String path = path_of_directory(file_name); @@ -1464,6 +1476,29 @@ CUSTOM_DOC("Saves the current buffer.") //////////////////////////////// +CUSTOM_COMMAND_SIG(reload_themes) +CUSTOM_DOC("Loads all the theme files in the theme folder, replacing duplicates with the new theme data.") +{ + String fcoder_extension = make_lit_string(".4coder"); + save_all_dirty_buffers_with_postfix(app, fcoder_extension); + + Partition *scratch = &global_part; + Temp_Memory temp = begin_temp_memory(scratch); + load_folder_of_themes_into_live_set(app, scratch, "themes"); + String name = get_theme_name(app, scratch, 0); + int32_t theme_count = get_theme_count(app); + for (int32_t i = 1; i < theme_count; i += 1){ + Temp_Memory sub_temp = begin_temp_memory(scratch); + String style_name = get_theme_name(app, scratch, i); + if (match(name, style_name)){ + change_theme_by_index(app, i); + break; + } + end_temp_memory(sub_temp); + } + end_temp_memory(temp); +} + CUSTOM_COMMAND_SIG(open_in_other) CUSTOM_DOC("Interactively opens a file in the other panel.") { diff --git a/4coder_config.cpp b/4coder_config.cpp index 00902f11..de514bcb 100644 --- a/4coder_config.cpp +++ b/4coder_config.cpp @@ -1681,9 +1681,10 @@ load_folder_of_themes_into_live_set(Application_Links *app, Partition *scratch, File_List list = get_file_list(app, path.str, path.size); for (uint32_t i = 0; i < list.count; ++i){ File_Info *info = &list.infos[i]; - if (info->folder) continue; + if (info->folder){ + continue; + } String info_file_name = make_string(info->filename, info->filename_len); - if (!match(file_extension(info_file_name), "4coder")) continue; char file_name_space[512]; String file_name = make_fixed_width_string(file_name_space); copy(&file_name, path); diff --git a/4coder_generated/command_metadata.h b/4coder_generated/command_metadata.h index 658a8d1b..e5d7877e 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 201 +#define command_one_past_last_id 202 #if defined(CUSTOM_COMMAND_SIG) #define PROC_LINKS(x,y) x #else @@ -146,6 +146,7 @@ CUSTOM_COMMAND_SIG(query_replace); CUSTOM_COMMAND_SIG(query_replace_identifier); CUSTOM_COMMAND_SIG(query_replace_selection); CUSTOM_COMMAND_SIG(redo); +CUSTOM_COMMAND_SIG(reload_themes); CUSTOM_COMMAND_SIG(remap_interactive); CUSTOM_COMMAND_SIG(rename_file_query); CUSTOM_COMMAND_SIG(reopen); @@ -221,7 +222,7 @@ char *source_name; int32_t source_name_len; int32_t line_number; }; -static Command_Metadata fcoder_metacmd_table[201] = { +static Command_Metadata fcoder_metacmd_table[202] = { { PROC_LINKS(allow_mouse, 0), "allow_mouse", 11, "Shows the mouse and causes all mouse input to be processed normally.", 68, "/home/allen/4ed/code/4coder_default_framework.cpp", 49, 191 }, { PROC_LINKS(auto_tab_line_at_cursor, 0), "auto_tab_line_at_cursor", 23, "Auto-indents the line on which the cursor sits.", 47, "/home/allen/4ed/code/4coder_auto_indent.cpp", 43, 722 }, { PROC_LINKS(auto_tab_range, 0), "auto_tab_range", 14, "Auto-indents the range between the cursor and the mark.", 55, "/home/allen/4ed/code/4coder_auto_indent.cpp", 43, 733 }, @@ -248,11 +249,11 @@ static Command_Metadata fcoder_metacmd_table[201] = { { PROC_LINKS(decrease_line_wrap, 0), "decrease_line_wrap", 18, "Decrases the current buffer's width for line wrapping.", 54, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 508 }, { PROC_LINKS(delete_char, 0), "delete_char", 11, "Deletes the character to the right of the cursor.", 49, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 49 }, { PROC_LINKS(delete_current_scope, 0), "delete_current_scope", 20, "Deletes the braces surrounding the currently selected scope. Leaves the contents within the scope.", 99, "/home/allen/4ed/code/4coder_scope_commands.cpp", 46, 487 }, -{ PROC_LINKS(delete_file_query, 0), "delete_file_query", 17, "Deletes the file of the current buffer if 4coder has the appropriate access rights. Will ask the user for confirmation first.", 125, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1012 }, -{ PROC_LINKS(delete_line, 0), "delete_line", 11, "Delete the line the on which the cursor sits.", 45, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1262 }, +{ PROC_LINKS(delete_file_query, 0), "delete_file_query", 17, "Deletes the file of the current buffer if 4coder has the appropriate access rights. Will ask the user for confirmation first.", 125, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1024 }, +{ PROC_LINKS(delete_line, 0), "delete_line", 11, "Delete the line the on which the cursor sits.", 45, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1274 }, { PROC_LINKS(delete_range, 0), "delete_range", 12, "Deletes the text in the range between the cursor and the mark.", 62, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 107 }, { PROC_LINKS(delete_word, 0), "delete_word", 11, "Delete characters between the cursor position and the first alphanumeric boundary to the right.", 95, "/home/allen/4ed/code/4coder_seek.cpp", 36, 1253 }, -{ PROC_LINKS(duplicate_line, 0), "duplicate_line", 14, "Create a copy of the line on which the cursor sits.", 51, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1240 }, +{ PROC_LINKS(duplicate_line, 0), "duplicate_line", 14, "Create a copy of the line on which the cursor sits.", 51, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1252 }, { PROC_LINKS(eol_dosify, 0), "eol_dosify", 10, "Puts the buffer in DOS line ending mode.", 40, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 561 }, { PROC_LINKS(eol_nixify, 0), "eol_nixify", 10, "Puts the buffer in NIX line ending mode.", 40, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 569 }, { PROC_LINKS(execute_any_cli, 0), "execute_any_cli", 15, "Queries for an output buffer name and system command, runs the system command as a CLI and prints the output to the specified buffer.", 133, "/home/allen/4ed/code/4coder_system_command.cpp", 46, 23 }, @@ -290,7 +291,7 @@ static Command_Metadata fcoder_metacmd_table[201] = { { PROC_LINKS(interactive_open, 0), "interactive_open", 16, "Interactively opens a file.", 27, "/home/allen/4ed/code/4coder_lists.cpp", 37, 776 }, { PROC_LINKS(interactive_open_or_new, 0), "interactive_open_or_new", 23, "Interactively open a file out of the file system.", 49, "/home/allen/4ed/code/4coder_lists.cpp", 37, 716 }, { PROC_LINKS(interactive_switch_buffer, 0), "interactive_switch_buffer", 25, "Interactively switch to an open buffer.", 39, "/home/allen/4ed/code/4coder_lists.cpp", 37, 629 }, -{ PROC_LINKS(kill_buffer, 0), "kill_buffer", 11, "Kills the current buffer.", 25, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1432 }, +{ PROC_LINKS(kill_buffer, 0), "kill_buffer", 11, "Kills the current buffer.", 25, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1444 }, { 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, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 135 }, { PROC_LINKS(list_all_functions_current_buffer, 0), "list_all_functions_current_buffer", 33, "Creates a jump list of lines of the current buffer that appear to define or declare functions.", 94, "/home/allen/4ed/code/4coder_function_list.cpp", 45, 318 }, { PROC_LINKS(list_all_locations, 0), "list_all_locations", 18, "Queries the user for a string and lists all exact case-sensitive matches found in all open buffers.", 99, "/home/allen/4ed/code/4coder_search.cpp", 38, 741 }, @@ -321,13 +322,13 @@ static Command_Metadata fcoder_metacmd_table[201] = { { PROC_LINKS(lister__write_character__file_path, 0), "lister__write_character__file_path", 34, "A lister mode command that inserts a character into the text field of a file system list.", 89, "/home/allen/4ed/code/4coder_lists.cpp", 37, 196 }, { PROC_LINKS(lister__write_character__fixed_list, 0), "lister__write_character__fixed_list", 35, "A lister mode command that handles input for the fixed sure to kill list.", 73, "/home/allen/4ed/code/4coder_lists.cpp", 37, 256 }, { PROC_LINKS(load_project, 0), "load_project", 12, "Looks for a project.4coder file in the current directory and tries to load it. Looks in parent directories until a project file is found or there are no more parents.", 167, "/home/allen/4ed/code/4coder_project_commands.cpp", 48, 1071 }, -{ PROC_LINKS(make_directory_query, 0), "make_directory_query", 20, "Queries the user for a name and creates a new directory with the given name.", 76, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1120 }, +{ PROC_LINKS(make_directory_query, 0), "make_directory_query", 20, "Queries the user for a name and creates a new directory with the given name.", 76, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1132 }, { PROC_LINKS(move_down, 0), "move_down", 9, "Moves the cursor down one line.", 31, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 250 }, { PROC_LINKS(move_down_10, 0), "move_down_10", 12, "Moves the cursor down ten lines.", 32, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 262 }, { PROC_LINKS(move_down_textual, 0), "move_down_textual", 17, "Moves down to the next line of actual text, regardless of line wrapping.", 72, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 268 }, { PROC_LINKS(move_left, 0), "move_left", 9, "Moves the cursor one character to the left.", 43, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 299 }, -{ PROC_LINKS(move_line_down, 0), "move_line_down", 14, "Swaps the line under the cursor with the line below it, and moves the cursor down with it.", 90, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1217 }, -{ PROC_LINKS(move_line_up, 0), "move_line_up", 12, "Swaps the line under the cursor with the line above it, and moves the cursor up with it.", 88, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1153 }, +{ PROC_LINKS(move_line_down, 0), "move_line_down", 14, "Swaps the line under the cursor with the line below it, and moves the cursor down with it.", 90, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1229 }, +{ PROC_LINKS(move_line_up, 0), "move_line_up", 12, "Swaps the line under the cursor with the line above it, and moves the cursor up with it.", 88, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1165 }, { PROC_LINKS(move_right, 0), "move_right", 10, "Moves the cursor one character to the right.", 44, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 308 }, { PROC_LINKS(move_up, 0), "move_up", 7, "Moves the cursor up one line.", 29, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 244 }, { PROC_LINKS(move_up_10, 0), "move_up_10", 10, "Moves the cursor up ten lines.", 30, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 256 }, @@ -338,12 +339,12 @@ static Command_Metadata fcoder_metacmd_table[201] = { { 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, "/home/allen/4ed/code/4coder_project_commands.cpp", 48, 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, "/home/allen/4ed/code/4coder_project_commands.cpp", 48, 1062 }, { PROC_LINKS(open_color_tweaker, 0), "open_color_tweaker", 18, "Opens the 4coder theme selector list.", 37, "/home/allen/4ed/code/4coder_lists.cpp", 37, 792 }, -{ 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, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1339 }, -{ PROC_LINKS(open_in_other, 0), "open_in_other", 13, "Interactively opens a file in the other panel.", 46, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1467 }, +{ 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, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1351 }, +{ PROC_LINKS(open_in_other, 0), "open_in_other", 13, "Interactively opens a file in the other panel.", 46, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1502 }, { PROC_LINKS(open_long_braces, 0), "open_long_braces", 16, "At the cursor, insert a '{' and '}' separated by a blank line.", 62, "/home/allen/4ed/code/4coder_combined_write_commands.cpp", 55, 58 }, { PROC_LINKS(open_long_braces_break, 0), "open_long_braces_break", 22, "At the cursor, insert a '{' and '}break;' separated by a blank line.", 68, "/home/allen/4ed/code/4coder_combined_write_commands.cpp", 55, 74 }, { PROC_LINKS(open_long_braces_semicolon, 0), "open_long_braces_semicolon", 26, "At the cursor, insert a '{' and '};' separated by a blank line.", 63, "/home/allen/4ed/code/4coder_combined_write_commands.cpp", 55, 66 }, -{ PROC_LINKS(open_matching_file_cpp, 0), "open_matching_file_cpp", 22, "If the current file is a *.cpp or *.h, attempts to open the corresponding *.h or *.cpp file in the other view.", 110, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1375 }, +{ PROC_LINKS(open_matching_file_cpp, 0), "open_matching_file_cpp", 22, "If the current file is a *.cpp or *.h, attempts to open the corresponding *.h or *.cpp file in the other view.", 110, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1387 }, { PROC_LINKS(open_panel_hsplit, 0), "open_panel_hsplit", 17, "Create a new panel by horizontally splitting the active panel.", 62, "/home/allen/4ed/code/4coder_default_framework.cpp", 49, 162 }, { PROC_LINKS(open_panel_vsplit, 0), "open_panel_vsplit", 17, "Create a new panel by vertically splitting the active panel.", 60, "/home/allen/4ed/code/4coder_default_framework.cpp", 49, 153 }, { PROC_LINKS(page_down, 0), "page_down", 9, "Scrolls the view down one view height and moves the cursor down one view height.", 80, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 288 }, @@ -358,16 +359,17 @@ static Command_Metadata fcoder_metacmd_table[201] = { { PROC_LINKS(query_replace, 0), "query_replace", 13, "Queries the user for two strings, and incrementally replaces every occurence of the first string with the second string.", 120, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 912 }, { PROC_LINKS(query_replace_identifier, 0), "query_replace_identifier", 24, "Queries the user for a string, and incrementally replace every occurence of the word or token found at the cursor with the specified string.", 140, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 932 }, { PROC_LINKS(query_replace_selection, 0), "query_replace_selection", 23, "Queries the user for a string, and incrementally replace every occurence of the string found in the selected range with the specified string.", 141, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 950 }, -{ PROC_LINKS(redo, 0), "redo", 4, "Advances forewards through the undo history.", 44, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1447 }, +{ PROC_LINKS(redo, 0), "redo", 4, "Advances forewards through the undo history.", 44, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1459 }, +{ PROC_LINKS(reload_themes, 0), "reload_themes", 13, "Loads all the theme files in the theme folder, replacing duplicates with the new theme data.", 92, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1479 }, { PROC_LINKS(remap_interactive, 0), "remap_interactive", 17, "Switch to a named key binding map.", 34, "/home/allen/4ed/code/4coder_default_framework.cpp", 49, 211 }, -{ PROC_LINKS(rename_file_query, 0), "rename_file_query", 17, "Queries the user for a new name and renames the file of the current buffer, altering the buffer's name too.", 107, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1078 }, -{ PROC_LINKS(reopen, 0), "reopen", 6, "Reopen the current buffer from the hard drive.", 46, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1453 }, +{ PROC_LINKS(rename_file_query, 0), "rename_file_query", 17, "Queries the user for a new name and renames the file of the current buffer, altering the buffer's name too.", 107, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1090 }, +{ PROC_LINKS(reopen, 0), "reopen", 6, "Reopen the current buffer from the hard drive.", 46, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1465 }, { PROC_LINKS(replace_in_range, 0), "replace_in_range", 16, "Queries the user for two strings, and replaces all occurences of the first string in the range between the cursor and the mark with the second string.", 150, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 810 }, { PROC_LINKS(reverse_search, 0), "reverse_search", 14, "Begins an incremental search up through the current buffer for a user specified string.", 87, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 781 }, { 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, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 799 }, -{ PROC_LINKS(save, 0), "save", 4, "Saves the current buffer.", 25, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1459 }, -{ PROC_LINKS(save_all_dirty_buffers, 0), "save_all_dirty_buffers", 22, "Saves all buffers marked dirty (showing the '*' indicator).", 59, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 977 }, -{ 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, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1038 }, +{ PROC_LINKS(save, 0), "save", 4, "Saves the current buffer.", 25, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1471 }, +{ PROC_LINKS(save_all_dirty_buffers, 0), "save_all_dirty_buffers", 22, "Saves all buffers marked dirty (showing the '*' indicator).", 59, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 994 }, +{ 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, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1050 }, { 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, "/home/allen/4ed/code/4coder_scope_commands.cpp", 46, 738 }, { PROC_LINKS(search, 0), "search", 6, "Begins an incremental search down through the current buffer for a user specified string.", 89, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 774 }, { 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, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 788 }, @@ -403,7 +405,7 @@ static Command_Metadata fcoder_metacmd_table[201] = { { PROC_LINKS(snipe_token_or_word, 0), "snipe_token_or_word", 19, "Delete a single, whole token on or to the left of the cursor and post it to the clipboard.", 90, "/home/allen/4ed/code/4coder_seek.cpp", 36, 1259 }, { PROC_LINKS(snipe_token_or_word_right, 0), "snipe_token_or_word_right", 25, "Delete a single, whole token on or to the right of the cursor and post it to the clipboard.", 91, "/home/allen/4ed/code/4coder_seek.cpp", 36, 1265 }, { PROC_LINKS(suppress_mouse, 0), "suppress_mouse", 14, "Hides the mouse and causes all mosue input (clicks, position, wheel) to be ignored.", 83, "/home/allen/4ed/code/4coder_default_framework.cpp", 49, 185 }, -{ PROC_LINKS(swap_buffers_between_panels, 0), "swap_buffers_between_panels", 27, "Set the other non-active panel to view the buffer that the active panel views, and switch to that panel.", 104, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1399 }, +{ PROC_LINKS(swap_buffers_between_panels, 0), "swap_buffers_between_panels", 27, "Set the other non-active panel to view the buffer that the active panel views, and switch to that panel.", 104, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1411 }, { PROC_LINKS(to_lowercase, 0), "to_lowercase", 12, "Converts all ascii text in the range between the cursor and the mark to lowercase.", 82, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 348 }, { PROC_LINKS(to_uppercase, 0), "to_uppercase", 12, "Converts all ascii text in the range between the cursor and the mark to uppercase.", 82, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 328 }, { PROC_LINKS(toggle_filebar, 0), "toggle_filebar", 14, "Toggles the visibility status of the current view's filebar.", 60, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 478 }, @@ -412,8 +414,8 @@ static Command_Metadata fcoder_metacmd_table[201] = { { PROC_LINKS(toggle_mouse, 0), "toggle_mouse", 12, "Toggles the mouse suppression mode, see suppress_mouse and allow_mouse.", 71, "/home/allen/4ed/code/4coder_default_framework.cpp", 49, 197 }, { PROC_LINKS(toggle_show_whitespace, 0), "toggle_show_whitespace", 22, "Toggles the current buffer's whitespace visibility status.", 58, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 554 }, { PROC_LINKS(toggle_virtual_whitespace, 0), "toggle_virtual_whitespace", 25, "Toggles the current buffer's virtual whitespace status.", 55, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 543 }, -{ PROC_LINKS(undo, 0), "undo", 4, "Advances backwards through the undo history.", 44, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1441 }, -{ 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, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1389 }, +{ PROC_LINKS(undo, 0), "undo", 4, "Advances backwards through the undo history.", 44, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1453 }, +{ 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, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1401 }, { 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, "/home/allen/4ed/code/4coder_search.cpp", 38, 820 }, { PROC_LINKS(write_and_auto_tab, 0), "write_and_auto_tab", 18, "Inserts a character and auto-indents the line on which the cursor sits.", 71, "/home/allen/4ed/code/4coder_auto_indent.cpp", 43, 745 }, { PROC_LINKS(write_block, 0), "write_block", 11, "At the cursor, insert a block comment.", 38, "/home/allen/4ed/code/4coder_combined_write_commands.cpp", 55, 106 }, @@ -561,68 +563,69 @@ 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_remap_interactive = 137; -static int32_t fcoder_metacmd_ID_rename_file_query = 138; -static int32_t fcoder_metacmd_ID_reopen = 139; -static int32_t fcoder_metacmd_ID_replace_in_range = 140; -static int32_t fcoder_metacmd_ID_reverse_search = 141; -static int32_t fcoder_metacmd_ID_reverse_search_identifier = 142; -static int32_t fcoder_metacmd_ID_save = 143; -static int32_t fcoder_metacmd_ID_save_all_dirty_buffers = 144; -static int32_t fcoder_metacmd_ID_save_to_query = 145; -static int32_t fcoder_metacmd_ID_scope_absorb_down = 146; -static int32_t fcoder_metacmd_ID_search = 147; -static int32_t fcoder_metacmd_ID_search_identifier = 148; -static int32_t fcoder_metacmd_ID_seek_alphanumeric_left = 149; -static int32_t fcoder_metacmd_ID_seek_alphanumeric_or_camel_left = 150; -static int32_t fcoder_metacmd_ID_seek_alphanumeric_or_camel_right = 151; -static int32_t fcoder_metacmd_ID_seek_alphanumeric_right = 152; -static int32_t fcoder_metacmd_ID_seek_beginning_of_line = 153; -static int32_t fcoder_metacmd_ID_seek_beginning_of_textual_line = 154; -static int32_t fcoder_metacmd_ID_seek_end_of_line = 155; -static int32_t fcoder_metacmd_ID_seek_end_of_textual_line = 156; -static int32_t fcoder_metacmd_ID_seek_token_left = 157; -static int32_t fcoder_metacmd_ID_seek_token_right = 158; -static int32_t fcoder_metacmd_ID_seek_white_or_token_left = 159; -static int32_t fcoder_metacmd_ID_seek_white_or_token_right = 160; -static int32_t fcoder_metacmd_ID_seek_whitespace_down = 161; -static int32_t fcoder_metacmd_ID_seek_whitespace_down_end_line = 162; -static int32_t fcoder_metacmd_ID_seek_whitespace_left = 163; -static int32_t fcoder_metacmd_ID_seek_whitespace_right = 164; -static int32_t fcoder_metacmd_ID_seek_whitespace_up = 165; -static int32_t fcoder_metacmd_ID_seek_whitespace_up_end_line = 166; -static int32_t fcoder_metacmd_ID_select_all = 167; -static int32_t fcoder_metacmd_ID_set_bindings_choose = 168; -static int32_t fcoder_metacmd_ID_set_bindings_default = 169; -static int32_t fcoder_metacmd_ID_set_bindings_mac_default = 170; -static int32_t fcoder_metacmd_ID_set_mark = 171; -static int32_t fcoder_metacmd_ID_setup_build_bat = 172; -static int32_t fcoder_metacmd_ID_setup_build_bat_and_sh = 173; -static int32_t fcoder_metacmd_ID_setup_build_sh = 174; -static int32_t fcoder_metacmd_ID_setup_new_project = 175; -static int32_t fcoder_metacmd_ID_show_filebar = 176; -static int32_t fcoder_metacmd_ID_show_scrollbar = 177; -static int32_t fcoder_metacmd_ID_snipe_token_or_word = 178; -static int32_t fcoder_metacmd_ID_snipe_token_or_word_right = 179; -static int32_t fcoder_metacmd_ID_suppress_mouse = 180; -static int32_t fcoder_metacmd_ID_swap_buffers_between_panels = 181; -static int32_t fcoder_metacmd_ID_to_lowercase = 182; -static int32_t fcoder_metacmd_ID_to_uppercase = 183; -static int32_t fcoder_metacmd_ID_toggle_filebar = 184; -static int32_t fcoder_metacmd_ID_toggle_fullscreen = 185; -static int32_t fcoder_metacmd_ID_toggle_line_wrap = 186; -static int32_t fcoder_metacmd_ID_toggle_mouse = 187; -static int32_t fcoder_metacmd_ID_toggle_show_whitespace = 188; -static int32_t fcoder_metacmd_ID_toggle_virtual_whitespace = 189; -static int32_t fcoder_metacmd_ID_undo = 190; -static int32_t fcoder_metacmd_ID_view_buffer_other_panel = 191; -static int32_t fcoder_metacmd_ID_word_complete = 192; -static int32_t fcoder_metacmd_ID_write_and_auto_tab = 193; -static int32_t fcoder_metacmd_ID_write_block = 194; -static int32_t fcoder_metacmd_ID_write_character = 195; -static int32_t fcoder_metacmd_ID_write_hack = 196; -static int32_t fcoder_metacmd_ID_write_note = 197; -static int32_t fcoder_metacmd_ID_write_todo = 198; -static int32_t fcoder_metacmd_ID_write_underscore = 199; -static int32_t fcoder_metacmd_ID_write_zero_struct = 200; +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; #endif diff --git a/4coder_long_command_switch.cpp b/4coder_long_command_switch.cpp index 76e9e597..2ea5eb79 100644 --- a/4coder_long_command_switch.cpp +++ b/4coder_long_command_switch.cpp @@ -62,6 +62,9 @@ CUSTOM_DOC("Execute a 'long form' command.") 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")); } diff --git a/4ed_api_implementation.cpp b/4ed_api_implementation.cpp index b90278b1..fb558136 100644 --- a/4ed_api_implementation.cpp +++ b/4ed_api_implementation.cpp @@ -2550,10 +2550,11 @@ DOC(This call creates a new theme. If the given name is already the name of a s b32 hit_existing_theme = false; i32 count = library->count; - Style *style = library->styles; - for (i32 i = 0; i < count; ++i, ++style){ + Style *style = library->styles + 1; + for (i32 i = 1; i < count; ++i, ++style){ if (match(style->name, theme_name)){ style_set_colors(style, theme); + Print_Message(app, "DID THING\n", sizeof("DID THING\n") - 1); hit_existing_theme = true; break; } @@ -2580,8 +2581,8 @@ DOC(This call changes 4coder's color pallet to one of the built in themes.) String theme_name = make_string(name, len); i32 count = styles->count; - Style *s = styles->styles; - for (i32 i = 0; i < count; ++i, ++s){ + Style *s = styles->styles + 1; + for (i32 i = 1; i < count; ++i, ++s){ if (match(s->name, theme_name)){ style_copy(&styles->styles[0], s); break; From f0b9b76d9fd8f95788efc8dce889e160df839d51 Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Fri, 10 Aug 2018 17:42:15 -0700 Subject: [PATCH 3/4] Generic lifetime buckets for core variables --- 4coder_API/types.h | 15 +- 4coder_clipboard.cpp | 15 +- 4coder_default_framework.cpp | 14 +- 4coder_default_hooks.cpp | 7 +- 4coder_generated/app_functions.h | 56 ++++--- 4coder_generated/command_metadata.h | 22 +-- 4coder_search.cpp | 6 +- 4ed_api_implementation.cpp | 230 +++++++++++++++++----------- 4ed_app_models.h | 1 + 4ed_app_target.cpp | 4 +- 4ed_file.h | 1 + 4ed_view.h | 1 - 4ed_working_set.cpp | 5 +- themes/theme-sunlight.4coder | 4 +- 14 files changed, 227 insertions(+), 154 deletions(-) diff --git a/4coder_API/types.h b/4coder_API/types.h index e456b483..78267994 100644 --- a/4coder_API/types.h +++ b/4coder_API/types.h @@ -689,10 +689,17 @@ STRUCT Query_Bar{ String string; }; -/* DOC(This feature is not implemented.) */ -STRUCT Event_Message{ - /* DOC(This feature is not implemented.) */ - int32_t type; +static int32_t CoreVariableIndex_ERROR = -1; + +ENUM(int32_t, Lifetime_Type){ + LifetimeType_View = 0, + LifetimeType_Buffer = 1, +}; + +STRUCT Lifetime_Handle{ + Lifetime_Type type; + View_ID view_id; + Buffer_ID buffer_id; }; ENUM(int16_t, UI_Item_Type){ diff --git a/4coder_clipboard.cpp b/4coder_clipboard.cpp index 9c67e02a..22948eb8 100644 --- a/4coder_clipboard.cpp +++ b/4coder_clipboard.cpp @@ -50,10 +50,10 @@ CUSTOM_DOC("At the cursor, insert the text at the top of the clipboard.") int32_t count = clipboard_count(app, 0); if (count > 0){ View_Summary view = get_active_view(app, access); - - view_set_variable(app, &view, view_next_rewrite_loc, RewritePaste); + Lifetime_Handle view_life = view_get_lifetime_handle(app, view.view_id); + core_variable_set(app, view_life, view_next_rewrite_loc, RewritePaste); int32_t paste_index = 0; - view_set_variable(app, &view, view_paste_index_loc, paste_index); + core_variable_set(app, view_life, view_paste_index_loc, paste_index); int32_t len = clipboard_index(app, 0, paste_index, 0, 0); char *str = 0; @@ -87,15 +87,16 @@ CUSTOM_DOC("If the previous command was paste or paste_next, replaces the paste int32_t count = clipboard_count(app, 0); if (count > 0){ View_Summary view = get_active_view(app, access); + Lifetime_Handle view_life = view_get_lifetime_handle(app, view.view_id); uint64_t rewrite = 0; - view_get_variable(app, &view, view_rewrite_loc, &rewrite); + core_variable_get(app, view_life, view_rewrite_loc, &rewrite); if (rewrite == RewritePaste){ - view_set_variable(app, &view, view_next_rewrite_loc, RewritePaste); + core_variable_set(app, view_life, view_next_rewrite_loc, RewritePaste); uint64_t prev_paste_index = 0; - view_get_variable(app, &view, view_paste_index_loc, &prev_paste_index); + core_variable_get(app, view_life, view_paste_index_loc, &prev_paste_index); int32_t paste_index = (int32_t)prev_paste_index + 1; - view_set_variable(app, &view, view_paste_index_loc, paste_index); + core_variable_set(app, view_life, view_paste_index_loc, paste_index); int32_t len = clipboard_index(app, 0, paste_index, 0, 0); char *str = 0; diff --git a/4coder_default_framework.cpp b/4coder_default_framework.cpp index 9fad4fa7..81835268 100644 --- a/4coder_default_framework.cpp +++ b/4coder_default_framework.cpp @@ -56,13 +56,15 @@ new_view_settings(Application_Links *app, View_Summary *view){ static void view_set_passive(Application_Links *app, View_Summary *view, bool32 value){ - view_set_variable(app, view, view_is_passive_loc, (uint64_t)value); + Lifetime_Handle view_life = view_get_lifetime_handle(app, view->view_id); + core_variable_set(app, view_life, view_is_passive_loc, (uint64_t)value); } static bool32 view_get_is_passive(Application_Links *app, View_Summary *view){ + Lifetime_Handle view_life = view_get_lifetime_handle(app, view->view_id); uint64_t is_passive = 0; - view_get_variable(app, view, view_is_passive_loc, &is_passive); + core_variable_get(app, view_life, view_is_passive_loc, &is_passive); return(is_passive != 0); } @@ -245,10 +247,10 @@ default_4coder_initialize(Application_Links *app, int32_t override_font_size, bo load_folder_of_themes_into_live_set(app, &global_part, "themes"); load_config_and_apply(app, &global_part, &global_config, override_font_size, override_hinting); - view_rewrite_loc = create_view_variable(app, "DEFAULT.rewrite" , (uint64_t)0); - view_next_rewrite_loc = create_view_variable(app, "DEFAULT.next_rewrite", (uint64_t)0); - view_paste_index_loc = create_view_variable(app, "DEFAULT.paste_index" , (uint64_t)0); - view_is_passive_loc = create_view_variable(app, "DEFAULT.is_passive" , (uint64_t)false); + view_rewrite_loc = create_core_variable(app, LifetimeType_View, "DEFAULT.rewrite" , (uint64_t)0); + view_next_rewrite_loc = create_core_variable(app, LifetimeType_View, "DEFAULT.next_rewrite", (uint64_t)0); + view_paste_index_loc = create_core_variable(app, LifetimeType_View, "DEFAULT.paste_index" , (uint64_t)0); + view_is_passive_loc = create_core_variable(app, LifetimeType_View, "DEFAULT.is_passive" , (uint64_t)false); } static void diff --git a/4coder_default_hooks.cpp b/4coder_default_hooks.cpp index 90536c46..d1f25b5c 100644 --- a/4coder_default_hooks.cpp +++ b/4coder_default_hooks.cpp @@ -42,12 +42,13 @@ START_HOOK_SIG(default_start){ // also relies on this particular command caller hook. COMMAND_CALLER_HOOK(default_command_caller){ View_Summary view = get_active_view(app, AccessAll); + Lifetime_Handle view_life = view_get_lifetime_handle(app, view.view_id); - view_set_variable(app, &view, view_next_rewrite_loc, 0); + core_variable_set(app, view_life, view_next_rewrite_loc, 0); exec_command(app, cmd); uint64_t next_rewrite = 0; - view_get_variable(app, &view, view_next_rewrite_loc, &next_rewrite); - view_set_variable(app, &view, view_rewrite_loc, next_rewrite); + core_variable_get(app, view_life, view_next_rewrite_loc, &next_rewrite); + core_variable_set(app, view_life, view_rewrite_loc, next_rewrite); return(0); } diff --git a/4coder_generated/app_functions.h b/4coder_generated/app_functions.h index f76cadcf..438442da 100644 --- a/4coder_generated/app_functions.h +++ b/4coder_generated/app_functions.h @@ -25,6 +25,7 @@ struct Application_Links; #define BUFFER_REMOVE_MARKERS_SIG(n) bool32 n(Application_Links *app, Buffer_Summary *buffer, Marker_Handle marker) #define BUFFER_GET_SETTING_SIG(n) bool32 n(Application_Links *app, Buffer_Summary *buffer, Buffer_Setting_ID setting, int32_t *value_out) #define BUFFER_SET_SETTING_SIG(n) bool32 n(Application_Links *app, Buffer_Summary *buffer, Buffer_Setting_ID setting, int32_t value) +#define BUFFER_GET_LIFETIME_HANDLE_SIG(n) Lifetime_Handle n(Application_Links *app, Buffer_ID buffer_id) #define BUFFER_TOKEN_COUNT_SIG(n) int32_t n(Application_Links *app, Buffer_Summary *buffer) #define BUFFER_READ_TOKENS_SIG(n) bool32 n(Application_Links *app, Buffer_Summary *buffer, int32_t start_token, int32_t end_token, Cpp_Token *tokens_out) #define BUFFER_GET_TOKEN_INDEX_SIG(n) bool32 n(Application_Links *app, Buffer_Summary *buffer, int32_t pos, Cpp_Get_Token_Result *get_result) @@ -41,6 +42,7 @@ struct Application_Links; #define SET_ACTIVE_VIEW_SIG(n) bool32 n(Application_Links *app, View_Summary *view) #define VIEW_GET_SETTING_SIG(n) bool32 n(Application_Links *app, View_Summary *view, View_Setting_ID setting, int32_t *value_out) #define VIEW_SET_SETTING_SIG(n) bool32 n(Application_Links *app, View_Summary *view, View_Setting_ID setting, int32_t value) +#define VIEW_GET_LIFETIME_HANDLE_SIG(n) Lifetime_Handle n(Application_Links *app, View_ID view_id) #define VIEW_SET_SPLIT_PROPORTION_SIG(n) bool32 n(Application_Links *app, View_Summary *view, float t) #define VIEW_COMPUTE_CURSOR_SIG(n) bool32 n(Application_Links *app, View_Summary *view, Buffer_Seek seek, Full_Cursor *cursor_out) #define VIEW_SET_CURSOR_SIG(n) bool32 n(Application_Links *app, View_Summary *view, Buffer_Seek seek, bool32 set_preferred_x) @@ -49,13 +51,13 @@ struct Application_Links; #define VIEW_SET_HIGHLIGHT_SIG(n) bool32 n(Application_Links *app, View_Summary *view, int32_t start, int32_t end, bool32 turn_on) #define VIEW_SET_BUFFER_SIG(n) bool32 n(Application_Links *app, View_Summary *view, Buffer_ID buffer_id, Set_Buffer_Flag flags) #define VIEW_POST_FADE_SIG(n) bool32 n(Application_Links *app, View_Summary *view, float seconds, int32_t start, int32_t end, int_color color) -#define CREATE_VIEW_VARIABLE_SIG(n) int32_t n(Application_Links *app, char *null_terminated_name, uint64_t default_value) -#define VIEW_SET_VARIABLE_SIG(n) bool32 n(Application_Links *app, View_Summary *view, int32_t location, uint64_t value) -#define VIEW_GET_VARIABLE_SIG(n) bool32 n(Application_Links *app, View_Summary *view, int32_t location, uint64_t *value_out) #define VIEW_START_UI_MODE_SIG(n) int32_t n(Application_Links *app, View_Summary *view) #define VIEW_END_UI_MODE_SIG(n) int32_t n(Application_Links *app, View_Summary *view) #define VIEW_SET_UI_SIG(n) bool32 n(Application_Links *app, View_Summary *view, UI_Control *control) #define VIEW_GET_UI_COPY_SIG(n) UI_Control n(Application_Links *app, View_Summary *view, struct Partition *part) +#define CREATE_CORE_VARIABLE_SIG(n) int32_t n(Application_Links *app, Lifetime_Type type, char *null_terminated_name, uint64_t default_value) +#define CORE_VARIABLE_SET_SIG(n) bool32 n(Application_Links *app, Lifetime_Handle handle, int32_t location, uint64_t value) +#define CORE_VARIABLE_GET_SIG(n) bool32 n(Application_Links *app, Lifetime_Handle handle, int32_t location, uint64_t *value_out) #define GET_USER_INPUT_SIG(n) User_Input n(Application_Links *app, Input_Type_Flag get_type, Input_Type_Flag abort_type) #define GET_COMMAND_INPUT_SIG(n) User_Input n(Application_Links *app) #define GET_MOUSE_STATE_SIG(n) Mouse_State n(Application_Links *app) @@ -121,6 +123,7 @@ typedef BUFFER_GET_MARKERS_SIG(Buffer_Get_Markers_Function); typedef BUFFER_REMOVE_MARKERS_SIG(Buffer_Remove_Markers_Function); typedef BUFFER_GET_SETTING_SIG(Buffer_Get_Setting_Function); typedef BUFFER_SET_SETTING_SIG(Buffer_Set_Setting_Function); +typedef BUFFER_GET_LIFETIME_HANDLE_SIG(Buffer_Get_Lifetime_Handle_Function); typedef BUFFER_TOKEN_COUNT_SIG(Buffer_Token_Count_Function); typedef BUFFER_READ_TOKENS_SIG(Buffer_Read_Tokens_Function); typedef BUFFER_GET_TOKEN_INDEX_SIG(Buffer_Get_Token_Index_Function); @@ -137,6 +140,7 @@ typedef CLOSE_VIEW_SIG(Close_View_Function); typedef SET_ACTIVE_VIEW_SIG(Set_Active_View_Function); typedef VIEW_GET_SETTING_SIG(View_Get_Setting_Function); typedef VIEW_SET_SETTING_SIG(View_Set_Setting_Function); +typedef VIEW_GET_LIFETIME_HANDLE_SIG(View_Get_Lifetime_Handle_Function); typedef VIEW_SET_SPLIT_PROPORTION_SIG(View_Set_Split_Proportion_Function); typedef VIEW_COMPUTE_CURSOR_SIG(View_Compute_Cursor_Function); typedef VIEW_SET_CURSOR_SIG(View_Set_Cursor_Function); @@ -145,13 +149,13 @@ typedef VIEW_SET_MARK_SIG(View_Set_Mark_Function); typedef VIEW_SET_HIGHLIGHT_SIG(View_Set_Highlight_Function); typedef VIEW_SET_BUFFER_SIG(View_Set_Buffer_Function); typedef VIEW_POST_FADE_SIG(View_Post_Fade_Function); -typedef CREATE_VIEW_VARIABLE_SIG(Create_View_Variable_Function); -typedef VIEW_SET_VARIABLE_SIG(View_Set_Variable_Function); -typedef VIEW_GET_VARIABLE_SIG(View_Get_Variable_Function); typedef VIEW_START_UI_MODE_SIG(View_Start_UI_Mode_Function); typedef VIEW_END_UI_MODE_SIG(View_End_UI_Mode_Function); typedef VIEW_SET_UI_SIG(View_Set_UI_Function); typedef VIEW_GET_UI_COPY_SIG(View_Get_UI_Copy_Function); +typedef CREATE_CORE_VARIABLE_SIG(Create_Core_Variable_Function); +typedef CORE_VARIABLE_SET_SIG(Core_Variable_Set_Function); +typedef CORE_VARIABLE_GET_SIG(Core_Variable_Get_Function); typedef GET_USER_INPUT_SIG(Get_User_Input_Function); typedef GET_COMMAND_INPUT_SIG(Get_Command_Input_Function); typedef GET_MOUSE_STATE_SIG(Get_Mouse_State_Function); @@ -219,6 +223,7 @@ Buffer_Get_Markers_Function *buffer_get_markers; Buffer_Remove_Markers_Function *buffer_remove_markers; Buffer_Get_Setting_Function *buffer_get_setting; Buffer_Set_Setting_Function *buffer_set_setting; +Buffer_Get_Lifetime_Handle_Function *buffer_get_lifetime_handle; Buffer_Token_Count_Function *buffer_token_count; Buffer_Read_Tokens_Function *buffer_read_tokens; Buffer_Get_Token_Index_Function *buffer_get_token_index; @@ -235,6 +240,7 @@ Close_View_Function *close_view; Set_Active_View_Function *set_active_view; View_Get_Setting_Function *view_get_setting; View_Set_Setting_Function *view_set_setting; +View_Get_Lifetime_Handle_Function *view_get_lifetime_handle; View_Set_Split_Proportion_Function *view_set_split_proportion; View_Compute_Cursor_Function *view_compute_cursor; View_Set_Cursor_Function *view_set_cursor; @@ -243,13 +249,13 @@ View_Set_Mark_Function *view_set_mark; View_Set_Highlight_Function *view_set_highlight; View_Set_Buffer_Function *view_set_buffer; View_Post_Fade_Function *view_post_fade; -Create_View_Variable_Function *create_view_variable; -View_Set_Variable_Function *view_set_variable; -View_Get_Variable_Function *view_get_variable; View_Start_UI_Mode_Function *view_start_ui_mode; View_End_UI_Mode_Function *view_end_ui_mode; View_Set_UI_Function *view_set_ui; View_Get_UI_Copy_Function *view_get_ui_copy; +Create_Core_Variable_Function *create_core_variable; +Core_Variable_Set_Function *core_variable_set; +Core_Variable_Get_Function *core_variable_get; Get_User_Input_Function *get_user_input; Get_Command_Input_Function *get_command_input; Get_Mouse_State_Function *get_mouse_state; @@ -316,6 +322,7 @@ Buffer_Get_Markers_Function *buffer_get_markers_; Buffer_Remove_Markers_Function *buffer_remove_markers_; Buffer_Get_Setting_Function *buffer_get_setting_; Buffer_Set_Setting_Function *buffer_set_setting_; +Buffer_Get_Lifetime_Handle_Function *buffer_get_lifetime_handle_; Buffer_Token_Count_Function *buffer_token_count_; Buffer_Read_Tokens_Function *buffer_read_tokens_; Buffer_Get_Token_Index_Function *buffer_get_token_index_; @@ -332,6 +339,7 @@ Close_View_Function *close_view_; Set_Active_View_Function *set_active_view_; View_Get_Setting_Function *view_get_setting_; View_Set_Setting_Function *view_set_setting_; +View_Get_Lifetime_Handle_Function *view_get_lifetime_handle_; View_Set_Split_Proportion_Function *view_set_split_proportion_; View_Compute_Cursor_Function *view_compute_cursor_; View_Set_Cursor_Function *view_set_cursor_; @@ -340,13 +348,13 @@ View_Set_Mark_Function *view_set_mark_; View_Set_Highlight_Function *view_set_highlight_; View_Set_Buffer_Function *view_set_buffer_; View_Post_Fade_Function *view_post_fade_; -Create_View_Variable_Function *create_view_variable_; -View_Set_Variable_Function *view_set_variable_; -View_Get_Variable_Function *view_get_variable_; View_Start_UI_Mode_Function *view_start_ui_mode_; View_End_UI_Mode_Function *view_end_ui_mode_; View_Set_UI_Function *view_set_ui_; View_Get_UI_Copy_Function *view_get_ui_copy_; +Create_Core_Variable_Function *create_core_variable_; +Core_Variable_Set_Function *core_variable_set_; +Core_Variable_Get_Function *core_variable_get_; Get_User_Input_Function *get_user_input_; Get_Command_Input_Function *get_command_input_; Get_Mouse_State_Function *get_mouse_state_; @@ -421,6 +429,7 @@ app_links->buffer_get_markers_ = Buffer_Get_Markers;\ app_links->buffer_remove_markers_ = Buffer_Remove_Markers;\ app_links->buffer_get_setting_ = Buffer_Get_Setting;\ app_links->buffer_set_setting_ = Buffer_Set_Setting;\ +app_links->buffer_get_lifetime_handle_ = Buffer_Get_Lifetime_Handle;\ app_links->buffer_token_count_ = Buffer_Token_Count;\ app_links->buffer_read_tokens_ = Buffer_Read_Tokens;\ app_links->buffer_get_token_index_ = Buffer_Get_Token_Index;\ @@ -437,6 +446,7 @@ app_links->close_view_ = Close_View;\ app_links->set_active_view_ = Set_Active_View;\ app_links->view_get_setting_ = View_Get_Setting;\ app_links->view_set_setting_ = View_Set_Setting;\ +app_links->view_get_lifetime_handle_ = View_Get_Lifetime_Handle;\ app_links->view_set_split_proportion_ = View_Set_Split_Proportion;\ app_links->view_compute_cursor_ = View_Compute_Cursor;\ app_links->view_set_cursor_ = View_Set_Cursor;\ @@ -445,13 +455,13 @@ app_links->view_set_mark_ = View_Set_Mark;\ app_links->view_set_highlight_ = View_Set_Highlight;\ app_links->view_set_buffer_ = View_Set_Buffer;\ app_links->view_post_fade_ = View_Post_Fade;\ -app_links->create_view_variable_ = Create_View_Variable;\ -app_links->view_set_variable_ = View_Set_Variable;\ -app_links->view_get_variable_ = View_Get_Variable;\ app_links->view_start_ui_mode_ = View_Start_UI_Mode;\ app_links->view_end_ui_mode_ = View_End_UI_Mode;\ app_links->view_set_ui_ = View_Set_UI;\ app_links->view_get_ui_copy_ = View_Get_UI_Copy;\ +app_links->create_core_variable_ = Create_Core_Variable;\ +app_links->core_variable_set_ = Core_Variable_Set;\ +app_links->core_variable_get_ = Core_Variable_Get;\ app_links->get_user_input_ = Get_User_Input;\ app_links->get_command_input_ = Get_Command_Input;\ app_links->get_mouse_state_ = Get_Mouse_State;\ @@ -518,6 +528,7 @@ static inline bool32 buffer_get_markers(Application_Links *app, Buffer_Summary * static inline bool32 buffer_remove_markers(Application_Links *app, Buffer_Summary *buffer, Marker_Handle marker){return(app->buffer_remove_markers(app, buffer, marker));} static inline bool32 buffer_get_setting(Application_Links *app, Buffer_Summary *buffer, Buffer_Setting_ID setting, int32_t *value_out){return(app->buffer_get_setting(app, buffer, setting, value_out));} static inline bool32 buffer_set_setting(Application_Links *app, Buffer_Summary *buffer, Buffer_Setting_ID setting, int32_t value){return(app->buffer_set_setting(app, buffer, setting, value));} +static inline Lifetime_Handle buffer_get_lifetime_handle(Application_Links *app, Buffer_ID buffer_id){return(app->buffer_get_lifetime_handle(app, buffer_id));} static inline int32_t buffer_token_count(Application_Links *app, Buffer_Summary *buffer){return(app->buffer_token_count(app, buffer));} static inline bool32 buffer_read_tokens(Application_Links *app, Buffer_Summary *buffer, int32_t start_token, int32_t end_token, Cpp_Token *tokens_out){return(app->buffer_read_tokens(app, buffer, start_token, end_token, tokens_out));} static inline bool32 buffer_get_token_index(Application_Links *app, Buffer_Summary *buffer, int32_t pos, Cpp_Get_Token_Result *get_result){return(app->buffer_get_token_index(app, buffer, pos, get_result));} @@ -534,6 +545,7 @@ static inline bool32 close_view(Application_Links *app, View_Summary *view){retu static inline bool32 set_active_view(Application_Links *app, View_Summary *view){return(app->set_active_view(app, view));} static inline bool32 view_get_setting(Application_Links *app, View_Summary *view, View_Setting_ID setting, int32_t *value_out){return(app->view_get_setting(app, view, setting, value_out));} static inline bool32 view_set_setting(Application_Links *app, View_Summary *view, View_Setting_ID setting, int32_t value){return(app->view_set_setting(app, view, setting, value));} +static inline Lifetime_Handle view_get_lifetime_handle(Application_Links *app, View_ID view_id){return(app->view_get_lifetime_handle(app, view_id));} static inline bool32 view_set_split_proportion(Application_Links *app, View_Summary *view, float t){return(app->view_set_split_proportion(app, view, t));} static inline bool32 view_compute_cursor(Application_Links *app, View_Summary *view, Buffer_Seek seek, Full_Cursor *cursor_out){return(app->view_compute_cursor(app, view, seek, cursor_out));} static inline bool32 view_set_cursor(Application_Links *app, View_Summary *view, Buffer_Seek seek, bool32 set_preferred_x){return(app->view_set_cursor(app, view, seek, set_preferred_x));} @@ -542,13 +554,13 @@ static inline bool32 view_set_mark(Application_Links *app, View_Summary *view, B static inline bool32 view_set_highlight(Application_Links *app, View_Summary *view, int32_t start, int32_t end, bool32 turn_on){return(app->view_set_highlight(app, view, start, end, turn_on));} static inline bool32 view_set_buffer(Application_Links *app, View_Summary *view, Buffer_ID buffer_id, Set_Buffer_Flag flags){return(app->view_set_buffer(app, view, buffer_id, flags));} static inline bool32 view_post_fade(Application_Links *app, View_Summary *view, float seconds, int32_t start, int32_t end, int_color color){return(app->view_post_fade(app, view, seconds, start, end, color));} -static inline int32_t create_view_variable(Application_Links *app, char *null_terminated_name, uint64_t default_value){return(app->create_view_variable(app, null_terminated_name, default_value));} -static inline bool32 view_set_variable(Application_Links *app, View_Summary *view, int32_t location, uint64_t value){return(app->view_set_variable(app, view, location, value));} -static inline bool32 view_get_variable(Application_Links *app, View_Summary *view, int32_t location, uint64_t *value_out){return(app->view_get_variable(app, view, location, value_out));} static inline int32_t view_start_ui_mode(Application_Links *app, View_Summary *view){return(app->view_start_ui_mode(app, view));} static inline int32_t view_end_ui_mode(Application_Links *app, View_Summary *view){return(app->view_end_ui_mode(app, view));} static inline bool32 view_set_ui(Application_Links *app, View_Summary *view, UI_Control *control){return(app->view_set_ui(app, view, control));} static inline UI_Control view_get_ui_copy(Application_Links *app, View_Summary *view, struct Partition *part){return(app->view_get_ui_copy(app, view, part));} +static inline int32_t create_core_variable(Application_Links *app, Lifetime_Type type, char *null_terminated_name, uint64_t default_value){return(app->create_core_variable(app, type, null_terminated_name, default_value));} +static inline bool32 core_variable_set(Application_Links *app, Lifetime_Handle handle, int32_t location, uint64_t value){return(app->core_variable_set(app, handle, location, value));} +static inline bool32 core_variable_get(Application_Links *app, Lifetime_Handle handle, int32_t location, uint64_t *value_out){return(app->core_variable_get(app, handle, location, value_out));} static inline User_Input get_user_input(Application_Links *app, Input_Type_Flag get_type, Input_Type_Flag abort_type){return(app->get_user_input(app, get_type, abort_type));} static inline User_Input get_command_input(Application_Links *app){return(app->get_command_input(app));} static inline Mouse_State get_mouse_state(Application_Links *app){return(app->get_mouse_state(app));} @@ -615,6 +627,7 @@ static inline bool32 buffer_get_markers(Application_Links *app, Buffer_Summary * static inline bool32 buffer_remove_markers(Application_Links *app, Buffer_Summary *buffer, Marker_Handle marker){return(app->buffer_remove_markers_(app, buffer, marker));} static inline bool32 buffer_get_setting(Application_Links *app, Buffer_Summary *buffer, Buffer_Setting_ID setting, int32_t *value_out){return(app->buffer_get_setting_(app, buffer, setting, value_out));} static inline bool32 buffer_set_setting(Application_Links *app, Buffer_Summary *buffer, Buffer_Setting_ID setting, int32_t value){return(app->buffer_set_setting_(app, buffer, setting, value));} +static inline Lifetime_Handle buffer_get_lifetime_handle(Application_Links *app, Buffer_ID buffer_id){return(app->buffer_get_lifetime_handle_(app, buffer_id));} static inline int32_t buffer_token_count(Application_Links *app, Buffer_Summary *buffer){return(app->buffer_token_count_(app, buffer));} static inline bool32 buffer_read_tokens(Application_Links *app, Buffer_Summary *buffer, int32_t start_token, int32_t end_token, Cpp_Token *tokens_out){return(app->buffer_read_tokens_(app, buffer, start_token, end_token, tokens_out));} static inline bool32 buffer_get_token_index(Application_Links *app, Buffer_Summary *buffer, int32_t pos, Cpp_Get_Token_Result *get_result){return(app->buffer_get_token_index_(app, buffer, pos, get_result));} @@ -631,6 +644,7 @@ static inline bool32 close_view(Application_Links *app, View_Summary *view){retu static inline bool32 set_active_view(Application_Links *app, View_Summary *view){return(app->set_active_view_(app, view));} static inline bool32 view_get_setting(Application_Links *app, View_Summary *view, View_Setting_ID setting, int32_t *value_out){return(app->view_get_setting_(app, view, setting, value_out));} static inline bool32 view_set_setting(Application_Links *app, View_Summary *view, View_Setting_ID setting, int32_t value){return(app->view_set_setting_(app, view, setting, value));} +static inline Lifetime_Handle view_get_lifetime_handle(Application_Links *app, View_ID view_id){return(app->view_get_lifetime_handle_(app, view_id));} static inline bool32 view_set_split_proportion(Application_Links *app, View_Summary *view, float t){return(app->view_set_split_proportion_(app, view, t));} static inline bool32 view_compute_cursor(Application_Links *app, View_Summary *view, Buffer_Seek seek, Full_Cursor *cursor_out){return(app->view_compute_cursor_(app, view, seek, cursor_out));} static inline bool32 view_set_cursor(Application_Links *app, View_Summary *view, Buffer_Seek seek, bool32 set_preferred_x){return(app->view_set_cursor_(app, view, seek, set_preferred_x));} @@ -639,13 +653,13 @@ static inline bool32 view_set_mark(Application_Links *app, View_Summary *view, B static inline bool32 view_set_highlight(Application_Links *app, View_Summary *view, int32_t start, int32_t end, bool32 turn_on){return(app->view_set_highlight_(app, view, start, end, turn_on));} static inline bool32 view_set_buffer(Application_Links *app, View_Summary *view, Buffer_ID buffer_id, Set_Buffer_Flag flags){return(app->view_set_buffer_(app, view, buffer_id, flags));} static inline bool32 view_post_fade(Application_Links *app, View_Summary *view, float seconds, int32_t start, int32_t end, int_color color){return(app->view_post_fade_(app, view, seconds, start, end, color));} -static inline int32_t create_view_variable(Application_Links *app, char *null_terminated_name, uint64_t default_value){return(app->create_view_variable_(app, null_terminated_name, default_value));} -static inline bool32 view_set_variable(Application_Links *app, View_Summary *view, int32_t location, uint64_t value){return(app->view_set_variable_(app, view, location, value));} -static inline bool32 view_get_variable(Application_Links *app, View_Summary *view, int32_t location, uint64_t *value_out){return(app->view_get_variable_(app, view, location, value_out));} static inline int32_t view_start_ui_mode(Application_Links *app, View_Summary *view){return(app->view_start_ui_mode_(app, view));} static inline int32_t view_end_ui_mode(Application_Links *app, View_Summary *view){return(app->view_end_ui_mode_(app, view));} static inline bool32 view_set_ui(Application_Links *app, View_Summary *view, UI_Control *control){return(app->view_set_ui_(app, view, control));} static inline UI_Control view_get_ui_copy(Application_Links *app, View_Summary *view, struct Partition *part){return(app->view_get_ui_copy_(app, view, part));} +static inline int32_t create_core_variable(Application_Links *app, Lifetime_Type type, char *null_terminated_name, uint64_t default_value){return(app->create_core_variable_(app, type, null_terminated_name, default_value));} +static inline bool32 core_variable_set(Application_Links *app, Lifetime_Handle handle, int32_t location, uint64_t value){return(app->core_variable_set_(app, handle, location, value));} +static inline bool32 core_variable_get(Application_Links *app, Lifetime_Handle handle, int32_t location, uint64_t *value_out){return(app->core_variable_get_(app, handle, location, value_out));} static inline User_Input get_user_input(Application_Links *app, Input_Type_Flag get_type, Input_Type_Flag abort_type){return(app->get_user_input_(app, get_type, abort_type));} static inline User_Input get_command_input(Application_Links *app){return(app->get_command_input_(app));} static inline Mouse_State get_mouse_state(Application_Links *app){return(app->get_mouse_state_(app));} diff --git a/4coder_generated/command_metadata.h b/4coder_generated/command_metadata.h index e5d7877e..3e8f6409 100644 --- a/4coder_generated/command_metadata.h +++ b/4coder_generated/command_metadata.h @@ -223,7 +223,7 @@ int32_t source_name_len; int32_t line_number; }; static Command_Metadata fcoder_metacmd_table[202] = { -{ PROC_LINKS(allow_mouse, 0), "allow_mouse", 11, "Shows the mouse and causes all mouse input to be processed normally.", 68, "/home/allen/4ed/code/4coder_default_framework.cpp", 49, 191 }, +{ PROC_LINKS(allow_mouse, 0), "allow_mouse", 11, "Shows the mouse and causes all mouse input to be processed normally.", 68, "/home/allen/4ed/code/4coder_default_framework.cpp", 49, 193 }, { PROC_LINKS(auto_tab_line_at_cursor, 0), "auto_tab_line_at_cursor", 23, "Auto-indents the line on which the cursor sits.", 47, "/home/allen/4ed/code/4coder_auto_indent.cpp", 43, 722 }, { PROC_LINKS(auto_tab_range, 0), "auto_tab_range", 14, "Auto-indents the range between the cursor and the mark.", 55, "/home/allen/4ed/code/4coder_auto_indent.cpp", 43, 733 }, { PROC_LINKS(auto_tab_whole_file, 0), "auto_tab_whole_file", 19, "Audo-indents the entire current buffer.", 39, "/home/allen/4ed/code/4coder_auto_indent.cpp", 43, 712 }, @@ -233,8 +233,8 @@ static Command_Metadata fcoder_metacmd_table[202] = { { PROC_LINKS(build_in_build_panel, 0), "build_in_build_panel", 20, "Looks for a build.bat, build.sh, or makefile in the current and parent directories. Runs the first that it finds and prints the output to *compilation*. Puts the *compilation* buffer in a panel at the footer of the current view.", 230, "/home/allen/4ed/code/4coder_build_commands.cpp", 46, 187 }, { PROC_LINKS(build_search, 0), "build_search", 12, "Looks for a build.bat, build.sh, or makefile in the current and parent directories. Runs the first that it finds and prints the output to *compilation*.", 153, "/home/allen/4ed/code/4coder_build_commands.cpp", 46, 155 }, { PROC_LINKS(center_view, 0), "center_view", 11, "Centers the view vertically on the line on which the cursor sits.", 65, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 120 }, -{ PROC_LINKS(change_active_panel, 0), "change_active_panel", 19, "Change the currently active panel, moving to the panel with the next highest view_id.", 85, "/home/allen/4ed/code/4coder_default_framework.cpp", 49, 133 }, -{ PROC_LINKS(change_active_panel_backwards, 0), "change_active_panel_backwards", 29, "Change the currently active panel, moving to the panel with the next lowest view_id.", 84, "/home/allen/4ed/code/4coder_default_framework.cpp", 49, 143 }, +{ PROC_LINKS(change_active_panel, 0), "change_active_panel", 19, "Change the currently active panel, moving to the panel with the next highest view_id.", 85, "/home/allen/4ed/code/4coder_default_framework.cpp", 49, 135 }, +{ PROC_LINKS(change_active_panel_backwards, 0), "change_active_panel_backwards", 29, "Change the currently active panel, moving to the panel with the next lowest view_id.", 84, "/home/allen/4ed/code/4coder_default_framework.cpp", 49, 145 }, { PROC_LINKS(change_to_build_panel, 0), "change_to_build_panel", 21, "If the special build panel is open, makes the build panel the active panel.", 75, "/home/allen/4ed/code/4coder_build_commands.cpp", 46, 209 }, { PROC_LINKS(clean_all_lines, 0), "clean_all_lines", 15, "Removes trailing whitespace from all lines in the current buffer.", 65, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 368 }, { PROC_LINKS(click_set_cursor, 0), "click_set_cursor", 16, "Sets the cursor position to the mouse position.", 47, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 174 }, @@ -345,14 +345,14 @@ static Command_Metadata fcoder_metacmd_table[202] = { { PROC_LINKS(open_long_braces_break, 0), "open_long_braces_break", 22, "At the cursor, insert a '{' and '}break;' separated by a blank line.", 68, "/home/allen/4ed/code/4coder_combined_write_commands.cpp", 55, 74 }, { PROC_LINKS(open_long_braces_semicolon, 0), "open_long_braces_semicolon", 26, "At the cursor, insert a '{' and '};' separated by a blank line.", 63, "/home/allen/4ed/code/4coder_combined_write_commands.cpp", 55, 66 }, { PROC_LINKS(open_matching_file_cpp, 0), "open_matching_file_cpp", 22, "If the current file is a *.cpp or *.h, attempts to open the corresponding *.h or *.cpp file in the other view.", 110, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1387 }, -{ PROC_LINKS(open_panel_hsplit, 0), "open_panel_hsplit", 17, "Create a new panel by horizontally splitting the active panel.", 62, "/home/allen/4ed/code/4coder_default_framework.cpp", 49, 162 }, -{ PROC_LINKS(open_panel_vsplit, 0), "open_panel_vsplit", 17, "Create a new panel by vertically splitting the active panel.", 60, "/home/allen/4ed/code/4coder_default_framework.cpp", 49, 153 }, +{ PROC_LINKS(open_panel_hsplit, 0), "open_panel_hsplit", 17, "Create a new panel by horizontally splitting the active panel.", 62, "/home/allen/4ed/code/4coder_default_framework.cpp", 49, 164 }, +{ PROC_LINKS(open_panel_vsplit, 0), "open_panel_vsplit", 17, "Create a new panel by vertically splitting the active panel.", 60, "/home/allen/4ed/code/4coder_default_framework.cpp", 49, 155 }, { PROC_LINKS(page_down, 0), "page_down", 9, "Scrolls the view down one view height and moves the cursor down one view height.", 80, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 288 }, { PROC_LINKS(page_up, 0), "page_up", 7, "Scrolls the view up one view height and moves the cursor up one view height.", 76, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 279 }, { PROC_LINKS(paste, 0), "paste", 5, "At the cursor, insert the text at the top of the clipboard.", 59, "/home/allen/4ed/code/4coder_clipboard.cpp", 41, 46 }, -{ PROC_LINKS(paste_and_indent, 0), "paste_and_indent", 16, "Paste from the top of clipboard and run auto-indent on the newly pasted text.", 77, "/home/allen/4ed/code/4coder_clipboard.cpp", 41, 130 }, +{ PROC_LINKS(paste_and_indent, 0), "paste_and_indent", 16, "Paste from the top of clipboard and run auto-indent on the newly pasted text.", 77, "/home/allen/4ed/code/4coder_clipboard.cpp", 41, 131 }, { PROC_LINKS(paste_next, 0), "paste_next", 10, "If the previous command was paste or paste_next, replaces the paste range with the next text down on the clipboard, otherwise operates as the paste command.", 156, "/home/allen/4ed/code/4coder_clipboard.cpp", 41, 83 }, -{ PROC_LINKS(paste_next_and_indent, 0), "paste_next_and_indent", 21, "Paste the next item on the clipboard and run auto-indent on the newly pasted text.", 82, "/home/allen/4ed/code/4coder_clipboard.cpp", 41, 137 }, +{ PROC_LINKS(paste_next_and_indent, 0), "paste_next_and_indent", 21, "Paste the next item on the clipboard and run auto-indent on the newly pasted text.", 82, "/home/allen/4ed/code/4coder_clipboard.cpp", 41, 138 }, { PROC_LINKS(place_in_scope, 0), "place_in_scope", 14, "Wraps the code contained in the range between cursor and mark with a new curly brace scope.", 91, "/home/allen/4ed/code/4coder_scope_commands.cpp", 46, 481 }, { PROC_LINKS(project_fkey_command, 0), "project_fkey_command", 20, "Run an 'fkey command' configured in a project.4coder file. Determines the index of the 'fkey command' by which function key or numeric key was pressed to trigger the command.", 175, "/home/allen/4ed/code/4coder_project_commands.cpp", 48, 1078 }, { PROC_LINKS(project_go_to_root_directory, 0), "project_go_to_root_directory", 28, "Changes 4coder's hot directory to the root directory of the currently loaded project. With no loaded project nothing hapepns.", 125, "/home/allen/4ed/code/4coder_project_commands.cpp", 48, 1103 }, @@ -361,7 +361,7 @@ static Command_Metadata fcoder_metacmd_table[202] = { { PROC_LINKS(query_replace_selection, 0), "query_replace_selection", 23, "Queries the user for a string, and incrementally replace every occurence of the string found in the selected range with the specified string.", 141, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 950 }, { PROC_LINKS(redo, 0), "redo", 4, "Advances forewards through the undo history.", 44, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1459 }, { PROC_LINKS(reload_themes, 0), "reload_themes", 13, "Loads all the theme files in the theme folder, replacing duplicates with the new theme data.", 92, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1479 }, -{ PROC_LINKS(remap_interactive, 0), "remap_interactive", 17, "Switch to a named key binding map.", 34, "/home/allen/4ed/code/4coder_default_framework.cpp", 49, 211 }, +{ PROC_LINKS(remap_interactive, 0), "remap_interactive", 17, "Switch to a named key binding map.", 34, "/home/allen/4ed/code/4coder_default_framework.cpp", 49, 213 }, { PROC_LINKS(rename_file_query, 0), "rename_file_query", 17, "Queries the user for a new name and renames the file of the current buffer, altering the buffer's name too.", 107, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1090 }, { PROC_LINKS(reopen, 0), "reopen", 6, "Reopen the current buffer from the hard drive.", 46, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1465 }, { PROC_LINKS(replace_in_range, 0), "replace_in_range", 16, "Queries the user for two strings, and replaces all occurences of the first string in the range between the cursor and the mark with the second string.", 150, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 810 }, @@ -404,14 +404,14 @@ static Command_Metadata fcoder_metacmd_table[202] = { { PROC_LINKS(show_scrollbar, 0), "show_scrollbar", 14, "Sets the current view to show it's scrollbar.", 45, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 450 }, { PROC_LINKS(snipe_token_or_word, 0), "snipe_token_or_word", 19, "Delete a single, whole token on or to the left of the cursor and post it to the clipboard.", 90, "/home/allen/4ed/code/4coder_seek.cpp", 36, 1259 }, { PROC_LINKS(snipe_token_or_word_right, 0), "snipe_token_or_word_right", 25, "Delete a single, whole token on or to the right of the cursor and post it to the clipboard.", 91, "/home/allen/4ed/code/4coder_seek.cpp", 36, 1265 }, -{ PROC_LINKS(suppress_mouse, 0), "suppress_mouse", 14, "Hides the mouse and causes all mosue input (clicks, position, wheel) to be ignored.", 83, "/home/allen/4ed/code/4coder_default_framework.cpp", 49, 185 }, +{ PROC_LINKS(suppress_mouse, 0), "suppress_mouse", 14, "Hides the mouse and causes all mosue input (clicks, position, wheel) to be ignored.", 83, "/home/allen/4ed/code/4coder_default_framework.cpp", 49, 187 }, { PROC_LINKS(swap_buffers_between_panels, 0), "swap_buffers_between_panels", 27, "Set the other non-active panel to view the buffer that the active panel views, and switch to that panel.", 104, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1411 }, { PROC_LINKS(to_lowercase, 0), "to_lowercase", 12, "Converts all ascii text in the range between the cursor and the mark to lowercase.", 82, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 348 }, { PROC_LINKS(to_uppercase, 0), "to_uppercase", 12, "Converts all ascii text in the range between the cursor and the mark to uppercase.", 82, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 328 }, { PROC_LINKS(toggle_filebar, 0), "toggle_filebar", 14, "Toggles the visibility status of the current view's filebar.", 60, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 478 }, -{ PROC_LINKS(toggle_fullscreen, 0), "toggle_fullscreen", 17, "Toggle fullscreen mode on or off. The change(s) do not take effect until the next frame.", 89, "/home/allen/4ed/code/4coder_default_framework.cpp", 49, 203 }, +{ PROC_LINKS(toggle_fullscreen, 0), "toggle_fullscreen", 17, "Toggle fullscreen mode on or off. The change(s) do not take effect until the next frame.", 89, "/home/allen/4ed/code/4coder_default_framework.cpp", 49, 205 }, { PROC_LINKS(toggle_line_wrap, 0), "toggle_line_wrap", 16, "Toggles the current buffer's line wrapping status.", 50, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 487 }, -{ PROC_LINKS(toggle_mouse, 0), "toggle_mouse", 12, "Toggles the mouse suppression mode, see suppress_mouse and allow_mouse.", 71, "/home/allen/4ed/code/4coder_default_framework.cpp", 49, 197 }, +{ PROC_LINKS(toggle_mouse, 0), "toggle_mouse", 12, "Toggles the mouse suppression mode, see suppress_mouse and allow_mouse.", 71, "/home/allen/4ed/code/4coder_default_framework.cpp", 49, 199 }, { PROC_LINKS(toggle_show_whitespace, 0), "toggle_show_whitespace", 22, "Toggles the current buffer's whitespace visibility status.", 58, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 554 }, { PROC_LINKS(toggle_virtual_whitespace, 0), "toggle_virtual_whitespace", 25, "Toggles the current buffer's virtual whitespace status.", 55, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 543 }, { PROC_LINKS(undo, 0), "undo", 4, "Advances backwards through the undo history.", 44, "/home/allen/4ed/code/4coder_base_commands.cpp", 45, 1453 }, diff --git a/4coder_search.cpp b/4coder_search.cpp index 9a580df7..aa105820 100644 --- a/4coder_search.cpp +++ b/4coder_search.cpp @@ -828,12 +828,14 @@ CUSTOM_DOC("Iteratively tries completing the word to the left of the cursor with if (buffer.exists){ int32_t do_init = false; + Lifetime_Handle view_life = view_get_lifetime_handle(app, view.view_id); + uint64_t rewrite = 0; - view_get_variable(app, &view, view_rewrite_loc, &rewrite); + core_variable_get(app, view_life, view_rewrite_loc, &rewrite); if (rewrite != RewriteWordComplete){ do_init = true; } - view_set_variable(app, &view, view_next_rewrite_loc, RewriteWordComplete); + core_variable_set(app, view_life, view_next_rewrite_loc, RewriteWordComplete); if (!complete_state.initialized){ do_init = true; } diff --git a/4ed_api_implementation.cpp b/4ed_api_implementation.cpp index fb558136..28820d46 100644 --- a/4ed_api_implementation.cpp +++ b/4ed_api_implementation.cpp @@ -103,7 +103,6 @@ fill_view_summary(System_Functions *system, View_Summary *view, View *vptr, Comm internal Editing_File* get_file_from_identifier(System_Functions *system, Working_Set *working_set, Buffer_Identifier buffer){ Editing_File *file = 0; - if (buffer.id){ file = working_set_get_active_file(working_set, buffer.id); } @@ -111,22 +110,25 @@ get_file_from_identifier(System_Functions *system, Working_Set *working_set, Buf String name = make_string(buffer.name, buffer.name_len); file = working_set_contains_name(working_set, name); } - + return(file); +} + +internal Editing_File* +imp_get_file(Command_Data *cmd, Buffer_ID buffer_id){ + Working_Set *working_set = &cmd->models->working_set; + Editing_File *file = working_set_get_active_file(working_set, buffer_id); + if (file != 0 && !file_is_ready(file)){ + file = 0; + } return(file); } internal Editing_File* imp_get_file(Command_Data *cmd, Buffer_Summary *buffer){ Editing_File *file = 0; - Working_Set *working_set = &cmd->models->working_set;; - if (buffer && buffer->exists){ - file = working_set_get_active_file(working_set, buffer->buffer_id); - if (file != 0 && !file_is_ready(file)){ - file = 0; - } + file = imp_get_file(cmd, buffer->buffer_id); } - return(file); } @@ -134,7 +136,6 @@ internal View* imp_get_view(Command_Data *cmd, View_ID view_id){ Live_Views *live_set = cmd->live_set; View *vptr = 0; - view_id = view_id - 1; if (view_id >= 0 && view_id < live_set->max){ vptr = live_set->views + view_id; @@ -142,18 +143,15 @@ imp_get_view(Command_Data *cmd, View_ID view_id){ vptr = 0; } } - return(vptr); } internal View* imp_get_view(Command_Data *cmd, View_Summary *view){ View *vptr = 0; - - if (view && view->exists){ + if (view != 0 && view->exists){ vptr = imp_get_view(cmd, view->view_id); } - return(vptr); } @@ -927,10 +925,10 @@ DOC_RETURN(returns non-zero on success) */{ Command_Data *cmd = (Command_Data*)app->cmd_context; Editing_File *file = imp_get_file(cmd, buffer); - bool32 result = 0; + bool32 result = false; - if (file){ - result = 1; + if (file != 0){ + result = true; switch (setting){ case BufferSetting_Lex: { @@ -1197,6 +1195,19 @@ DOC_SEE(Buffer_Setting_ID) return(result); } +API_EXPORT Lifetime_Handle +Buffer_Get_Lifetime_Handle(Application_Links *app, Buffer_ID buffer_id) +{ + Command_Data *cmd = (Command_Data*)app->cmd_context; + Editing_File *file = imp_get_file(cmd, buffer_id); + Lifetime_Handle lifetime = {0}; + if (file != 0){ + lifetime.type = LifetimeType_Buffer; + lifetime.buffer_id = buffer_id; + } + return(lifetime); +} + API_EXPORT int32_t Buffer_Token_Count(Application_Links *app, Buffer_Summary *buffer) /* @@ -1206,13 +1217,12 @@ If the buffer does not exist or if it is not a lexed buffer, the return is zero. */{ Command_Data *cmd = (Command_Data*)app->cmd_context; Editing_File *file = imp_get_file(cmd, buffer); - int32_t count = 0; - - if (file && file->state.token_array.tokens && file->state.tokens_complete){ + if (file != 0 && + file->state.token_array.tokens && + file->state.tokens_complete){ count = file->state.token_array.count; } - return(count); } @@ -1808,7 +1818,6 @@ in the system, the call will fail.) layout_fix_all_panels(&models->layout); } - return(result); } @@ -1817,11 +1826,9 @@ Set_Active_View(Application_Links *app, View_Summary *view) /* DOC_PARAM(view, The view parameter specifies which view to make active.) DOC_RETURN(This call returns non-zero on success.) - DOC(If the given view is open, it is set as the active view, and takes subsequent commands and is returned from get_active_view.) - DOC_SEE(get_active_view) */{ Command_Data *cmd = (Command_Data*)app->cmd_context; @@ -1932,6 +1939,19 @@ DOC_SEE(View_Setting_ID) return(result); } +API_EXPORT Lifetime_Handle +View_Get_Lifetime_Handle(Application_Links *app, View_ID view_id) +{ + Command_Data *cmd = (Command_Data*)app->cmd_context; + View *view = imp_get_view(cmd, view_id); + Lifetime_Handle lifetime = {0}; + if (view != 0){ + lifetime.type = LifetimeType_View; + lifetime.view_id = view_id; + } + return(lifetime); +} + API_EXPORT bool32 View_Set_Split_Proportion(Application_Links *app, View_Summary *view, float t) /* @@ -2185,54 +2205,8 @@ DOC_SEE(int_color) } API_EXPORT int32_t -Create_View_Variable(Application_Links *app, char *null_terminated_name, uint64_t default_value){ - Command_Data *cmd = (Command_Data*)app->cmd_context; - Models *models = cmd->models; - String name = make_string_slowly(null_terminated_name); - return(dynamic_variables_lookup_or_create(&models->mem.general, - &models->view_variable_layout, name, default_value)); -} - -API_EXPORT bool32 -View_Set_Variable(Application_Links *app, View_Summary *view, int32_t location, uint64_t value){ - Command_Data *cmd = (Command_Data*)app->cmd_context; - View *vptr = imp_get_view(cmd, view); - bool32 result = false; - if (vptr != 0){ - Models *models = cmd->models; - u64 *ptr = 0; - if (dynamic_variables_get_ptr(&models->mem.general, - &models->view_variable_layout, - &vptr->transient.dynamic_vars, - location, &ptr)){ - result = true; - *ptr = value; - } - } - return(result); -} - -API_EXPORT bool32 -View_Get_Variable(Application_Links *app, View_Summary *view, int32_t location, uint64_t *value_out){ - Command_Data *cmd = (Command_Data*)app->cmd_context; - View *vptr = imp_get_view(cmd, view); - bool32 result = false; - if (vptr != 0){ - Models *models = cmd->models; - u64 *ptr = 0; - if (dynamic_variables_get_ptr(&models->mem.general, - &models->view_variable_layout, - &vptr->transient.dynamic_vars, - location, &ptr)){ - result = true; - *value_out = *ptr; - } - } - return(result); -} - -API_EXPORT int32_t -View_Start_UI_Mode(Application_Links *app, View_Summary *view){ +View_Start_UI_Mode(Application_Links *app, View_Summary *view) +{ Command_Data *cmd = (Command_Data*)app->cmd_context; View *vptr = imp_get_view(cmd, view); if (vptr != 0){ @@ -2246,7 +2220,8 @@ View_Start_UI_Mode(Application_Links *app, View_Summary *view){ } API_EXPORT int32_t -View_End_UI_Mode(Application_Links *app, View_Summary *view){ +View_End_UI_Mode(Application_Links *app, View_Summary *view) +{ Command_Data *cmd = (Command_Data*)app->cmd_context; View *vptr = imp_get_view(cmd, view); if (vptr != 0){ @@ -2265,7 +2240,8 @@ View_End_UI_Mode(Application_Links *app, View_Summary *view){ } API_EXPORT bool32 -View_Set_UI(Application_Links *app, View_Summary *view, UI_Control *control){ +View_Set_UI(Application_Links *app, View_Summary *view, UI_Control *control) +{ Command_Data *cmd = (Command_Data*)app->cmd_context; View *vptr = imp_get_view(cmd, view); Models *models = cmd->models; @@ -2358,7 +2334,8 @@ View_Set_UI(Application_Links *app, View_Summary *view, UI_Control *control){ } API_EXPORT UI_Control -View_Get_UI_Copy(Application_Links *app, View_Summary *view, struct Partition *part){ +View_Get_UI_Copy(Application_Links *app, View_Summary *view, struct Partition *part) +{ Command_Data *cmd = (Command_Data*)app->cmd_context; View *vptr = imp_get_view(cmd, view); UI_Control result = {0}; @@ -2378,6 +2355,89 @@ View_Get_UI_Copy(Application_Links *app, View_Summary *view, struct Partition *p return(result); } +API_EXPORT int32_t +Create_Core_Variable(Application_Links *app, Lifetime_Type type, char *null_terminated_name, uint64_t default_value) +{ + Command_Data *cmd = (Command_Data*)app->cmd_context; + Models *models = cmd->models; + String name = make_string_slowly(null_terminated_name); + General_Memory *general = &models->mem.general; + switch (type){ + case LifetimeType_View: + { + Dynamic_Variable_Layout *layout = &models->view_variable_layout; + return(dynamic_variables_lookup_or_create(general, layout, name, default_value)); + }break; + case LifetimeType_Buffer: + { + Dynamic_Variable_Layout *layout = &models->buffer_variable_layout; + return(dynamic_variables_lookup_or_create(general, layout, name, default_value)); + }break; + } + return(CoreVariableIndex_ERROR); +} + +internal bool32 +get_dynamic_variable(Command_Data *cmd, Lifetime_Handle handle, + int32_t location, uint64_t **ptr_out){ + Models *models = cmd->models; + General_Memory *general = &models->mem.general; + Dynamic_Variable_Layout *layout = 0; + Dynamic_Variable_Block *block = 0; + + switch (handle.type){ + case LifetimeType_View: + { + View *vptr = imp_get_view(cmd, handle.view_id); + if (vptr != 0){ + layout = &models->view_variable_layout; + block = &vptr->transient.dynamic_vars; + } + }break; + + case LifetimeType_Buffer: + { + Editing_File *file = imp_get_file(cmd, handle.buffer_id); + if (file != 0){ + layout = &models->buffer_variable_layout; + block = &file->dynamic_vars; + } + }break; + } + + bool32 result = false; + if (layout != 0 && block != 0){ + if (dynamic_variables_get_ptr(general, layout, block, location, ptr_out)){ + result = true; + } + } + return(result); +} + +API_EXPORT bool32 +Core_Variable_Set(Application_Links *app, Lifetime_Handle handle, int32_t location, uint64_t value) +{ + Command_Data *cmd = (Command_Data*)app->cmd_context; + u64 *ptr = 0; + if (get_dynamic_variable(cmd, handle, location, &ptr)){ + *ptr = value; + return(true); + } + return(false); +} + +API_EXPORT bool32 +Core_Variable_Get(Application_Links *app, Lifetime_Handle handle, int32_t location, uint64_t *value_out) +{ + Command_Data *cmd = (Command_Data*)app->cmd_context; + u64 *ptr = 0; + if (get_dynamic_variable(cmd, handle, location, &ptr)){ + *value_out = *ptr; + return(true); + } + return(false); +} + API_EXPORT User_Input Get_User_Input(Application_Links *app, Input_Type_Flag get_type, Input_Type_Flag abort_type) /* @@ -2439,23 +2499,6 @@ DOC_SEE(Mouse_State) return(mouse); } -/* -API_EXPORT Event_Message -Get_Event_Message (Application_Links *app){ -Event_Message message = {0}; -System_Functions *system = (System_Functions*)app->system_links; -Coroutine *coroutine = (Coroutine*)app->current_coroutine; - -if (app->type_coroutine == Co_View){ -Assert(coroutine); -system->yield_coroutine(coroutine); -message = *(Event_Message*)coroutine->in; -} - -return(message); -} -*/ - API_EXPORT bool32 Start_Query_Bar(Application_Links *app, Query_Bar *bar, uint32_t flags) /* @@ -2516,7 +2559,8 @@ Get_Theme_Count(Application_Links *app) } API_EXPORT String -Get_Theme_Name(Application_Links *app, Partition *arena, int32_t index){ +Get_Theme_Name(Application_Links *app, Partition *arena, int32_t index) +{ Command_Data *cmd = (Command_Data*)app->cmd_context; Style_Library *library = &cmd->models->styles; diff --git a/4ed_app_models.h b/4ed_app_models.h index ceade1f6..1771c725 100644 --- a/4ed_app_models.h +++ b/4ed_app_models.h @@ -67,6 +67,7 @@ struct Models{ Live_Views live_set; Parse_Context_Memory parse_context_memory; + Dynamic_Variable_Layout buffer_variable_layout; Dynamic_Variable_Layout view_variable_layout; Editing_File *message_buffer; diff --git a/4ed_app_target.cpp b/4ed_app_target.cpp index 23067148..a1462bfb 100644 --- a/4ed_app_target.cpp +++ b/4ed_app_target.cpp @@ -43,6 +43,7 @@ #include "4ed_linked_node_macros.h" #include "4ed_log.h" +#include "4ed_dynamic_variables.h" #include "4ed_buffer_model.h" #include "4ed_translation.h" @@ -59,10 +60,10 @@ #include "4ed_cli.h" #include "4ed_gui.h" #include "4ed_layout.h" -#include "4ed_dynamic_variables.h" #include "4ed_view.h" #include "4ed_app_models.h" +#include "4ed_dynamic_variables.cpp" #include "4ed_parse_context.cpp" #include "4ed_font.cpp" #include "4ed_translation.cpp" @@ -79,7 +80,6 @@ #include "4ed_hot_directory.cpp" #include "4ed_cli.cpp" #include "4ed_gui.cpp" -#include "4ed_dynamic_variables.cpp" #include "4ed_layout.cpp" #include "4coder_buffer_seek_constructors.cpp" #include "4ed_view.cpp" diff --git a/4ed_file.h b/4ed_file.h index 600b6a4b..ceb2e3c7 100644 --- a/4ed_file.h +++ b/4ed_file.h @@ -131,6 +131,7 @@ struct Editing_File{ b32 is_loading; b32 is_dummy; Editing_File_State state; + Dynamic_Variable_Block dynamic_vars; Editing_File_Markers markers; Editing_File_Name base_name; Editing_File_Name unique_name; diff --git a/4ed_view.h b/4ed_view.h index 2f8a3693..9c377809 100644 --- a/4ed_view.h +++ b/4ed_view.h @@ -15,7 +15,6 @@ struct View_Persistent{ i32 id; Coroutine_Head *coroutine; - Event_Message message_passing_slot; }; struct File_Viewing_Data{ diff --git a/4ed_working_set.cpp b/4ed_working_set.cpp index b8ffb63f..17e97841 100644 --- a/4ed_working_set.cpp +++ b/4ed_working_set.cpp @@ -66,7 +66,7 @@ working_set_extend_memory(Working_Set *working_set, Editing_File *new_space, i16 } internal Editing_File* -working_set_alloc(Working_Set *working_set){ +working_set_alloc(Working_Set *working_set, General_Memory *general){ Editing_File *result = 0; if (working_set->file_count < working_set->file_max){ @@ -83,6 +83,7 @@ working_set_alloc(Working_Set *working_set){ result->settings.minimum_base_display_width = working_set->default_minimum_base_display_width; result->settings.wrap_indicator = WrapIndicator_Show_At_Wrap_Edge; init_file_markers_state(&result->markers); + dynamic_variables_block_init(general, &result->dynamic_vars); ++working_set->file_count; } @@ -97,7 +98,7 @@ working_set_alloc_always(Working_Set *working_set, General_Memory *general){ Editing_File *new_chunk = gen_array(general, Editing_File, new_count); working_set_extend_memory(working_set, new_chunk, new_count); } - result = working_set_alloc(working_set); + result = working_set_alloc(working_set, general); return(result); } diff --git a/themes/theme-sunlight.4coder b/themes/theme-sunlight.4coder index 83907010..0172ee94 100644 --- a/themes/theme-sunlight.4coder +++ b/themes/theme-sunlight.4coder @@ -1,6 +1,6 @@ name = "sunlight"; -Back = 0xFFDFDFDF; +Back = 0xFFDFD5D0; Margin = 0xFFC7C7C7; Margin_Hover = 0xFFBFBFBF; Margin_Active = 0xFFB7B7B7; @@ -22,7 +22,7 @@ Float_Constant = Str_Constant; Bool_Constant = Str_Constant; Include = Str_Constant; Preproc = 0xFF000000; -Special_Character = 0xFF00FFFF; +Special_Character = 0xFFFF00FF; Ghost_Character = 0xFF929292; Paste = 0xFFFF0000; From b4b19886f3d3e3a0f307498d834b8725489e19af Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Fri, 10 Aug 2018 22:42:00 -0700 Subject: [PATCH 4/4] Setting up lifetime buckets --- 4coder_API/types.h | 15 ++++++---- 4coder_default_framework.cpp | 8 ++--- 4coder_generated/app_functions.h | 6 ++-- 4ed.cpp | 4 +-- 4ed_api_implementation.cpp | 51 ++++++++++++++++---------------- 4ed_app_models.h | 3 +- 4ed_dynamic_variables.cpp | 4 +++ 4ed_dynamic_variables.h | 30 +++++++++++++++++++ 8 files changed, 78 insertions(+), 43 deletions(-) diff --git a/4coder_API/types.h b/4coder_API/types.h index 78267994..78210465 100644 --- a/4coder_API/types.h +++ b/4coder_API/types.h @@ -691,15 +691,18 @@ STRUCT Query_Bar{ static int32_t CoreVariableIndex_ERROR = -1; -ENUM(int32_t, Lifetime_Type){ - LifetimeType_View = 0, - LifetimeType_Buffer = 1, +ENUM(int32_t, Lifetime_Handle_Type){ + LifetimeHandleType_Overlapped = 0, + LifetimeHandleType_Buffer = 1, + LifetimeHandleType_View = 2, }; STRUCT Lifetime_Handle{ - Lifetime_Type type; - View_ID view_id; - Buffer_ID buffer_id; + Lifetime_Handle_Type type; + union{ + View_ID view_id; + Buffer_ID buffer_id; + }; }; ENUM(int16_t, UI_Item_Type){ diff --git a/4coder_default_framework.cpp b/4coder_default_framework.cpp index 81835268..2ece4ef9 100644 --- a/4coder_default_framework.cpp +++ b/4coder_default_framework.cpp @@ -247,10 +247,10 @@ default_4coder_initialize(Application_Links *app, int32_t override_font_size, bo load_folder_of_themes_into_live_set(app, &global_part, "themes"); load_config_and_apply(app, &global_part, &global_config, override_font_size, override_hinting); - view_rewrite_loc = create_core_variable(app, LifetimeType_View, "DEFAULT.rewrite" , (uint64_t)0); - view_next_rewrite_loc = create_core_variable(app, LifetimeType_View, "DEFAULT.next_rewrite", (uint64_t)0); - view_paste_index_loc = create_core_variable(app, LifetimeType_View, "DEFAULT.paste_index" , (uint64_t)0); - view_is_passive_loc = create_core_variable(app, LifetimeType_View, "DEFAULT.is_passive" , (uint64_t)false); + view_rewrite_loc = create_core_variable(app, "DEFAULT.rewrite" , (uint64_t)0); + view_next_rewrite_loc = create_core_variable(app, "DEFAULT.next_rewrite", (uint64_t)0); + view_paste_index_loc = create_core_variable(app, "DEFAULT.paste_index" , (uint64_t)0); + view_is_passive_loc = create_core_variable(app, "DEFAULT.is_passive" , (uint64_t)false); } static void diff --git a/4coder_generated/app_functions.h b/4coder_generated/app_functions.h index 438442da..a080a579 100644 --- a/4coder_generated/app_functions.h +++ b/4coder_generated/app_functions.h @@ -55,7 +55,7 @@ struct Application_Links; #define VIEW_END_UI_MODE_SIG(n) int32_t n(Application_Links *app, View_Summary *view) #define VIEW_SET_UI_SIG(n) bool32 n(Application_Links *app, View_Summary *view, UI_Control *control) #define VIEW_GET_UI_COPY_SIG(n) UI_Control n(Application_Links *app, View_Summary *view, struct Partition *part) -#define CREATE_CORE_VARIABLE_SIG(n) int32_t n(Application_Links *app, Lifetime_Type type, char *null_terminated_name, uint64_t default_value) +#define CREATE_CORE_VARIABLE_SIG(n) int32_t n(Application_Links *app, char *null_terminated_name, uint64_t default_value) #define CORE_VARIABLE_SET_SIG(n) bool32 n(Application_Links *app, Lifetime_Handle handle, int32_t location, uint64_t value) #define CORE_VARIABLE_GET_SIG(n) bool32 n(Application_Links *app, Lifetime_Handle handle, int32_t location, uint64_t *value_out) #define GET_USER_INPUT_SIG(n) User_Input n(Application_Links *app, Input_Type_Flag get_type, Input_Type_Flag abort_type) @@ -558,7 +558,7 @@ static inline int32_t view_start_ui_mode(Application_Links *app, View_Summary *v static inline int32_t view_end_ui_mode(Application_Links *app, View_Summary *view){return(app->view_end_ui_mode(app, view));} static inline bool32 view_set_ui(Application_Links *app, View_Summary *view, UI_Control *control){return(app->view_set_ui(app, view, control));} static inline UI_Control view_get_ui_copy(Application_Links *app, View_Summary *view, struct Partition *part){return(app->view_get_ui_copy(app, view, part));} -static inline int32_t create_core_variable(Application_Links *app, Lifetime_Type type, char *null_terminated_name, uint64_t default_value){return(app->create_core_variable(app, type, null_terminated_name, default_value));} +static inline int32_t create_core_variable(Application_Links *app, char *null_terminated_name, uint64_t default_value){return(app->create_core_variable(app, null_terminated_name, default_value));} static inline bool32 core_variable_set(Application_Links *app, Lifetime_Handle handle, int32_t location, uint64_t value){return(app->core_variable_set(app, handle, location, value));} static inline bool32 core_variable_get(Application_Links *app, Lifetime_Handle handle, int32_t location, uint64_t *value_out){return(app->core_variable_get(app, handle, location, value_out));} static inline User_Input get_user_input(Application_Links *app, Input_Type_Flag get_type, Input_Type_Flag abort_type){return(app->get_user_input(app, get_type, abort_type));} @@ -657,7 +657,7 @@ static inline int32_t view_start_ui_mode(Application_Links *app, View_Summary *v static inline int32_t view_end_ui_mode(Application_Links *app, View_Summary *view){return(app->view_end_ui_mode_(app, view));} static inline bool32 view_set_ui(Application_Links *app, View_Summary *view, UI_Control *control){return(app->view_set_ui_(app, view, control));} static inline UI_Control view_get_ui_copy(Application_Links *app, View_Summary *view, struct Partition *part){return(app->view_get_ui_copy_(app, view, part));} -static inline int32_t create_core_variable(Application_Links *app, Lifetime_Type type, char *null_terminated_name, uint64_t default_value){return(app->create_core_variable_(app, type, null_terminated_name, default_value));} +static inline int32_t create_core_variable(Application_Links *app, char *null_terminated_name, uint64_t default_value){return(app->create_core_variable_(app, null_terminated_name, default_value));} static inline bool32 core_variable_set(Application_Links *app, Lifetime_Handle handle, int32_t location, uint64_t value){return(app->core_variable_set_(app, handle, location, value));} static inline bool32 core_variable_get(Application_Links *app, Lifetime_Handle handle, int32_t location, uint64_t *value_out){return(app->core_variable_get_(app, handle, location, value_out));} static inline User_Input get_user_input(Application_Links *app, Input_Type_Flag get_type, Input_Type_Flag abort_type){return(app->get_user_input_(app, get_type, abort_type));} diff --git a/4ed.cpp b/4ed.cpp index 372f80d9..d5a0a229 100644 --- a/4ed.cpp +++ b/4ed.cpp @@ -1072,16 +1072,14 @@ App_Init_Sig(app_init){ { setup_command_table(); - Assert(models->config_api.get_bindings != 0); i32 wanted_size = models->config_api.get_bindings(models->app_links.memory, models->app_links.memory_size); Assert(wanted_size <= models->app_links.memory_size); interpret_binding_buffer(models, models->app_links.memory, wanted_size); - memset(models->app_links.memory, 0, wanted_size); } - dynamic_variables_init(&models->view_variable_layout); + dynamic_variables_init(&models->variable_layout); // NOTE(allen): file setup working_set_init(&models->working_set, partition, &vars->models.mem.general); diff --git a/4ed_api_implementation.cpp b/4ed_api_implementation.cpp index 28820d46..6e2beb05 100644 --- a/4ed_api_implementation.cpp +++ b/4ed_api_implementation.cpp @@ -1202,7 +1202,7 @@ Buffer_Get_Lifetime_Handle(Application_Links *app, Buffer_ID buffer_id) Editing_File *file = imp_get_file(cmd, buffer_id); Lifetime_Handle lifetime = {0}; if (file != 0){ - lifetime.type = LifetimeType_Buffer; + lifetime.type = LifetimeHandleType_Buffer; lifetime.buffer_id = buffer_id; } return(lifetime); @@ -1946,7 +1946,7 @@ View_Get_Lifetime_Handle(Application_Links *app, View_ID view_id) View *view = imp_get_view(cmd, view_id); Lifetime_Handle lifetime = {0}; if (view != 0){ - lifetime.type = LifetimeType_View; + lifetime.type = LifetimeHandleType_View; lifetime.view_id = view_id; } return(lifetime); @@ -2355,26 +2355,24 @@ View_Get_UI_Copy(Application_Links *app, View_Summary *view, struct Partition *p return(result); } +API_EXPORT Lifetime_Handle +Get_Overlapped_Lifetime_Handle(Application_Links *app, Lifetime_Handle *member_handles, int32_t member_count) +{ + Command_Data *cmd = (Command_Data*)app->cmd_context; + Lifetime_Handle result = {0}; + + return(result); +} + API_EXPORT int32_t -Create_Core_Variable(Application_Links *app, Lifetime_Type type, char *null_terminated_name, uint64_t default_value) +Create_Core_Variable(Application_Links *app, char *null_terminated_name, uint64_t default_value) { Command_Data *cmd = (Command_Data*)app->cmd_context; Models *models = cmd->models; String name = make_string_slowly(null_terminated_name); General_Memory *general = &models->mem.general; - switch (type){ - case LifetimeType_View: - { - Dynamic_Variable_Layout *layout = &models->view_variable_layout; - return(dynamic_variables_lookup_or_create(general, layout, name, default_value)); - }break; - case LifetimeType_Buffer: - { - Dynamic_Variable_Layout *layout = &models->buffer_variable_layout; - return(dynamic_variables_lookup_or_create(general, layout, name, default_value)); - }break; - } - return(CoreVariableIndex_ERROR); + Dynamic_Variable_Layout *layout = &models->variable_layout; + return(dynamic_variables_lookup_or_create(general, layout, name, default_value)); } internal bool32 @@ -2382,27 +2380,30 @@ get_dynamic_variable(Command_Data *cmd, Lifetime_Handle handle, int32_t location, uint64_t **ptr_out){ Models *models = cmd->models; General_Memory *general = &models->mem.general; - Dynamic_Variable_Layout *layout = 0; + Dynamic_Variable_Layout *layout = &models->variable_layout; Dynamic_Variable_Block *block = 0; switch (handle.type){ - case LifetimeType_View: + case LifetimeHandleType_Overlapped: { - View *vptr = imp_get_view(cmd, handle.view_id); - if (vptr != 0){ - layout = &models->view_variable_layout; - block = &vptr->transient.dynamic_vars; - } + NotImplemented; }break; - case LifetimeType_Buffer: + case LifetimeHandleType_Buffer: { Editing_File *file = imp_get_file(cmd, handle.buffer_id); if (file != 0){ - layout = &models->buffer_variable_layout; block = &file->dynamic_vars; } }break; + + case LifetimeHandleType_View: + { + View *vptr = imp_get_view(cmd, handle.view_id); + if (vptr != 0){ + block = &vptr->transient.dynamic_vars; + } + }break; } bool32 result = false; diff --git a/4ed_app_models.h b/4ed_app_models.h index 1771c725..469101a5 100644 --- a/4ed_app_models.h +++ b/4ed_app_models.h @@ -67,8 +67,7 @@ struct Models{ Live_Views live_set; Parse_Context_Memory parse_context_memory; - Dynamic_Variable_Layout buffer_variable_layout; - Dynamic_Variable_Layout view_variable_layout; + Dynamic_Variable_Layout variable_layout; Editing_File *message_buffer; Editing_File *scratch_buffer; diff --git a/4ed_dynamic_variables.cpp b/4ed_dynamic_variables.cpp index c1166630..94070f27 100644 --- a/4ed_dynamic_variables.cpp +++ b/4ed_dynamic_variables.cpp @@ -98,5 +98,9 @@ dynamic_variables_get_ptr(General_Memory *general, return(result); } +//////////////////////////////// + +// TODO(allen): // TODO(allen): // TODO(allen): + // BOTTOM diff --git a/4ed_dynamic_variables.h b/4ed_dynamic_variables.h index 3de8b14c..df1b1ebc 100644 --- a/4ed_dynamic_variables.h +++ b/4ed_dynamic_variables.h @@ -31,6 +31,36 @@ struct Dynamic_Variable_Block{ i32 max; }; +//////////////////////////////// + +union Lifetime_Object{ + struct{ + Object *next; + Object *prev; + }; + struct{ + struct Key **keys; + i32 count; + i32 max; + }; +}; + +union Lifetime_Key{ + struct{ + Key *next; + Key *prev; + }; + struct{ + struct Object **keys; + i32 count; + i32 max; + }; +}; + +struct Lifetime_Allocator{ + // TODO(allen): // TODO(allen): // TODO(allen): // TODO(allen): +}; + #endif // BOTTOM