some finishing touch ups 4.0.18

This commit is contained in:
Allen Webster 2017-03-30 11:18:16 -04:00
parent 8e4ed15957
commit 424bb2a52a
6 changed files with 30 additions and 15 deletions

View File

@ -482,16 +482,23 @@ CUSTOM_COMMAND_SIG(hide_scrollbar){
view_set_setting(app, &view, ViewSetting_ShowScrollbar, false); 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_Summary view = get_active_view(app, AccessAll);
view_set_setting(app, &view, ViewSetting_ShowFileBar, true); 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_Summary view = get_active_view(app, AccessAll);
view_set_setting(app, &view, ViewSetting_ShowFileBar, false); 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 //toggle_fullscreen can be used as a command
CUSTOM_COMMAND_SIG(toggle_line_wrap){ CUSTOM_COMMAND_SIG(toggle_line_wrap){

View File

@ -45,6 +45,7 @@ default_keys(Bind_Helper *context){
bind(context, 's', MDFR_ALT, show_scrollbar); bind(context, 's', MDFR_ALT, show_scrollbar);
bind(context, 'w', MDFR_ALT, hide_scrollbar); bind(context, 'w', MDFR_ALT, hide_scrollbar);
bind(context, 'b', MDFR_ALT, toggle_filebar);
bind(context, '@', MDFR_ALT, toggle_mouse); bind(context, '@', MDFR_ALT, toggle_mouse);
bind(context, key_page_up, MDFR_CTRL, toggle_fullscreen); bind(context, key_page_up, MDFR_CTRL, toggle_fullscreen);

View File

@ -820,14 +820,14 @@ default_4coder_side_by_side_panels(Application_Links *app){
hide_scrollbar(app); hide_scrollbar(app);
} }
if (!default_use_file_bars){ if (!default_use_file_bars){
hide_file_bar(app); hide_filebar(app);
} }
change_active_panel(app); change_active_panel(app);
if (!default_use_scrollbars){ if (!default_use_scrollbars){
hide_scrollbar(app); hide_scrollbar(app);
} }
if (!default_use_file_bars){ 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); hide_scrollbar(app);
} }
if (!default_use_file_bars){ if (!default_use_file_bars){
hide_file_bar(app); hide_filebar(app);
} }
} }

View File

@ -454,16 +454,17 @@ buffer_seek_range_camel_right(Application_Links *app, Buffer_Summary *buffer, in
stream.max_end = an_pos; stream.max_end = an_pos;
if (init_stream_chunk(&stream, app, buffer, pos, data_chunk, sizeof(data_chunk))){ 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; ++pos;
bool32 still_looping = 1; bool32 still_looping = false;
do{ do{
for (; pos < stream.end; ++pos){ for (; pos < stream.end; ++pos){
c = stream.data[pos]; c = stream.data[pos];
if (char_is_upper(c)){ if (char_is_upper(c) && char_is_lower_utf8(pc)){
goto double_break1; goto double_break1;
} }
pc = c;
} }
still_looping = forward_stream_chunk(&stream); still_looping = forward_stream_chunk(&stream);
}while(still_looping); }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; stream.min_start = an_pos+1;
if (init_stream_chunk(&stream, app, buffer, pos, data_chunk, sizeof(data_chunk))){ 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{ do{
for (; pos >= stream.start; --pos){ for (; pos >= stream.start; --pos){
c = stream.data[pos]; c = stream.data[pos];
if (char_is_upper(c)){ if (char_is_upper(c) && char_is_lower_utf8(pc)){
goto double_break1; goto double_break1;
} }
pc = c;
} }
still_looping = backward_stream_chunk(&stream); still_looping = backward_stream_chunk(&stream);
}while(still_looping); }while(still_looping);

View File

@ -10,9 +10,9 @@ Created 21.01.2017 (dd.mm.yyyy)
#define FTECH_DEFINES #define FTECH_DEFINES
#if defined(_MSC_VER) #if defined(_MSC_VER)
#define IS_MSVC 1 #define IS_CL
#elif __GNUC__ #elif __GNUC__
#define IS_GCC 1 #define IS_GCC
#else #else
#error unknown compiler #error unknown compiler
#endif #endif

View File

@ -15,7 +15,10 @@ By Allen Webster
// NOTE(allen): Compiler/OS cracking. // NOTE(allen): Compiler/OS cracking.
#if defined(_MSC_VER) #if defined(_MSC_VER)
# if !defined(IS_CL)
# define IS_CL # define IS_CL
# endif
# define snprintf _snprintf # define snprintf _snprintf
# if defined(_WIN32) # if defined(_WIN32)
@ -27,7 +30,9 @@ By Allen Webster
#elif defined(__GNUC__) || defined(__GNUG__) #elif defined(__GNUC__) || defined(__GNUG__)
# if !defined(IS_GCC)
# define IS_GCC # define IS_GCC
# endif
# if defined(__gnu_linux__) # if defined(__gnu_linux__)
# define IS_LINUX # define IS_LINUX