Tweaks to fusion
This commit is contained in:
parent
1eaac285d9
commit
e7d2ef7a8d
|
@ -0,0 +1,5 @@
|
|||
@echo off
|
||||
|
||||
pushd ..\\build
|
||||
..\\code\\custom\\bin\\buildsuper_x64-win.bat ..\\code\\fusion\\4coder_fusion.cpp
|
||||
popd
|
|
@ -163,6 +163,12 @@ set_active_color(Color_Table *table){
|
|||
}
|
||||
}
|
||||
|
||||
// TODO(allen): Need to make this nicer.
|
||||
function void
|
||||
set_single_active_color(u64 id, ARGB_Color color){
|
||||
active_color_table.arrays[id] = make_colors(&global_theme_arena, color);
|
||||
}
|
||||
|
||||
function void
|
||||
save_theme(Color_Table table, String_Const_u8 name){
|
||||
Color_Table_Node *node = push_array(&global_theme_arena, Color_Table_Node, 1);
|
||||
|
|
|
@ -324,8 +324,8 @@ static Command_Metadata fcoder_metacmd_table[250] = {
|
|||
{ 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(exit_4coder, 0), false, "exit_4coder", 11, "Attempts to close 4coder.", 25, "w:\\4ed\\code\\custom\\4coder_base_commands.cpp", 43, 843 },
|
||||
{ PROC_LINKS(fusion_input_handler, 0), false, "fusion_input_handler", 20, "TODO - document fusion mode", 27, "w:\\4ed\\code\\fusion\\4coder_fusion.cpp", 36, 62 },
|
||||
{ PROC_LINKS(fusion_toggle_mode, 0), false, "fusion_toggle_mode", 18, "TODO - document fusion mode", 27, "w:\\4ed\\code\\fusion\\4coder_fusion.cpp", 36, 51 },
|
||||
{ PROC_LINKS(fusion_input_handler, 0), false, "fusion_input_handler", 20, "TODO - document fusion mode", 27, "w:\\4ed\\code\\fusion\\4coder_fusion.cpp", 36, 79 },
|
||||
{ PROC_LINKS(fusion_toggle_mode, 0), false, "fusion_toggle_mode", 18, "TODO - document fusion mode", 27, "w:\\4ed\\code\\fusion\\4coder_fusion.cpp", 36, 68 },
|
||||
{ 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, 2245 },
|
||||
{ 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, 2253 },
|
||||
{ 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 },
|
||||
|
|
|
@ -32,18 +32,35 @@ Fusion_Mode fusion_mode = FusionMode_Command;
|
|||
|
||||
function void
|
||||
fusion_set_mode(Fusion_Mode mode){
|
||||
local_persist ARGB_Color col_margin = finalize_color(defcolor_margin, 0);
|
||||
local_persist ARGB_Color col_margin_hover = finalize_color(defcolor_margin_hover, 0);
|
||||
local_persist ARGB_Color col_margin_active = finalize_color(defcolor_margin_active, 0);
|
||||
local_persist ARGB_Color col_back = finalize_color(defcolor_back, 0);
|
||||
|
||||
fusion_mode = mode;
|
||||
switch (mode){
|
||||
case FusionMode_Command:
|
||||
{
|
||||
col_margin = finalize_color(defcolor_margin, 0);
|
||||
col_margin_hover = finalize_color(defcolor_margin_hover, 0);
|
||||
col_margin_active = finalize_color(defcolor_margin_active, 0);
|
||||
|
||||
global_config.highlight_line_at_cursor = true;
|
||||
global_config.mark_thickness = 2.f;
|
||||
|
||||
set_single_active_color(defcolor_margin, col_back);
|
||||
set_single_active_color(defcolor_margin_hover, col_back);
|
||||
set_single_active_color(defcolor_margin_active, col_back);
|
||||
}break;
|
||||
|
||||
case FusionMode_Insert:
|
||||
{
|
||||
global_config.highlight_line_at_cursor = false;
|
||||
global_config.mark_thickness = 0.f;
|
||||
|
||||
set_single_active_color(defcolor_margin, col_margin);
|
||||
set_single_active_color(defcolor_margin_hover, col_margin_hover);
|
||||
set_single_active_color(defcolor_margin_active, col_margin_active);
|
||||
}break;
|
||||
}
|
||||
}
|
||||
|
@ -142,14 +159,16 @@ setup_fusion_mapping(Mapping *mapping){
|
|||
ParentMap(mapid_global);
|
||||
Bind(set_mark, KeyCode_Space);
|
||||
|
||||
Bind(move_up_to_blank_line_end, KeyCode_Up);
|
||||
Bind(move_down_to_blank_line_end, KeyCode_Down);
|
||||
Bind(move_up, KeyCode_Up);
|
||||
Bind(move_down, KeyCode_Down);
|
||||
Bind(move_line_up, KeyCode_Up, KeyCode_Shift);
|
||||
Bind(move_line_down, KeyCode_Down, KeyCode_Shift);
|
||||
Bind(move_left_alpha_numeric_boundary, KeyCode_Left);
|
||||
Bind(move_right_alpha_numeric_boundary, KeyCode_Right);
|
||||
Bind(move_left_alpha_numeric_or_camel_boundary, KeyCode_Left, KeyCode_Shift);
|
||||
Bind(move_right_alpha_numeric_or_camel_boundary, KeyCode_Right, KeyCode_Shift);
|
||||
Bind(seek_end_of_line, KeyCode_End);
|
||||
Bind(seek_beginning_of_line, KeyCode_Home);
|
||||
Bind(page_up, KeyCode_PageUp);
|
||||
Bind(page_down, KeyCode_PageDown);
|
||||
|
||||
|
@ -224,8 +243,8 @@ setup_fusion_mapping(Mapping *mapping){
|
|||
Bind(backspace_char, KeyCode_Backspace);
|
||||
Bind(seek_end_of_line, KeyCode_End);
|
||||
Bind(seek_beginning_of_line, KeyCode_Home);
|
||||
Bind(page_up, KeyCode_PageUp);
|
||||
Bind(page_down, KeyCode_PageDown);
|
||||
Bind(move_up_to_blank_line_end, KeyCode_PageUp);
|
||||
Bind(move_down_to_blank_line_end, KeyCode_PageDown);
|
||||
Bind(word_complete, KeyCode_Tab);
|
||||
}
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ command_list = {
|
|||
|
||||
{ .name = "build fusion",
|
||||
.out = "*compilation*", .footer_panel = true, .save_dirty_files = true,
|
||||
.cmd = { { "pushd ..\\build && ..\\code\\custom\\bin\\buildsuper_x64-win.bat ..\\code\\fusion\\4coder_fusion.cpp", .os = "win" }, }, },
|
||||
.cmd = { { "bin\\build_fusion", .os = "win" }, }, },
|
||||
};
|
||||
|
||||
fkey_command[1] = "build x64";
|
||||
|
|
Loading…
Reference in New Issue