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 b1ebf2e0..e566bf90 100644 Binary files a/vc120.pdb and b/vc120.pdb differ