diff --git a/4coder_base_commands.cpp b/4coder_base_commands.cpp index 7bbb5498..81c0c25d 100644 --- a/4coder_base_commands.cpp +++ b/4coder_base_commands.cpp @@ -482,16 +482,23 @@ CUSTOM_COMMAND_SIG(hide_scrollbar){ view_set_setting(app, &view, ViewSetting_ShowScrollbar, false); } -CUSTOM_COMMAND_SIG(show_file_bar){ +CUSTOM_COMMAND_SIG(show_filebar){ View_Summary view = get_active_view(app, AccessAll); view_set_setting(app, &view, ViewSetting_ShowFileBar, true); } -CUSTOM_COMMAND_SIG(hide_file_bar){ +CUSTOM_COMMAND_SIG(hide_filebar){ View_Summary view = get_active_view(app, AccessAll); view_set_setting(app, &view, ViewSetting_ShowFileBar, false); } +CUSTOM_COMMAND_SIG(toggle_filebar){ + View_Summary view = get_active_view(app, AccessAll); + bool32 value; + view_get_setting(app, &view, ViewSetting_ShowFileBar, &value); + view_set_setting(app, &view, ViewSetting_ShowFileBar, !value); +} + //toggle_fullscreen can be used as a command CUSTOM_COMMAND_SIG(toggle_line_wrap){ diff --git a/4coder_default_bindings.cpp b/4coder_default_bindings.cpp index 794b1140..c0a4119c 100644 --- a/4coder_default_bindings.cpp +++ b/4coder_default_bindings.cpp @@ -45,6 +45,7 @@ default_keys(Bind_Helper *context){ bind(context, 's', MDFR_ALT, show_scrollbar); bind(context, 'w', MDFR_ALT, hide_scrollbar); + bind(context, 'b', MDFR_ALT, toggle_filebar); bind(context, '@', MDFR_ALT, toggle_mouse); bind(context, key_page_up, MDFR_CTRL, toggle_fullscreen); diff --git a/4coder_default_framework.h b/4coder_default_framework.h index 3e7d410a..a77d70b2 100644 --- a/4coder_default_framework.h +++ b/4coder_default_framework.h @@ -820,14 +820,14 @@ default_4coder_side_by_side_panels(Application_Links *app){ hide_scrollbar(app); } if (!default_use_file_bars){ - hide_file_bar(app); + hide_filebar(app); } change_active_panel(app); if (!default_use_scrollbars){ hide_scrollbar(app); } if (!default_use_file_bars){ - hide_file_bar(app); + hide_filebar(app); } } @@ -837,7 +837,7 @@ default_4coder_one_panel(Application_Links *app){ hide_scrollbar(app); } if (!default_use_file_bars){ - hide_file_bar(app); + hide_filebar(app); } } diff --git a/4coder_helper/4coder_long_seek.h b/4coder_helper/4coder_long_seek.h index a4ee690b..24de3b5c 100644 --- a/4coder_helper/4coder_long_seek.h +++ b/4coder_helper/4coder_long_seek.h @@ -454,16 +454,17 @@ buffer_seek_range_camel_right(Application_Links *app, Buffer_Summary *buffer, in stream.max_end = an_pos; if (init_stream_chunk(&stream, app, buffer, pos, data_chunk, sizeof(data_chunk))){ - uint8_t c = 0; + uint8_t c = 0, pc = stream.data[pos]; ++pos; - bool32 still_looping = 1; + bool32 still_looping = false; do{ for (; pos < stream.end; ++pos){ c = stream.data[pos]; - if (char_is_upper(c)){ + if (char_is_upper(c) && char_is_lower_utf8(pc)){ goto double_break1; } + pc = c; } still_looping = forward_stream_chunk(&stream); }while(still_looping); @@ -487,15 +488,16 @@ buffer_seek_range_camel_left(Application_Links *app, Buffer_Summary *buffer, int stream.min_start = an_pos+1; if (init_stream_chunk(&stream, app, buffer, pos, data_chunk, sizeof(data_chunk))){ - char c = 0; + char c = 0, pc = stream.data[pos]; - bool32 still_looping = 1; + bool32 still_looping = false; do{ for (; pos >= stream.start; --pos){ c = stream.data[pos]; - if (char_is_upper(c)){ + if (char_is_upper(c) && char_is_lower_utf8(pc)){ goto double_break1; } + pc = c; } still_looping = backward_stream_chunk(&stream); }while(still_looping); diff --git a/4tech_defines.h b/4tech_defines.h index 44241eb2..c100a969 100644 --- a/4tech_defines.h +++ b/4tech_defines.h @@ -10,9 +10,9 @@ Created 21.01.2017 (dd.mm.yyyy) #define FTECH_DEFINES #if defined(_MSC_VER) -#define IS_MSVC 1 +#define IS_CL #elif __GNUC__ -#define IS_GCC 1 +#define IS_GCC #else #error unknown compiler #endif diff --git a/meta/4tech_file_moving.h b/meta/4tech_file_moving.h index e1289c0c..267b988c 100644 --- a/meta/4tech_file_moving.h +++ b/meta/4tech_file_moving.h @@ -15,7 +15,10 @@ By Allen Webster // NOTE(allen): Compiler/OS cracking. #if defined(_MSC_VER) -# define IS_CL +# if !defined(IS_CL) +# define IS_CL +# endif + # define snprintf _snprintf # if defined(_WIN32) @@ -27,7 +30,9 @@ By Allen Webster #elif defined(__GNUC__) || defined(__GNUG__) -# define IS_GCC +# if !defined(IS_GCC) +# define IS_GCC +# endif # if defined(__gnu_linux__) # define IS_LINUX