From 6eb6ff04b56dfcfc15fa72e72294a81cf2da9f30 Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Tue, 9 Oct 2018 17:05:04 -0700 Subject: [PATCH] Fixed panel resizing problem --- 4coder_generated/command_metadata.h | 10 +++++----- 4coder_lists.cpp | 5 +++-- 4ed.cpp | 3 ++- todo.txt | 5 ++--- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/4coder_generated/command_metadata.h b/4coder_generated/command_metadata.h index 5d6654d2..00348bda 100644 --- a/4coder_generated/command_metadata.h +++ b/4coder_generated/command_metadata.h @@ -258,7 +258,7 @@ static Command_Metadata fcoder_metacmd_table[216] = { { PROC_LINKS(close_all_code, 0), "close_all_code", 14, "Closes any buffer with a filename ending with an extension configured to be recognized as a code file type.", 107, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1060 }, { PROC_LINKS(close_build_panel, 0), "close_build_panel", 17, "If the special build panel is open, closes it.", 46, "w:\\4ed\\code\\4coder_build_commands.cpp", 37, 203 }, { PROC_LINKS(close_panel, 0), "close_panel", 11, "Closes the currently active panel if it is not the only panel open.", 67, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 487 }, -{ PROC_LINKS(command_lister, 0), "command_lister", 14, "Opens an interactive list of all registered commands.", 53, "w:\\4ed\\code\\4coder_lists.cpp", 28, 935 }, +{ PROC_LINKS(command_lister, 0), "command_lister", 14, "Opens an interactive list of all registered commands.", 53, "w:\\4ed\\code\\4coder_lists.cpp", 28, 936 }, { PROC_LINKS(copy, 0), "copy", 4, "Copy the text in the range from the cursor to the mark onto the clipboard.", 74, "w:\\4ed\\code\\4coder_clipboard.cpp", 32, 26 }, { PROC_LINKS(cursor_mark_swap, 0), "cursor_mark_swap", 16, "Swaps the position of the cursor and the mark.", 46, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 99 }, { PROC_LINKS(cut, 0), "cut", 3, "Cut the text in the range from the cursor to the mark onto the clipboard.", 73, "w:\\4ed\\code\\4coder_clipboard.cpp", 32, 35 }, @@ -300,9 +300,9 @@ static Command_Metadata fcoder_metacmd_table[216] = { { PROC_LINKS(increase_face_size, 0), "increase_face_size", 18, "Increase the size of the face used by the current buffer.", 57, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 565 }, { PROC_LINKS(increase_line_wrap, 0), "increase_line_wrap", 18, "Increases the current buffer's width for line wrapping.", 55, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 543 }, { PROC_LINKS(interactive_kill_buffer, 0), "interactive_kill_buffer", 23, "Interactively kill an open buffer.", 34, "w:\\4ed\\code\\4coder_lists.cpp", 28, 749 }, -{ PROC_LINKS(interactive_new, 0), "interactive_new", 15, "Interactively creates a new file.", 33, "w:\\4ed\\code\\4coder_lists.cpp", 28, 853 }, -{ PROC_LINKS(interactive_open, 0), "interactive_open", 16, "Interactively opens a file.", 27, "w:\\4ed\\code\\4coder_lists.cpp", 28, 881 }, -{ PROC_LINKS(interactive_open_or_new, 0), "interactive_open_or_new", 23, "Interactively open a file out of the file system.", 49, "w:\\4ed\\code\\4coder_lists.cpp", 28, 819 }, +{ PROC_LINKS(interactive_new, 0), "interactive_new", 15, "Interactively creates a new file.", 33, "w:\\4ed\\code\\4coder_lists.cpp", 28, 854 }, +{ PROC_LINKS(interactive_open, 0), "interactive_open", 16, "Interactively opens a file.", 27, "w:\\4ed\\code\\4coder_lists.cpp", 28, 882 }, +{ PROC_LINKS(interactive_open_or_new, 0), "interactive_open_or_new", 23, "Interactively open a file out of the file system.", 49, "w:\\4ed\\code\\4coder_lists.cpp", 28, 820 }, { PROC_LINKS(interactive_switch_buffer, 0), "interactive_switch_buffer", 25, "Interactively switch to an open buffer.", 39, "w:\\4ed\\code\\4coder_lists.cpp", 28, 730 }, { PROC_LINKS(kill_buffer, 0), "kill_buffer", 11, "Kills the current buffer.", 25, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1543 }, { PROC_LINKS(left_adjust_view, 0), "left_adjust_view", 16, "Sets the left size of the view near the x position of the cursor.", 65, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 136 }, @@ -355,7 +355,7 @@ static Command_Metadata fcoder_metacmd_table[216] = { { PROC_LINKS(newline_or_goto_position_sticky, 0), "newline_or_goto_position_sticky", 31, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor.", 106, "w:\\4ed\\code\\4coder_jump_sticky.cpp", 34, 573 }, { PROC_LINKS(open_all_code, 0), "open_all_code", 13, "Open all code in the current directory. File types are determined by extensions. An extension is considered code based on the extensions specified in 4coder.config.", 164, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1067 }, { PROC_LINKS(open_all_code_recursive, 0), "open_all_code_recursive", 23, "Works as open_all_code but also runs in all subdirectories.", 59, "w:\\4ed\\code\\4coder_project_commands.cpp", 39, 1074 }, -{ PROC_LINKS(open_color_tweaker, 0), "open_color_tweaker", 18, "Opens the 4coder theme selector list.", 37, "w:\\4ed\\code\\4coder_lists.cpp", 28, 897 }, +{ PROC_LINKS(open_color_tweaker, 0), "open_color_tweaker", 18, "Opens the 4coder theme selector list.", 37, "w:\\4ed\\code\\4coder_lists.cpp", 28, 898 }, { PROC_LINKS(open_file_in_quotes, 0), "open_file_in_quotes", 19, "Reads a filename from surrounding '\"' characters and attempts to open the corresponding file.", 94, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1450 }, { PROC_LINKS(open_in_other, 0), "open_in_other", 13, "Interactively opens a file in the other panel.", 46, "w:\\4ed\\code\\4coder_base_commands.cpp", 36, 1601 }, { PROC_LINKS(open_long_braces, 0), "open_long_braces", 16, "At the cursor, insert a '{' and '}' separated by a blank line.", 62, "w:\\4ed\\code\\4coder_combined_write_commands.cpp", 46, 57 }, diff --git a/4coder_lists.cpp b/4coder_lists.cpp index 41c7987b..f9881613 100644 --- a/4coder_lists.cpp +++ b/4coder_lists.cpp @@ -769,8 +769,9 @@ activate_open_or_new__generic(Application_Links *app, View_Summary *view, Partition *scratch = &global_part; Temp_Memory temp = begin_temp_memory(scratch); String full_file_name = get_hot_directory(app, scratch); - if (full_file_name.str[full_file_name.size - 1] != '/' && - full_file_name.str[full_file_name.size - 1] != '\\'){ + if (full_file_name.size == 0 || + (full_file_name.str[full_file_name.size - 1] != '/' && + full_file_name.str[full_file_name.size - 1] != '\\')){ full_file_name = build_string(scratch, full_file_name, "/", file_name); } else{ diff --git a/4ed.cpp b/4ed.cpp index 1defc37c..b45a2901 100644 --- a/4ed.cpp +++ b/4ed.cpp @@ -1213,6 +1213,7 @@ App_Step_Sig(app_step){ } // NOTE(allen): prepare input information + b32 has_keyboard_event = (input->keys.count > 0); { if (models->input_filter != 0){ models->input_filter(&input->mouse); @@ -1693,7 +1694,7 @@ App_Step_Sig(app_step){ case APP_STATE_RESIZING: { - if (key_data.count > 0){ + if (has_keyboard_event){ vars->state = APP_STATE_EDIT; } }break; diff --git a/todo.txt b/todo.txt index 1109d244..e94855fa 100644 --- a/todo.txt +++ b/todo.txt @@ -11,9 +11,8 @@ Bugs { [x] Crash when freeing marker object without visuals - [x] High CPU usage in listers - [] Panel resizing doesn't work - [] Double free crash for markers object (not invaliding managed objects correctly?) + [x] High CPU usage in listers (endless animation bug) + [x] Panel resizing doesn't work [] Notepad like mode clicking to new view doesn't snap the mark [] Notepad like mode replacing text with cursor at end of selection in middle of long file [] Tab when no valid completions in open file lister