master
Allen Webster 2016-02-21 21:45:41 -05:00
parent ca72d0f1e0
commit 46aaa4ac5b
6 changed files with 65 additions and 74 deletions

View File

@ -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;
}

View File

@ -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).

View File

@ -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);

View File

@ -3,7 +3,7 @@
*
* 16.11.2014
*
* Win32-US Keyboard layer for 4coder
* Keyboard layer for 4coder
*
*/

View File

@ -7,11 +7,11 @@ 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
SET EXPORTS=/EXPORT:get_bindings
cl %WARNINGS% %STUFF% %DEBUG% 4coder_custom.cpp /Fe4coder_custom /LD /link /INCREMENTAL:NO /OPT:REF %EXPORTS%
REM more spammation preventation
REM file spammation preventation
del *.exp
del *.obj
del *.lib

BIN
vc120.pdb

Binary file not shown.