Rearranging some of the binding files

This commit is contained in:
Allen Webster 2020-01-21 14:13:13 -08:00
parent b22b296adf
commit f23385bb1b
4 changed files with 28 additions and 31 deletions

View File

@ -34,6 +34,32 @@ parse_extension_line_to_extension_list(Application_Links *app,
//////////////////////////////// ////////////////////////////////
function void
setup_built_in_mapping(Application_Links *app, String_Const_u8 name, Mapping *mapping, i64 global_id, i64 file_id, i64 code_id){
Thread_Context *tctx = get_thread_context(app);
if (string_match(name, string_u8_litexpr("default"))){
mapping_release(tctx, mapping);
mapping_init(tctx, mapping);
setup_default_mapping(mapping, global_id, file_id, code_id);
}
else if (string_match(name, string_u8_litexpr("mac-default"))){
mapping_release(tctx, mapping);
mapping_init(tctx, mapping);
setup_mac_mapping(mapping, global_id, file_id, code_id);
}
else if (string_match(name, string_u8_litexpr("choose"))){
mapping_release(tctx, mapping);
mapping_init(tctx, mapping);
#if OS_MAC
setup_mac_mapping(mapping, global_id, file_id, code_id);
#else
setup_default_mapping(mapping, global_id, file_id, code_id);
#endif
}
}
////////////////////////////////
function Error_Location function Error_Location
get_error_location(Application_Links *app, u8 *base, u8 *pos){ get_error_location(Application_Links *app, u8 *base, u8 *pos){
ProfileScope(app, "get error location"); ProfileScope(app, "get error location");

View File

@ -11,8 +11,6 @@
// NOTE(allen): Users can declare their own managed IDs here. // NOTE(allen): Users can declare their own managed IDs here.
#include "4coder_default_map.cpp"
#include "4coder_mac_map.cpp"
#include "generated/managed_id_metadata.cpp" #include "generated/managed_id_metadata.cpp"
void void
@ -34,30 +32,6 @@ custom_layer_init(Application_Links *app){
setup_default_mapping(&framework_mapping, mapid_global, mapid_file, mapid_code); setup_default_mapping(&framework_mapping, mapid_global, mapid_file, mapid_code);
} }
function void
setup_built_in_mapping(Application_Links *app, String_Const_u8 name, Mapping *mapping, i64 global_id, i64 file_id, i64 code_id){
Thread_Context *tctx = get_thread_context(app);
if (string_match(name, string_u8_litexpr("default"))){
mapping_release(tctx, mapping);
mapping_init(tctx, mapping);
setup_default_mapping(mapping, global_id, file_id, code_id);
}
else if (string_match(name, string_u8_litexpr("mac-default"))){
mapping_release(tctx, mapping);
mapping_init(tctx, mapping);
setup_mac_mapping(mapping, global_id, file_id, code_id);
}
else if (string_match(name, string_u8_litexpr("choose"))){
mapping_release(tctx, mapping);
mapping_init(tctx, mapping);
#if OS_MAC
setup_mac_mapping(mapping, global_id, file_id, code_id);
#else
setup_default_mapping(mapping, global_id, file_id, code_id);
#endif
}
}
#endif //FCODER_DEFAULT_BINDINGS #endif //FCODER_DEFAULT_BINDINGS
// BOTTOM // BOTTOM

View File

@ -114,11 +114,6 @@ struct Fade_Range_List{
i32 count; i32 count;
}; };
////////////////////////////////
function void
setup_built_in_mapping(Application_Links *app, String_Const_u8 name, Mapping *mapping, i64 global_id, i64 file_id, i64 code_id);
#endif #endif
// BOTTOM // BOTTOM

View File

@ -78,6 +78,8 @@
#include "4coder_token.cpp" #include "4coder_token.cpp"
#include "generated/lexer_cpp.cpp" #include "generated/lexer_cpp.cpp"
#include "4coder_command_map.cpp" #include "4coder_command_map.cpp"
#include "4coder_default_map.cpp"
#include "4coder_mac_map.cpp"
#include "4coder_default_framework_variables.cpp" #include "4coder_default_framework_variables.cpp"
#include "4coder_default_colors.cpp" #include "4coder_default_colors.cpp"
#include "4coder_helper.cpp" #include "4coder_helper.cpp"