Add user path to API; implement for windows; go to user path command

master
Allen Webster 2021-01-16 14:59:34 -08:00
parent 46f0d9904f
commit 8da55068a5
7 changed files with 259 additions and 221 deletions

View File

@ -185,7 +185,7 @@ get_defines_from_flags(Arena *arena, u32 flags){
"-wd4611 -wd4189 -WX -GR- -EHa- -nologo -FC" "-wd4611 -wd4189 -WX -GR- -EHa- -nologo -FC"
#define CL_LIBS_X64 \ #define CL_LIBS_X64 \
"user32.lib winmm.lib gdi32.lib opengl32.lib comdlg32.lib " \ "user32.lib winmm.lib gdi32.lib opengl32.lib comdlg32.lib userenv.lib " \
FOREIGN_WIN "\\x64\\freetype.lib" FOREIGN_WIN "\\x64\\freetype.lib"
#define CL_LIBS_X86 \ #define CL_LIBS_X86 \

View File

@ -14,6 +14,9 @@ def_search_normal_load_list(Arena *arena, List_String_Const_u8 *list){
if (prj_dir.size > 0){ if (prj_dir.size > 0){
string_list_push(arena, list, prj_dir); string_list_push(arena, list, prj_dir);
} }
// TODO(allen): User directory
def_search_list_add_system_path(arena, list, SystemPath_Binary); def_search_list_add_system_path(arena, list, SystemPath_Binary);
} }
@ -1580,6 +1583,29 @@ load_theme_file_into_live_set(Application_Links *app, char *file_name){
save_theme(color_table, name); save_theme(color_table, name);
} }
function void
load_folder_of_themes_into_live_set(Application_Links *app, String_Const_u8 path){
Scratch_Block scratch(app);
File_List list = system_get_file_list(scratch, path);
for (File_Info **ptr = list.infos, **end = list.infos + list.count;
ptr < end;
ptr += 1){
File_Info *info = *ptr;
if (!HasFlag(info->attributes.flags, FileAttribute_IsDirectory)){
String_Const_u8 name = info->file_name;
Temp_Memory_Block temp(scratch);
String_Const_u8 full_name = push_u8_stringf(scratch, "%.*s/%.*s",
string_expand(path),
string_expand(name));
load_theme_file_into_live_set(app, (char*)full_name.str);
}
}
}
////////////////////////////////
// NOTE(allen): Commands
CUSTOM_COMMAND_SIG(load_theme_current_buffer) CUSTOM_COMMAND_SIG(load_theme_current_buffer)
CUSTOM_DOC("Parse the current buffer as a theme file and add the theme to the theme list. If the buffer has a .4coder postfix in it's name, it is removed when the name is saved.") CUSTOM_DOC("Parse the current buffer as a theme file and add the theme to the theme list. If the buffer has a .4coder postfix in it's name, it is removed when the name is saved.")
{ {
@ -1624,24 +1650,15 @@ CUSTOM_DOC("Parse the current buffer as a theme file and add the theme to the th
} }
} }
function void CUSTOM_COMMAND_SIG(go_to_user_directory)
load_folder_of_themes_into_live_set(Application_Links *app, String_Const_u8 path){ CUSTOM_DOC("Go to the 4coder user directory")
{
Scratch_Block scratch(app); Scratch_Block scratch(app);
String_Const_u8 hot = push_hot_directory(app, scratch);
File_List list = system_get_file_list(scratch, path); String8 user_4coder_path = system_get_path(scratch, SystemPath_UserDirectory);
for (File_Info **ptr = list.infos, **end = list.infos + list.count; String8 cmd = push_u8_stringf(scratch, "mkdir \"%.*s\"", string_expand(user_4coder_path));
ptr < end; exec_system_command(app, 0, buffer_identifier(0), hot, cmd, 0);
ptr += 1){ set_hot_directory(app, user_4coder_path);
File_Info *info = *ptr;
if (!HasFlag(info->attributes.flags, FileAttribute_IsDirectory)){
String_Const_u8 name = info->file_name;
Temp_Memory_Block temp(scratch);
String_Const_u8 full_name = push_u8_stringf(scratch, "%.*s/%.*s",
string_expand(path),
string_expand(name));
load_theme_file_into_live_set(app, (char*)full_name.str);
}
}
} }
// BOTTOM // BOTTOM

View File

@ -175,6 +175,8 @@ struct Config_Get_Result_List{
//////////////////////////////// ////////////////////////////////
// NOTE(allen): Config Search List // NOTE(allen): Config Search List
function void def_search_normal_load_list(Arena *arena, List_String_Const_u8 *list);
function String_Const_u8 def_search_get_full_path(Arena *arena, List_String_Const_u8 *list, String_Const_u8 file_name); function String_Const_u8 def_search_get_full_path(Arena *arena, List_String_Const_u8 *list, String_Const_u8 file_name);
function FILE *def_search_normal_fopen(Arena *arena, char *file_name, char *opt); function FILE *def_search_normal_fopen(Arena *arena, char *file_name, char *opt);

View File

@ -17,7 +17,6 @@
function void def_search_add_path(Arena *arena, List_String_Const_u8 *list, String_Const_u8 path); function void def_search_add_path(Arena *arena, List_String_Const_u8 *list, String_Const_u8 path);
function void def_search_list_add_system_path(Arena *arena, List_String_Const_u8 *list, System_Path_Code path); function void def_search_list_add_system_path(Arena *arena, List_String_Const_u8 *list, System_Path_Code path);
function void def_search_normal_load_list(Arena *arena, List_String_Const_u8 *list);
//////////////////////////////// ////////////////////////////////
// NOTE(allen): Search List Functions // NOTE(allen): Search List Functions

View File

@ -35,6 +35,7 @@ typedef i32 System_Path_Code;
enum{ enum{
SystemPath_CurrentDirectory, SystemPath_CurrentDirectory,
SystemPath_Binary, SystemPath_Binary,
SystemPath_UserDirectory,
}; };
struct Memory_Annotation_Node{ struct Memory_Annotation_Node{

View File

@ -2,7 +2,7 @@
#define command_id(c) (fcoder_metacmd_ID_##c) #define command_id(c) (fcoder_metacmd_ID_##c)
#define command_metadata(c) (&fcoder_metacmd_table[command_id(c)]) #define command_metadata(c) (&fcoder_metacmd_table[command_id(c)])
#define command_metadata_by_id(id) (&fcoder_metacmd_table[id]) #define command_metadata_by_id(id) (&fcoder_metacmd_table[id])
#define command_one_past_last_id 251 #define command_one_past_last_id 252
#if defined(CUSTOM_COMMAND_SIG) #if defined(CUSTOM_COMMAND_SIG)
#define PROC_LINKS(x,y) x #define PROC_LINKS(x,y) x
#else #else
@ -61,6 +61,7 @@ CUSTOM_COMMAND_SIG(duplicate_line);
CUSTOM_COMMAND_SIG(execute_any_cli); CUSTOM_COMMAND_SIG(execute_any_cli);
CUSTOM_COMMAND_SIG(execute_previous_cli); CUSTOM_COMMAND_SIG(execute_previous_cli);
CUSTOM_COMMAND_SIG(exit_4coder); CUSTOM_COMMAND_SIG(exit_4coder);
CUSTOM_COMMAND_SIG(go_to_user_directory);
CUSTOM_COMMAND_SIG(goto_beginning_of_file); CUSTOM_COMMAND_SIG(goto_beginning_of_file);
CUSTOM_COMMAND_SIG(goto_end_of_file); CUSTOM_COMMAND_SIG(goto_end_of_file);
CUSTOM_COMMAND_SIG(goto_first_jump); CUSTOM_COMMAND_SIG(goto_first_jump);
@ -272,7 +273,7 @@ char *source_name;
i32 source_name_len; i32 source_name_len;
i32 line_number; i32 line_number;
}; };
static Command_Metadata fcoder_metacmd_table[251] = { static Command_Metadata fcoder_metacmd_table[252] = {
{ PROC_LINKS(allow_mouse, 0), false, "allow_mouse", 11, "Shows the mouse and causes all mouse input to be processed normally.", 68, "W:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 481 }, { PROC_LINKS(allow_mouse, 0), false, "allow_mouse", 11, "Shows the mouse and causes all mouse input to be processed normally.", 68, "W:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 481 },
{ PROC_LINKS(auto_indent_line_at_cursor, 0), false, "auto_indent_line_at_cursor", 26, "Auto-indents the line on which the cursor sits.", 47, "W:\\4ed\\code\\custom\\4coder_auto_indent.cpp", 41, 419 }, { PROC_LINKS(auto_indent_line_at_cursor, 0), false, "auto_indent_line_at_cursor", 26, "Auto-indents the line on which the cursor sits.", 47, "W:\\4ed\\code\\custom\\4coder_auto_indent.cpp", 41, 419 },
{ PROC_LINKS(auto_indent_range, 0), false, "auto_indent_range", 17, "Auto-indents the range between the cursor and the mark.", 55, "W:\\4ed\\code\\custom\\4coder_auto_indent.cpp", 41, 429 }, { PROC_LINKS(auto_indent_range, 0), false, "auto_indent_range", 17, "Auto-indents the range between the cursor and the mark.", 55, "W:\\4ed\\code\\custom\\4coder_auto_indent.cpp", 41, 429 },
@ -325,6 +326,7 @@ static Command_Metadata fcoder_metacmd_table[251] = {
{ PROC_LINKS(execute_any_cli, 0), false, "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\\custom\\4coder_cli_command.cpp", 41, 22 }, { PROC_LINKS(execute_any_cli, 0), false, "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\\custom\\4coder_cli_command.cpp", 41, 22 },
{ PROC_LINKS(execute_previous_cli, 0), false, "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\\custom\\4coder_cli_command.cpp", 41, 7 }, { PROC_LINKS(execute_previous_cli, 0), false, "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\\custom\\4coder_cli_command.cpp", 41, 7 },
{ PROC_LINKS(exit_4coder, 0), false, "exit_4coder", 11, "Attempts to close 4coder.", 25, "W:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 846 }, { PROC_LINKS(exit_4coder, 0), false, "exit_4coder", 11, "Attempts to close 4coder.", 25, "W:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 846 },
{ PROC_LINKS(go_to_user_directory, 0), false, "go_to_user_directory", 20, "Go to the 4coder user directory", 31, "W:\\4ed\\code\\custom\\4coder_config.cpp", 36, 1653 },
{ PROC_LINKS(goto_beginning_of_file, 0), false, "goto_beginning_of_file", 22, "Sets the cursor to the beginning of the file.", 45, "W:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2261 }, { PROC_LINKS(goto_beginning_of_file, 0), false, "goto_beginning_of_file", 22, "Sets the cursor to the beginning of the file.", 45, "W:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2261 },
{ PROC_LINKS(goto_end_of_file, 0), false, "goto_end_of_file", 16, "Sets the cursor to the end of the file.", 39, "W:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2269 }, { PROC_LINKS(goto_end_of_file, 0), false, "goto_end_of_file", 16, "Sets the cursor to the end of the file.", 39, "W:\\4ed\\code\\custom\\4coder_helper.cpp", 36, 2269 },
{ PROC_LINKS(goto_first_jump, 0), false, "goto_first_jump", 15, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer.", 95, "W:\\4ed\\code\\custom\\4coder_jump_sticky.cpp", 41, 525 }, { PROC_LINKS(goto_first_jump, 0), false, "goto_first_jump", 15, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer.", 95, "W:\\4ed\\code\\custom\\4coder_jump_sticky.cpp", 41, 525 },
@ -373,7 +375,7 @@ static Command_Metadata fcoder_metacmd_table[251] = {
{ PROC_LINKS(list_all_substring_locations, 0), false, "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\\custom\\4coder_search.cpp", 36, 174 }, { PROC_LINKS(list_all_substring_locations, 0), false, "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\\custom\\4coder_search.cpp", 36, 174 },
{ PROC_LINKS(list_all_substring_locations_case_insensitive, 0), false, "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\\custom\\4coder_search.cpp", 36, 186 }, { PROC_LINKS(list_all_substring_locations_case_insensitive, 0), false, "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\\custom\\4coder_search.cpp", 36, 186 },
{ PROC_LINKS(load_project, 0), false, "load_project", 12, "Looks for a project.4coder file in the current directory and tries to load it. Looks in parent directories until a project file is found or there are no more parents.", 167, "W:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 823 }, { PROC_LINKS(load_project, 0), false, "load_project", 12, "Looks for a project.4coder file in the current directory and tries to load it. Looks in parent directories until a project file is found or there are no more parents.", 167, "W:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 823 },
{ PROC_LINKS(load_theme_current_buffer, 0), false, "load_theme_current_buffer", 25, "Parse the current buffer as a theme file and add the theme to the theme list. If the buffer has a .4coder postfix in it's name, it is removed when the name is saved.", 165, "W:\\4ed\\code\\custom\\4coder_config.cpp", 36, 1583 }, { PROC_LINKS(load_theme_current_buffer, 0), false, "load_theme_current_buffer", 25, "Parse the current buffer as a theme file and add the theme to the theme list. If the buffer has a .4coder postfix in it's name, it is removed when the name is saved.", 165, "W:\\4ed\\code\\custom\\4coder_config.cpp", 36, 1609 },
{ PROC_LINKS(load_themes_default_folder, 0), false, "load_themes_default_folder", 26, "Loads all the theme files in the default theme folder.", 54, "W:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 535 }, { PROC_LINKS(load_themes_default_folder, 0), false, "load_themes_default_folder", 26, "Loads all the theme files in the default theme folder.", 54, "W:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 535 },
{ PROC_LINKS(load_themes_hot_directory, 0), false, "load_themes_hot_directory", 25, "Loads all the theme files in the current hot directory.", 55, "W:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 547 }, { PROC_LINKS(load_themes_hot_directory, 0), false, "load_themes_hot_directory", 25, "Loads all the theme files in the current hot directory.", 55, "W:\\4ed\\code\\custom\\4coder_default_framework.cpp", 47, 547 },
{ PROC_LINKS(make_directory_query, 0), false, "make_directory_query", 20, "Queries the user for a name and creates a new directory with the given name.", 76, "W:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1495 }, { PROC_LINKS(make_directory_query, 0), false, "make_directory_query", 20, "Queries the user for a name and creates a new directory with the given name.", 76, "W:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 1495 },
@ -577,203 +579,204 @@ static i32 fcoder_metacmd_ID_duplicate_line = 48;
static i32 fcoder_metacmd_ID_execute_any_cli = 49; static i32 fcoder_metacmd_ID_execute_any_cli = 49;
static i32 fcoder_metacmd_ID_execute_previous_cli = 50; static i32 fcoder_metacmd_ID_execute_previous_cli = 50;
static i32 fcoder_metacmd_ID_exit_4coder = 51; static i32 fcoder_metacmd_ID_exit_4coder = 51;
static i32 fcoder_metacmd_ID_goto_beginning_of_file = 52; static i32 fcoder_metacmd_ID_go_to_user_directory = 52;
static i32 fcoder_metacmd_ID_goto_end_of_file = 53; static i32 fcoder_metacmd_ID_goto_beginning_of_file = 53;
static i32 fcoder_metacmd_ID_goto_first_jump = 54; static i32 fcoder_metacmd_ID_goto_end_of_file = 54;
static i32 fcoder_metacmd_ID_goto_first_jump_same_panel_sticky = 55; static i32 fcoder_metacmd_ID_goto_first_jump = 55;
static i32 fcoder_metacmd_ID_goto_jump_at_cursor = 56; static i32 fcoder_metacmd_ID_goto_first_jump_same_panel_sticky = 56;
static i32 fcoder_metacmd_ID_goto_jump_at_cursor_same_panel = 57; static i32 fcoder_metacmd_ID_goto_jump_at_cursor = 57;
static i32 fcoder_metacmd_ID_goto_line = 58; static i32 fcoder_metacmd_ID_goto_jump_at_cursor_same_panel = 58;
static i32 fcoder_metacmd_ID_goto_next_jump = 59; static i32 fcoder_metacmd_ID_goto_line = 59;
static i32 fcoder_metacmd_ID_goto_next_jump_no_skips = 60; static i32 fcoder_metacmd_ID_goto_next_jump = 60;
static i32 fcoder_metacmd_ID_goto_prev_jump = 61; static i32 fcoder_metacmd_ID_goto_next_jump_no_skips = 61;
static i32 fcoder_metacmd_ID_goto_prev_jump_no_skips = 62; static i32 fcoder_metacmd_ID_goto_prev_jump = 62;
static i32 fcoder_metacmd_ID_hide_filebar = 63; static i32 fcoder_metacmd_ID_goto_prev_jump_no_skips = 63;
static i32 fcoder_metacmd_ID_hide_scrollbar = 64; static i32 fcoder_metacmd_ID_hide_filebar = 64;
static i32 fcoder_metacmd_ID_hit_sfx = 65; static i32 fcoder_metacmd_ID_hide_scrollbar = 65;
static i32 fcoder_metacmd_ID_hms_demo_tutorial = 66; static i32 fcoder_metacmd_ID_hit_sfx = 66;
static i32 fcoder_metacmd_ID_if0_off = 67; static i32 fcoder_metacmd_ID_hms_demo_tutorial = 67;
static i32 fcoder_metacmd_ID_if_read_only_goto_position = 68; static i32 fcoder_metacmd_ID_if0_off = 68;
static i32 fcoder_metacmd_ID_if_read_only_goto_position_same_panel = 69; static i32 fcoder_metacmd_ID_if_read_only_goto_position = 69;
static i32 fcoder_metacmd_ID_increase_face_size = 70; static i32 fcoder_metacmd_ID_if_read_only_goto_position_same_panel = 70;
static i32 fcoder_metacmd_ID_interactive_kill_buffer = 71; static i32 fcoder_metacmd_ID_increase_face_size = 71;
static i32 fcoder_metacmd_ID_interactive_new = 72; static i32 fcoder_metacmd_ID_interactive_kill_buffer = 72;
static i32 fcoder_metacmd_ID_interactive_open = 73; static i32 fcoder_metacmd_ID_interactive_new = 73;
static i32 fcoder_metacmd_ID_interactive_open_or_new = 74; static i32 fcoder_metacmd_ID_interactive_open = 74;
static i32 fcoder_metacmd_ID_interactive_switch_buffer = 75; static i32 fcoder_metacmd_ID_interactive_open_or_new = 75;
static i32 fcoder_metacmd_ID_jump_to_definition = 76; static i32 fcoder_metacmd_ID_interactive_switch_buffer = 76;
static i32 fcoder_metacmd_ID_jump_to_definition_at_cursor = 77; static i32 fcoder_metacmd_ID_jump_to_definition = 77;
static i32 fcoder_metacmd_ID_jump_to_last_point = 78; static i32 fcoder_metacmd_ID_jump_to_definition_at_cursor = 78;
static i32 fcoder_metacmd_ID_keyboard_macro_finish_recording = 79; static i32 fcoder_metacmd_ID_jump_to_last_point = 79;
static i32 fcoder_metacmd_ID_keyboard_macro_replay = 80; static i32 fcoder_metacmd_ID_keyboard_macro_finish_recording = 80;
static i32 fcoder_metacmd_ID_keyboard_macro_start_recording = 81; static i32 fcoder_metacmd_ID_keyboard_macro_replay = 81;
static i32 fcoder_metacmd_ID_kill_buffer = 82; static i32 fcoder_metacmd_ID_keyboard_macro_start_recording = 82;
static i32 fcoder_metacmd_ID_kill_tutorial = 83; static i32 fcoder_metacmd_ID_kill_buffer = 83;
static i32 fcoder_metacmd_ID_left_adjust_view = 84; static i32 fcoder_metacmd_ID_kill_tutorial = 84;
static i32 fcoder_metacmd_ID_list_all_functions_all_buffers = 85; static i32 fcoder_metacmd_ID_left_adjust_view = 85;
static i32 fcoder_metacmd_ID_list_all_functions_all_buffers_lister = 86; static i32 fcoder_metacmd_ID_list_all_functions_all_buffers = 86;
static i32 fcoder_metacmd_ID_list_all_functions_current_buffer = 87; static i32 fcoder_metacmd_ID_list_all_functions_all_buffers_lister = 87;
static i32 fcoder_metacmd_ID_list_all_functions_current_buffer_lister = 88; static i32 fcoder_metacmd_ID_list_all_functions_current_buffer = 88;
static i32 fcoder_metacmd_ID_list_all_locations = 89; static i32 fcoder_metacmd_ID_list_all_functions_current_buffer_lister = 89;
static i32 fcoder_metacmd_ID_list_all_locations_case_insensitive = 90; static i32 fcoder_metacmd_ID_list_all_locations = 90;
static i32 fcoder_metacmd_ID_list_all_locations_of_identifier = 91; static i32 fcoder_metacmd_ID_list_all_locations_case_insensitive = 91;
static i32 fcoder_metacmd_ID_list_all_locations_of_identifier_case_insensitive = 92; static i32 fcoder_metacmd_ID_list_all_locations_of_identifier = 92;
static i32 fcoder_metacmd_ID_list_all_locations_of_selection = 93; static i32 fcoder_metacmd_ID_list_all_locations_of_identifier_case_insensitive = 93;
static i32 fcoder_metacmd_ID_list_all_locations_of_selection_case_insensitive = 94; static i32 fcoder_metacmd_ID_list_all_locations_of_selection = 94;
static i32 fcoder_metacmd_ID_list_all_locations_of_type_definition = 95; static i32 fcoder_metacmd_ID_list_all_locations_of_selection_case_insensitive = 95;
static i32 fcoder_metacmd_ID_list_all_locations_of_type_definition_of_identifier = 96; static i32 fcoder_metacmd_ID_list_all_locations_of_type_definition = 96;
static i32 fcoder_metacmd_ID_list_all_substring_locations = 97; static i32 fcoder_metacmd_ID_list_all_locations_of_type_definition_of_identifier = 97;
static i32 fcoder_metacmd_ID_list_all_substring_locations_case_insensitive = 98; static i32 fcoder_metacmd_ID_list_all_substring_locations = 98;
static i32 fcoder_metacmd_ID_load_project = 99; static i32 fcoder_metacmd_ID_list_all_substring_locations_case_insensitive = 99;
static i32 fcoder_metacmd_ID_load_theme_current_buffer = 100; static i32 fcoder_metacmd_ID_load_project = 100;
static i32 fcoder_metacmd_ID_load_themes_default_folder = 101; static i32 fcoder_metacmd_ID_load_theme_current_buffer = 101;
static i32 fcoder_metacmd_ID_load_themes_hot_directory = 102; static i32 fcoder_metacmd_ID_load_themes_default_folder = 102;
static i32 fcoder_metacmd_ID_make_directory_query = 103; static i32 fcoder_metacmd_ID_load_themes_hot_directory = 103;
static i32 fcoder_metacmd_ID_miblo_decrement_basic = 104; static i32 fcoder_metacmd_ID_make_directory_query = 104;
static i32 fcoder_metacmd_ID_miblo_decrement_time_stamp = 105; static i32 fcoder_metacmd_ID_miblo_decrement_basic = 105;
static i32 fcoder_metacmd_ID_miblo_decrement_time_stamp_minute = 106; static i32 fcoder_metacmd_ID_miblo_decrement_time_stamp = 106;
static i32 fcoder_metacmd_ID_miblo_increment_basic = 107; static i32 fcoder_metacmd_ID_miblo_decrement_time_stamp_minute = 107;
static i32 fcoder_metacmd_ID_miblo_increment_time_stamp = 108; static i32 fcoder_metacmd_ID_miblo_increment_basic = 108;
static i32 fcoder_metacmd_ID_miblo_increment_time_stamp_minute = 109; static i32 fcoder_metacmd_ID_miblo_increment_time_stamp = 109;
static i32 fcoder_metacmd_ID_mouse_wheel_change_face_size = 110; static i32 fcoder_metacmd_ID_miblo_increment_time_stamp_minute = 110;
static i32 fcoder_metacmd_ID_mouse_wheel_scroll = 111; static i32 fcoder_metacmd_ID_mouse_wheel_change_face_size = 111;
static i32 fcoder_metacmd_ID_move_down = 112; static i32 fcoder_metacmd_ID_mouse_wheel_scroll = 112;
static i32 fcoder_metacmd_ID_move_down_10 = 113; static i32 fcoder_metacmd_ID_move_down = 113;
static i32 fcoder_metacmd_ID_move_down_textual = 114; static i32 fcoder_metacmd_ID_move_down_10 = 114;
static i32 fcoder_metacmd_ID_move_down_to_blank_line = 115; static i32 fcoder_metacmd_ID_move_down_textual = 115;
static i32 fcoder_metacmd_ID_move_down_to_blank_line_end = 116; static i32 fcoder_metacmd_ID_move_down_to_blank_line = 116;
static i32 fcoder_metacmd_ID_move_down_to_blank_line_skip_whitespace = 117; static i32 fcoder_metacmd_ID_move_down_to_blank_line_end = 117;
static i32 fcoder_metacmd_ID_move_left = 118; static i32 fcoder_metacmd_ID_move_down_to_blank_line_skip_whitespace = 118;
static i32 fcoder_metacmd_ID_move_left_alpha_numeric_boundary = 119; static i32 fcoder_metacmd_ID_move_left = 119;
static i32 fcoder_metacmd_ID_move_left_alpha_numeric_or_camel_boundary = 120; static i32 fcoder_metacmd_ID_move_left_alpha_numeric_boundary = 120;
static i32 fcoder_metacmd_ID_move_left_token_boundary = 121; static i32 fcoder_metacmd_ID_move_left_alpha_numeric_or_camel_boundary = 121;
static i32 fcoder_metacmd_ID_move_left_whitespace_boundary = 122; static i32 fcoder_metacmd_ID_move_left_token_boundary = 122;
static i32 fcoder_metacmd_ID_move_left_whitespace_or_token_boundary = 123; static i32 fcoder_metacmd_ID_move_left_whitespace_boundary = 123;
static i32 fcoder_metacmd_ID_move_line_down = 124; static i32 fcoder_metacmd_ID_move_left_whitespace_or_token_boundary = 124;
static i32 fcoder_metacmd_ID_move_line_up = 125; static i32 fcoder_metacmd_ID_move_line_down = 125;
static i32 fcoder_metacmd_ID_move_right = 126; static i32 fcoder_metacmd_ID_move_line_up = 126;
static i32 fcoder_metacmd_ID_move_right_alpha_numeric_boundary = 127; static i32 fcoder_metacmd_ID_move_right = 127;
static i32 fcoder_metacmd_ID_move_right_alpha_numeric_or_camel_boundary = 128; static i32 fcoder_metacmd_ID_move_right_alpha_numeric_boundary = 128;
static i32 fcoder_metacmd_ID_move_right_token_boundary = 129; static i32 fcoder_metacmd_ID_move_right_alpha_numeric_or_camel_boundary = 129;
static i32 fcoder_metacmd_ID_move_right_whitespace_boundary = 130; static i32 fcoder_metacmd_ID_move_right_token_boundary = 130;
static i32 fcoder_metacmd_ID_move_right_whitespace_or_token_boundary = 131; static i32 fcoder_metacmd_ID_move_right_whitespace_boundary = 131;
static i32 fcoder_metacmd_ID_move_up = 132; static i32 fcoder_metacmd_ID_move_right_whitespace_or_token_boundary = 132;
static i32 fcoder_metacmd_ID_move_up_10 = 133; static i32 fcoder_metacmd_ID_move_up = 133;
static i32 fcoder_metacmd_ID_move_up_to_blank_line = 134; static i32 fcoder_metacmd_ID_move_up_10 = 134;
static i32 fcoder_metacmd_ID_move_up_to_blank_line_end = 135; static i32 fcoder_metacmd_ID_move_up_to_blank_line = 135;
static i32 fcoder_metacmd_ID_move_up_to_blank_line_skip_whitespace = 136; static i32 fcoder_metacmd_ID_move_up_to_blank_line_end = 136;
static i32 fcoder_metacmd_ID_multi_paste = 137; static i32 fcoder_metacmd_ID_move_up_to_blank_line_skip_whitespace = 137;
static i32 fcoder_metacmd_ID_multi_paste_interactive = 138; static i32 fcoder_metacmd_ID_multi_paste = 138;
static i32 fcoder_metacmd_ID_multi_paste_interactive_quick = 139; static i32 fcoder_metacmd_ID_multi_paste_interactive = 139;
static i32 fcoder_metacmd_ID_music_start = 140; static i32 fcoder_metacmd_ID_multi_paste_interactive_quick = 140;
static i32 fcoder_metacmd_ID_music_stop = 141; static i32 fcoder_metacmd_ID_music_start = 141;
static i32 fcoder_metacmd_ID_open_all_code = 142; static i32 fcoder_metacmd_ID_music_stop = 142;
static i32 fcoder_metacmd_ID_open_all_code_recursive = 143; static i32 fcoder_metacmd_ID_open_all_code = 143;
static i32 fcoder_metacmd_ID_open_file_in_quotes = 144; static i32 fcoder_metacmd_ID_open_all_code_recursive = 144;
static i32 fcoder_metacmd_ID_open_in_other = 145; static i32 fcoder_metacmd_ID_open_file_in_quotes = 145;
static i32 fcoder_metacmd_ID_open_long_braces = 146; static i32 fcoder_metacmd_ID_open_in_other = 146;
static i32 fcoder_metacmd_ID_open_long_braces_break = 147; static i32 fcoder_metacmd_ID_open_long_braces = 147;
static i32 fcoder_metacmd_ID_open_long_braces_semicolon = 148; static i32 fcoder_metacmd_ID_open_long_braces_break = 148;
static i32 fcoder_metacmd_ID_open_matching_file_cpp = 149; static i32 fcoder_metacmd_ID_open_long_braces_semicolon = 149;
static i32 fcoder_metacmd_ID_open_panel_hsplit = 150; static i32 fcoder_metacmd_ID_open_matching_file_cpp = 150;
static i32 fcoder_metacmd_ID_open_panel_vsplit = 151; static i32 fcoder_metacmd_ID_open_panel_hsplit = 151;
static i32 fcoder_metacmd_ID_page_down = 152; static i32 fcoder_metacmd_ID_open_panel_vsplit = 152;
static i32 fcoder_metacmd_ID_page_up = 153; static i32 fcoder_metacmd_ID_page_down = 153;
static i32 fcoder_metacmd_ID_paste = 154; static i32 fcoder_metacmd_ID_page_up = 154;
static i32 fcoder_metacmd_ID_paste_and_indent = 155; static i32 fcoder_metacmd_ID_paste = 155;
static i32 fcoder_metacmd_ID_paste_next = 156; static i32 fcoder_metacmd_ID_paste_and_indent = 156;
static i32 fcoder_metacmd_ID_paste_next_and_indent = 157; static i32 fcoder_metacmd_ID_paste_next = 157;
static i32 fcoder_metacmd_ID_place_in_scope = 158; static i32 fcoder_metacmd_ID_paste_next_and_indent = 158;
static i32 fcoder_metacmd_ID_play_with_a_counter = 159; static i32 fcoder_metacmd_ID_place_in_scope = 159;
static i32 fcoder_metacmd_ID_profile_clear = 160; static i32 fcoder_metacmd_ID_play_with_a_counter = 160;
static i32 fcoder_metacmd_ID_profile_disable = 161; static i32 fcoder_metacmd_ID_profile_clear = 161;
static i32 fcoder_metacmd_ID_profile_enable = 162; static i32 fcoder_metacmd_ID_profile_disable = 162;
static i32 fcoder_metacmd_ID_profile_inspect = 163; static i32 fcoder_metacmd_ID_profile_enable = 163;
static i32 fcoder_metacmd_ID_project_command_lister = 164; static i32 fcoder_metacmd_ID_profile_inspect = 164;
static i32 fcoder_metacmd_ID_project_fkey_command = 165; static i32 fcoder_metacmd_ID_project_command_lister = 165;
static i32 fcoder_metacmd_ID_project_go_to_root_directory = 166; static i32 fcoder_metacmd_ID_project_fkey_command = 166;
static i32 fcoder_metacmd_ID_project_reprint = 167; static i32 fcoder_metacmd_ID_project_go_to_root_directory = 167;
static i32 fcoder_metacmd_ID_query_replace = 168; static i32 fcoder_metacmd_ID_project_reprint = 168;
static i32 fcoder_metacmd_ID_query_replace_identifier = 169; static i32 fcoder_metacmd_ID_query_replace = 169;
static i32 fcoder_metacmd_ID_query_replace_selection = 170; static i32 fcoder_metacmd_ID_query_replace_identifier = 170;
static i32 fcoder_metacmd_ID_quick_swap_buffer = 171; static i32 fcoder_metacmd_ID_query_replace_selection = 171;
static i32 fcoder_metacmd_ID_redo = 172; static i32 fcoder_metacmd_ID_quick_swap_buffer = 172;
static i32 fcoder_metacmd_ID_redo_all_buffers = 173; static i32 fcoder_metacmd_ID_redo = 173;
static i32 fcoder_metacmd_ID_rename_file_query = 174; static i32 fcoder_metacmd_ID_redo_all_buffers = 174;
static i32 fcoder_metacmd_ID_reopen = 175; static i32 fcoder_metacmd_ID_rename_file_query = 175;
static i32 fcoder_metacmd_ID_replace_in_all_buffers = 176; static i32 fcoder_metacmd_ID_reopen = 176;
static i32 fcoder_metacmd_ID_replace_in_buffer = 177; static i32 fcoder_metacmd_ID_replace_in_all_buffers = 177;
static i32 fcoder_metacmd_ID_replace_in_range = 178; static i32 fcoder_metacmd_ID_replace_in_buffer = 178;
static i32 fcoder_metacmd_ID_reverse_search = 179; static i32 fcoder_metacmd_ID_replace_in_range = 179;
static i32 fcoder_metacmd_ID_reverse_search_identifier = 180; static i32 fcoder_metacmd_ID_reverse_search = 180;
static i32 fcoder_metacmd_ID_save = 181; static i32 fcoder_metacmd_ID_reverse_search_identifier = 181;
static i32 fcoder_metacmd_ID_save_all_dirty_buffers = 182; static i32 fcoder_metacmd_ID_save = 182;
static i32 fcoder_metacmd_ID_save_to_query = 183; static i32 fcoder_metacmd_ID_save_all_dirty_buffers = 183;
static i32 fcoder_metacmd_ID_search = 184; static i32 fcoder_metacmd_ID_save_to_query = 184;
static i32 fcoder_metacmd_ID_search_identifier = 185; static i32 fcoder_metacmd_ID_search = 185;
static i32 fcoder_metacmd_ID_seek_beginning_of_line = 186; static i32 fcoder_metacmd_ID_search_identifier = 186;
static i32 fcoder_metacmd_ID_seek_beginning_of_textual_line = 187; static i32 fcoder_metacmd_ID_seek_beginning_of_line = 187;
static i32 fcoder_metacmd_ID_seek_end_of_line = 188; static i32 fcoder_metacmd_ID_seek_beginning_of_textual_line = 188;
static i32 fcoder_metacmd_ID_seek_end_of_textual_line = 189; static i32 fcoder_metacmd_ID_seek_end_of_line = 189;
static i32 fcoder_metacmd_ID_select_all = 190; static i32 fcoder_metacmd_ID_seek_end_of_textual_line = 190;
static i32 fcoder_metacmd_ID_select_next_scope_absolute = 191; static i32 fcoder_metacmd_ID_select_all = 191;
static i32 fcoder_metacmd_ID_select_next_scope_after_current = 192; static i32 fcoder_metacmd_ID_select_next_scope_absolute = 192;
static i32 fcoder_metacmd_ID_select_prev_scope_absolute = 193; static i32 fcoder_metacmd_ID_select_next_scope_after_current = 193;
static i32 fcoder_metacmd_ID_select_prev_top_most_scope = 194; static i32 fcoder_metacmd_ID_select_prev_scope_absolute = 194;
static i32 fcoder_metacmd_ID_select_surrounding_scope = 195; static i32 fcoder_metacmd_ID_select_prev_top_most_scope = 195;
static i32 fcoder_metacmd_ID_select_surrounding_scope_maximal = 196; static i32 fcoder_metacmd_ID_select_surrounding_scope = 196;
static i32 fcoder_metacmd_ID_set_eol_mode_from_contents = 197; static i32 fcoder_metacmd_ID_select_surrounding_scope_maximal = 197;
static i32 fcoder_metacmd_ID_set_eol_mode_to_binary = 198; static i32 fcoder_metacmd_ID_set_eol_mode_from_contents = 198;
static i32 fcoder_metacmd_ID_set_eol_mode_to_crlf = 199; static i32 fcoder_metacmd_ID_set_eol_mode_to_binary = 199;
static i32 fcoder_metacmd_ID_set_eol_mode_to_lf = 200; static i32 fcoder_metacmd_ID_set_eol_mode_to_crlf = 200;
static i32 fcoder_metacmd_ID_set_face_size = 201; static i32 fcoder_metacmd_ID_set_eol_mode_to_lf = 201;
static i32 fcoder_metacmd_ID_set_face_size_this_buffer = 202; static i32 fcoder_metacmd_ID_set_face_size = 202;
static i32 fcoder_metacmd_ID_set_mark = 203; static i32 fcoder_metacmd_ID_set_face_size_this_buffer = 203;
static i32 fcoder_metacmd_ID_set_mode_to_notepad_like = 204; static i32 fcoder_metacmd_ID_set_mark = 204;
static i32 fcoder_metacmd_ID_set_mode_to_original = 205; static i32 fcoder_metacmd_ID_set_mode_to_notepad_like = 205;
static i32 fcoder_metacmd_ID_setup_build_bat = 206; static i32 fcoder_metacmd_ID_set_mode_to_original = 206;
static i32 fcoder_metacmd_ID_setup_build_bat_and_sh = 207; static i32 fcoder_metacmd_ID_setup_build_bat = 207;
static i32 fcoder_metacmd_ID_setup_build_sh = 208; static i32 fcoder_metacmd_ID_setup_build_bat_and_sh = 208;
static i32 fcoder_metacmd_ID_setup_new_project = 209; static i32 fcoder_metacmd_ID_setup_build_sh = 209;
static i32 fcoder_metacmd_ID_show_filebar = 210; static i32 fcoder_metacmd_ID_setup_new_project = 210;
static i32 fcoder_metacmd_ID_show_scrollbar = 211; static i32 fcoder_metacmd_ID_show_filebar = 211;
static i32 fcoder_metacmd_ID_show_the_log_graph = 212; static i32 fcoder_metacmd_ID_show_scrollbar = 212;
static i32 fcoder_metacmd_ID_snipe_backward_whitespace_or_token_boundary = 213; static i32 fcoder_metacmd_ID_show_the_log_graph = 213;
static i32 fcoder_metacmd_ID_snipe_forward_whitespace_or_token_boundary = 214; static i32 fcoder_metacmd_ID_snipe_backward_whitespace_or_token_boundary = 214;
static i32 fcoder_metacmd_ID_snippet_lister = 215; static i32 fcoder_metacmd_ID_snipe_forward_whitespace_or_token_boundary = 215;
static i32 fcoder_metacmd_ID_string_repeat = 216; static i32 fcoder_metacmd_ID_snippet_lister = 216;
static i32 fcoder_metacmd_ID_suppress_mouse = 217; static i32 fcoder_metacmd_ID_string_repeat = 217;
static i32 fcoder_metacmd_ID_swap_panels = 218; static i32 fcoder_metacmd_ID_suppress_mouse = 218;
static i32 fcoder_metacmd_ID_theme_lister = 219; static i32 fcoder_metacmd_ID_swap_panels = 219;
static i32 fcoder_metacmd_ID_to_lowercase = 220; static i32 fcoder_metacmd_ID_theme_lister = 220;
static i32 fcoder_metacmd_ID_to_uppercase = 221; static i32 fcoder_metacmd_ID_to_lowercase = 221;
static i32 fcoder_metacmd_ID_toggle_filebar = 222; static i32 fcoder_metacmd_ID_to_uppercase = 222;
static i32 fcoder_metacmd_ID_toggle_fps_meter = 223; static i32 fcoder_metacmd_ID_toggle_filebar = 223;
static i32 fcoder_metacmd_ID_toggle_fullscreen = 224; static i32 fcoder_metacmd_ID_toggle_fps_meter = 224;
static i32 fcoder_metacmd_ID_toggle_highlight_enclosing_scopes = 225; static i32 fcoder_metacmd_ID_toggle_fullscreen = 225;
static i32 fcoder_metacmd_ID_toggle_highlight_line_at_cursor = 226; static i32 fcoder_metacmd_ID_toggle_highlight_enclosing_scopes = 226;
static i32 fcoder_metacmd_ID_toggle_line_numbers = 227; static i32 fcoder_metacmd_ID_toggle_highlight_line_at_cursor = 227;
static i32 fcoder_metacmd_ID_toggle_line_wrap = 228; static i32 fcoder_metacmd_ID_toggle_line_numbers = 228;
static i32 fcoder_metacmd_ID_toggle_mouse = 229; static i32 fcoder_metacmd_ID_toggle_line_wrap = 229;
static i32 fcoder_metacmd_ID_toggle_paren_matching_helper = 230; static i32 fcoder_metacmd_ID_toggle_mouse = 230;
static i32 fcoder_metacmd_ID_toggle_show_whitespace = 231; static i32 fcoder_metacmd_ID_toggle_paren_matching_helper = 231;
static i32 fcoder_metacmd_ID_toggle_virtual_whitespace = 232; static i32 fcoder_metacmd_ID_toggle_show_whitespace = 232;
static i32 fcoder_metacmd_ID_tutorial_maximize = 233; static i32 fcoder_metacmd_ID_toggle_virtual_whitespace = 233;
static i32 fcoder_metacmd_ID_tutorial_minimize = 234; static i32 fcoder_metacmd_ID_tutorial_maximize = 234;
static i32 fcoder_metacmd_ID_uncomment_line = 235; static i32 fcoder_metacmd_ID_tutorial_minimize = 235;
static i32 fcoder_metacmd_ID_undo = 236; static i32 fcoder_metacmd_ID_uncomment_line = 236;
static i32 fcoder_metacmd_ID_undo_all_buffers = 237; static i32 fcoder_metacmd_ID_undo = 237;
static i32 fcoder_metacmd_ID_view_buffer_other_panel = 238; static i32 fcoder_metacmd_ID_undo_all_buffers = 238;
static i32 fcoder_metacmd_ID_view_jump_list_with_lister = 239; static i32 fcoder_metacmd_ID_view_buffer_other_panel = 239;
static i32 fcoder_metacmd_ID_word_complete = 240; static i32 fcoder_metacmd_ID_view_jump_list_with_lister = 240;
static i32 fcoder_metacmd_ID_word_complete_drop_down = 241; static i32 fcoder_metacmd_ID_word_complete = 241;
static i32 fcoder_metacmd_ID_write_block = 242; static i32 fcoder_metacmd_ID_word_complete_drop_down = 242;
static i32 fcoder_metacmd_ID_write_hack = 243; static i32 fcoder_metacmd_ID_write_block = 243;
static i32 fcoder_metacmd_ID_write_note = 244; static i32 fcoder_metacmd_ID_write_hack = 244;
static i32 fcoder_metacmd_ID_write_space = 245; static i32 fcoder_metacmd_ID_write_note = 245;
static i32 fcoder_metacmd_ID_write_text_and_auto_indent = 246; static i32 fcoder_metacmd_ID_write_space = 246;
static i32 fcoder_metacmd_ID_write_text_input = 247; static i32 fcoder_metacmd_ID_write_text_and_auto_indent = 247;
static i32 fcoder_metacmd_ID_write_todo = 248; static i32 fcoder_metacmd_ID_write_text_input = 248;
static i32 fcoder_metacmd_ID_write_underscore = 249; static i32 fcoder_metacmd_ID_write_todo = 249;
static i32 fcoder_metacmd_ID_write_zero_struct = 250; static i32 fcoder_metacmd_ID_write_underscore = 250;
static i32 fcoder_metacmd_ID_write_zero_struct = 251;
#endif #endif

View File

@ -122,6 +122,10 @@ system_memory_annotation_sig(){
// 4ed path // 4ed path
// //
extern "C" {
BOOL GetUserProfileDirectoryW(HANDLE hToken, LPWSTR lpProfileDir, LPDWORD lpcchSize);
}
internal internal
system_get_path_sig(){ system_get_path_sig(){
String_Const_u8 result = {}; String_Const_u8 result = {};
@ -149,6 +153,18 @@ system_get_path_sig(){
} }
result = push_string_copy(arena, win32vars.binary_path); result = push_string_copy(arena, win32vars.binary_path);
}break; }break;
case SystemPath_UserDirectory:
{
HANDLE current_process_token = GetCurrentProcessToken();
DWORD size = 0;
GetUserProfileDirectoryW(current_process_token, 0, &size);
u16 *buffer_u16 = push_array(arena, u16, size);
if (GetUserProfileDirectoryW(current_process_token, (WCHAR*)buffer_u16, &size)){
String8 path = string_u8_from_string_u16(arena, SCu16(buffer_u16, size), StringFill_NullTerminate).string;
result = push_stringf(arena, "%.*s\\4coder\\", string_expand(path));
}
}break;
} }
return(result); return(result);
} }