From 5c8d7d8ccb55cfb085d51c62c05f7b013116498e Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Fri, 6 May 2016 12:45:50 -0400 Subject: [PATCH] changes to custom file organization --- 4coder_custom.cpp | 33 --------------- 4coder_default_bindings.cpp | 4 +- ..._default.cpp => 4coder_default_include.cpp | 0 build_all.bat | 2 +- buildsuper.bat | 2 +- power/4coder_casey.cpp | 42 +------------------ win32_4ed.cpp | 2 +- 7 files changed, 7 insertions(+), 78 deletions(-) delete mode 100644 4coder_custom.cpp rename 4coder_default.cpp => 4coder_default_include.cpp (100%) diff --git a/4coder_custom.cpp b/4coder_custom.cpp deleted file mode 100644 index aa482ff0..00000000 --- a/4coder_custom.cpp +++ /dev/null @@ -1,33 +0,0 @@ -// Delete CustomCurrent to define your own customizations or -// set it to one of the preexisting options -#define Custom_Current Custom_Default - -#define Custom_Default 1 - -// The following customization schemes are power users only: -#define Custom_HandmadeHero 2 - - -// TOP - -#if Custom_Current == Custom_Default -# include "4coder_default_bindings.cpp" -#elif Custom_Current == Custom_HandmadeHero -# include "power/4coder_casey.cpp" -#endif - -extern "C" GET_BINDING_DATA(get_bindings){ - Bind_Helper context_actual = begin_bind_helper(data, size); - Bind_Helper *context = &context_actual; - -#if Custom_Current == Custom_Default - default_get_bindings(context, true); -#elif Custom_Current == Custom_HandmadeHero - casey_get_bindings(context); -#endif - - end_bind_helper(context); - return context->write_total; -} - -// BOTTOM diff --git a/4coder_default_bindings.cpp b/4coder_default_bindings.cpp index 8515e9fa..da6e24d3 100644 --- a/4coder_default_bindings.cpp +++ b/4coder_default_bindings.cpp @@ -1,7 +1,7 @@ // TOP -#include "4coder_default.cpp" +#include "4coder_default_include.cpp" unsigned char blink_t = 0; @@ -265,7 +265,7 @@ CUSTOM_COMMAND_SIG(ruin_theme){ app->set_theme_colors(app, colors, count); } -void default_get_bindings(Bind_Helper *context, int set_hooks){ +void get_bindings(Bind_Helper *context, int set_hooks){ // NOTE(allen|a3.1): Hooks have no loyalties to maps. All hooks are global // and once set they always apply, regardless of what map is active. if (set_hooks){ diff --git a/4coder_default.cpp b/4coder_default_include.cpp similarity index 100% rename from 4coder_default.cpp rename to 4coder_default_include.cpp diff --git a/build_all.bat b/build_all.bat index 296fc1a9..85a0b403 100644 --- a/build_all.bat +++ b/build_all.bat @@ -15,7 +15,7 @@ pushd ..\code popd pushd ..\build -call "..\code\buildsuper.bat" ..\code\4coder_custom.cpp +call "..\code\buildsuper.bat" ..\code\4coder_default_bindings.cpp set EXPORTS=/EXPORT:app_get_functions cl %OPTS% %INCLUDES% %DEFINES% ..\code\4ed_app_target.cpp %* /Fe4ed_app /LD /link /INCREMENTAL:NO /OPT:REF %EXPORTS% diff --git a/buildsuper.bat b/buildsuper.bat index 497ab7a7..55a28b03 100644 --- a/buildsuper.bat +++ b/buildsuper.bat @@ -5,7 +5,7 @@ IF NOT DEFINED clset (call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\ SET clset=64 SET SRC=%1 -if "%SRC%" == "" SET SRC=4coder_custom.cpp +if "%SRC%" == "" SET SRC=4coder_default_bindings.cpp SET OPTS=/W4 /wd4310 /wd4100 /wd4201 /wd4505 /wd4996 /wd4127 /wd4510 /wd4512 /wd4610 /WX SET OPTS=%OPTS% /GR- /nologo diff --git a/power/4coder_casey.cpp b/power/4coder_casey.cpp index 49fcf981..e14f5023 100644 --- a/power/4coder_casey.cpp +++ b/power/4coder_casey.cpp @@ -11,42 +11,6 @@ merchantability, fitness for a particular purpose, or non-infringement. */ -/* NOTE(allen): Should be fixed now - - Need file limit to be substantially higher than 128 (65536?) - ~ file limit is now over 8 million - - - Font size is too big - ~ -f N option on command line, default N = 16 - - - Asking for a buffer to be saved if you have not modified the buffer should not save the - buffer, or perhaps more "safely", it should diff the buffer against the existing on-disk - contents and only save if there is a detected change between them. - - - Search: - - Needs to be case-insensitive, or at least have the option to be - - Needs to replace using the case of the thing being replaced, or at least have the option to do so - - - Bug with opening too many files where it simply no longer can switch to a buffer at all? - ~ I assume this refers to a file limit issue, if not then maybe it's not actually fixed. - - - Bug where opening the same buffer with open-file leads to a confusing situation - where you don't know what you're editing or something?? - - - Bug where replacing v4 with rectangle2 only replaces some instances??? - ~ For the interested programmer: the range recomputation wasn't working right so it was always - using the original range from cursor to mark. So if the string gets too long later occurances of - v4 get pushed outside of the range. - - - Bug in search where extra backspaces after there are no characters yet "remembers" - how many you hit and then eats that many real characters you type? - - - Some way to recenter the view so that the line containing the cursor becomes the - center line vertically. - ~ cmdid_center_view - - - Have buffers normalize slashes to always be forward-slash - right now I'm doing this manually -*/ - /* TODO(casey): Here are our current issues - High priority: @@ -109,7 +73,7 @@ #include #include -#include "..\4coder_default.cpp" +#include "..\4coder_default_includes.cpp" enum maps{ my_code_map @@ -1407,13 +1371,11 @@ HOOK_SIG(casey_start) } void -casey_get_bindings(Bind_Helper *context) +get_bindings(Bind_Helper *context) { set_hook(context, hook_start, casey_start); set_hook(context, hook_open_file, casey_file_settings); -// TODO(casey): re-enable my scroll once the view_id bug is fixed set_scroll_rule(context, casey_smooth_scroll_rule); -// set_scroll_rule(context, smooth_scroll_rule); EnumWindows(win32_find_4coder_window, 0); diff --git a/win32_4ed.cpp b/win32_4ed.cpp index 36250771..d1e0f7c2 100644 --- a/win32_4ed.cpp +++ b/win32_4ed.cpp @@ -26,7 +26,7 @@ #include -#include "4coder_custom.cpp" +#include "4coder_default_bindings.cpp" #undef exec_command #undef exec_command_keep_stack