From 46aaa4ac5bf5e0e3195f3dbfe9ccb3d3b470d238 Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Sun, 21 Feb 2016 21:45:41 -0500 Subject: [PATCH] 4.3.1 --- 4coder_custom.cpp | 30 ++++++-------------- 4coder_custom.h | 4 ++- 4ed.cpp | 1 + 4ed_keyboard.cpp | 70 +++++++++++++++++++++++----------------------- buildsuper.bat | 34 +++++++++++----------- vc120.pdb | Bin 102400 -> 102400 bytes 6 files changed, 65 insertions(+), 74 deletions(-) diff --git a/4coder_custom.cpp b/4coder_custom.cpp index 68bfdea9..bef35e1c 100644 --- a/4coder_custom.cpp +++ b/4coder_custom.cpp @@ -21,9 +21,6 @@ enum My_Maps{ }; HOOK_SIG(my_start){ - exec_command(cmd_context, cmdid_open_panel_hsplit); - exec_command(cmd_context, cmdid_change_active_panel); - exec_command(cmd_context, cmdid_open_panel_vsplit); exec_command(cmd_context, cmdid_change_active_panel); } @@ -149,9 +146,16 @@ CUSTOM_COMMAND_SIG(build_search){ push_parameter(app, cmd_context, par_cli_path, dir.str, dir.size); if (append(&dir, "build")){ +#if 1 + // NOTE(allen): This version avoids an unecessary copy, both equivalents are + // included to demonstrate how using push_parameter without the helper looks. app->push_parameter(cmd_context, dynamic_int(par_cli_command), dynamic_string(dir.str, dir.size)); +#else + push_parameter(cmd_context, par_cli_command, dir.str, dir.size); +#endif + exec_command(cmd_context, cmdid_build); } else{ @@ -174,7 +178,7 @@ CUSTOM_COMMAND_SIG(write_and_auto_tab){ exec_command(cmd_context, cmdid_auto_tab_line_at_cursor); } -// NOTE(allen|a3.4): How one might go about writing things like cut_line +// NOTE(allen|a3.4.1): How one might go about writing things like cut_line // same idea works for cut word and other such composite commands. CUSTOM_COMMAND_SIG(cut_line){ exec_command(cmd_context, cmdid_seek_beginning_of_line); @@ -237,6 +241,7 @@ extern "C" GET_BINDING_DATA(get_bindings){ bind_me(context, ')', MDFR_NONE, write_and_auto_tab); bind_me(context, ']', MDFR_NONE, write_and_auto_tab); bind_me(context, ';', MDFR_NONE, write_and_auto_tab); + bind_me(context, '#', MDFR_NONE, write_and_auto_tab); bind(context, '\t', MDFR_NONE, cmdid_word_complete); bind(context, '\t', MDFR_CTRL, cmdid_auto_tab_range); @@ -292,8 +297,6 @@ extern "C" GET_BINDING_DATA(get_bindings){ bind(context, '?', MDFR_CTRL, cmdid_toggle_show_whitespace); bind(context, '~', MDFR_CTRL, cmdid_clean_all_lines); - // NOTE(allen|a3.2): These now only set the mode of the file for writing to disk - // they do no longer effect the internal representation. bind(context, '1', MDFR_CTRL, cmdid_eol_dosify); bind(context, '!', MDFR_CTRL, cmdid_eol_nixify); @@ -312,19 +315,4 @@ extern "C" GET_BINDING_DATA(get_bindings){ return context->write_total; } -inline void -strset_(char *dst, char *src){ - do{ - *dst++ = *src++; - }while (*src); -} - -#define strset(d,s) if (sizeof(s) <= sizeof(d)) strset_(d,s) - -extern "C" SET_EXTRA_FONT_SIG(set_extra_font){ - strset(font_out->file_name, "liberation-mono.ttf"); - strset(font_out->font_name, "BIG"); - font_out->size = 25; -} - diff --git a/4coder_custom.h b/4coder_custom.h index 084cb646..01e54696 100644 --- a/4coder_custom.h +++ b/4coder_custom.h @@ -218,7 +218,8 @@ struct Extra_Font{ struct Buffer_Summary{ // NOTE(allen): None of these members nor any of the data pointed to - // by these members should be modified. + // by these members should be modified, I would have made them const... + // but that actually causes problems for C++ reasons. int file_id; int size; @@ -303,6 +304,7 @@ enum Binding_Unit_Type{ enum Map_ID{ mapid_global = (1 << 24), mapid_file, + // NOTE(allen): mapid_nomap will remain empty even if you attempt to fill it // it is for setting a map's parent to nothing, in cases where you don't want // to inherit from global (which is the default). diff --git a/4ed.cpp b/4ed.cpp index 2b9d4251..f22d66b1 100644 --- a/4ed.cpp +++ b/4ed.cpp @@ -2192,6 +2192,7 @@ setup_file_commands(Command_Map *commands, Partition *part, Key_Codes *codes, Co map_add(commands, ')', MDFR_NONE, compose_write_auto_tab_line); map_add(commands, ']', MDFR_NONE, compose_write_auto_tab_line); map_add(commands, ';', MDFR_NONE, compose_write_auto_tab_line); + map_add(commands, '#', MDFR_NONE, compose_write_auto_tab_line); map_add(commands, '\t', MDFR_NONE, command_word_complete); map_add(commands, '\t', MDFR_CTRL, command_auto_tab_range); diff --git a/4ed_keyboard.cpp b/4ed_keyboard.cpp index 39e129db..2db8ccd7 100644 --- a/4ed_keyboard.cpp +++ b/4ed_keyboard.cpp @@ -1,35 +1,35 @@ -/* - * Mr. 4th Dimention - Allen Webster - * - * 16.11.2014 - * - * Win32-US Keyboard layer for 4coder - * - */ - -// TOP - -globalvar u8 keycode_lookup_table[255]; - -internal void -set_dynamic_key_names(Key_Codes *codes){ - u8 code = 1; - u8 *codes_array = (u8*)codes; - for (i32 i = 0; i < sizeof(*codes)/sizeof(codes->up);){ - switch (code){ - case '\n': code++; break; - case '\t': code++; break; - case 0x20: code = 0x7F; break; - default: - codes_array[i++] = code++; - } - } -} - -inline u8 -keycode_lookup(u8 system_code){ - return keycode_lookup_table[system_code]; -} - -// BOTTOM - +/* + * Mr. 4th Dimention - Allen Webster + * + * 16.11.2014 + * + * Keyboard layer for 4coder + * + */ + +// TOP + +globalvar u8 keycode_lookup_table[255]; + +internal void +set_dynamic_key_names(Key_Codes *codes){ + u8 code = 1; + u8 *codes_array = (u8*)codes; + for (i32 i = 0; i < sizeof(*codes)/sizeof(codes->up);){ + switch (code){ + case '\n': code++; break; + case '\t': code++; break; + case 0x20: code = 0x7F; break; + default: + codes_array[i++] = code++; + } + } +} + +inline u8 +keycode_lookup(u8 system_code){ + return keycode_lookup_table[system_code]; +} + +// BOTTOM + diff --git a/buildsuper.bat b/buildsuper.bat index 5554d22f..9f85c723 100644 --- a/buildsuper.bat +++ b/buildsuper.bat @@ -1,17 +1,17 @@ -@echo off - -REM this is here to prevent the spammation of PATH -IF NOT DEFINED clset (call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x64) -SET clset=64 - -SET WARNINGS=/W4 /wd4310 /wd4100 /wd4201 /wd4505 /wd4996 /wd4127 /wd4510 /wd4512 /wd4610 /WX -SET STUFF=/GR- /nologo -SET DEBUG=/Zi -SET EXPORTS=/EXPORT:get_bindings /EXPORT:set_extra_font - -cl %WARNINGS% %STUFF% %DEBUG% 4coder_custom.cpp /Fe4coder_custom /LD /link /INCREMENTAL:NO /OPT:REF %EXPORTS% - -REM more spammation preventation -del *.exp -del *.obj -del *.lib \ No newline at end of file +@echo off + +REM this is here to prevent the spammation of PATH +IF NOT DEFINED clset (call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x64) +SET clset=64 + +SET WARNINGS=/W4 /wd4310 /wd4100 /wd4201 /wd4505 /wd4996 /wd4127 /wd4510 /wd4512 /wd4610 /WX +SET STUFF=/GR- /nologo +SET DEBUG=/Zi +SET EXPORTS=/EXPORT:get_bindings + +cl %WARNINGS% %STUFF% %DEBUG% 4coder_custom.cpp /Fe4coder_custom /LD /link /INCREMENTAL:NO /OPT:REF %EXPORTS% + +REM file spammation preventation +del *.exp +del *.obj +del *.lib diff --git a/vc120.pdb b/vc120.pdb index b1ebf2e0f4f1b5d06ae9b6d23d2ade3ae4305897..e566bf90f3c0ad2bb4d4db4c493ec04d7d6f3d82 100644 GIT binary patch delta 340 zcmZozz}B#UZG#E726q|*!w&{mCI%pY(FssKjAl@9W!fCWy+(!c%4SXjZUJ5aQ3eJL zpoRce28J`66&>=Y)bla0iDe2fFt7o!6(a)!h+hWf+d}y@P`*8s-wfqDLis&Vz8jQ3 z2g-MV@)tn)-cbH`DBp&WVe_V-k6fD`EK!>56C}fUZ}Z$Bd){pVj7yl1`3j6Y0<0T> xnr=)NG+-3wJp%MK2y+0va%Q`s0po3cJkkz~*ZCQ*Z08JML=S=OiV2MO^#SRgJZS&` delta 200 zcmZozz}B#UZG#E7hD