diff --git a/src/plugin_basic_commands.cpp b/src/plugin_basic_commands.cpp index 31cdbfb..4c52923 100644 --- a/src/plugin_basic_commands.cpp +++ b/src/plugin_basic_commands.cpp @@ -1,3 +1,4 @@ +#if PLUGIN_BASIC_COMMANDS void CMD_Redo() { BSet active = GetBSet(ActiveWindowID); RedoEdit(active.buffer, &active.view->carets); @@ -270,4 +271,5 @@ void CMD_PlayMacro() { } For (MacroPlayback) Add(&EventPlayback, it); -} RegisterCommand(CMD_PlayMacro, "alt-m", "Start playing back a macro recording"); \ No newline at end of file +} RegisterCommand(CMD_PlayMacro, "alt-m", "Start playing back a macro recording"); +#endif \ No newline at end of file diff --git a/src/plugin_build_window.cpp b/src/plugin_build_window.cpp index 9012242..13027a9 100644 --- a/src/plugin_build_window.cpp +++ b/src/plugin_build_window.cpp @@ -1,3 +1,4 @@ +#if PLUGIN_BUILD_WINDOW WindowID BuildWindowID; ViewID BuildViewID; BufferID BuildBufferID; @@ -90,3 +91,4 @@ void CMD_ShowBuildWindow() { main.window->visible = false; } } RegisterCommand(CMD_ShowBuildWindow, "ctrl-grave", "Toggles visibility of the build window"); +#endif diff --git a/src/plugin_command_runner_window.cpp b/src/plugin_command_runner_window.cpp index 22876e3..53be199 100644 --- a/src/plugin_command_runner_window.cpp +++ b/src/plugin_command_runner_window.cpp @@ -1,3 +1,4 @@ +#if PLUGIN_COMMAND_RUNNER_WINDOW WindowID CommandRunnerWindowID; void CMD_ShowCommandRunner() { @@ -65,3 +66,4 @@ void InitCommandRunnerWindow() { window->jump_history = false; AddCommand(&view->commands, "Open", OpenKeySet, CMD_OpenForRunnerWindow); } +#endif // PLUGIN_COMMAND_RUNNER_WINDOW diff --git a/src/plugin_command_window.cpp b/src/plugin_command_window.cpp index 42ff191..a184941 100644 --- a/src/plugin_command_window.cpp +++ b/src/plugin_command_window.cpp @@ -1,3 +1,4 @@ +#if PLUGIN_COMMAND_WINDOW WindowID CommandWindowID; void CMD_ShowCommands() { @@ -84,3 +85,4 @@ void InitCommandWindow() { window->lose_focus_on_escape = true; window->jump_history = false; } +#endif // PLUGIN_COMMAND_WINDOW diff --git a/src/plugin_debug_window.cpp b/src/plugin_debug_window.cpp index 147fe9b..07783db 100644 --- a/src/plugin_debug_window.cpp +++ b/src/plugin_debug_window.cpp @@ -1,3 +1,4 @@ +#if PLUGIN_DEBUG_WINDOW WindowID DebugWindowID; ViewID DebugViewID; BufferID DebugBufferID; @@ -65,3 +66,4 @@ void CMD_ToggleDebug() { Window *window = GetWindow(DebugWindowID); window->visible = !window->visible; } RegisterCommand(CMD_ToggleDebug, "ctrl-0", "Open a floating window that might become useful for debugging"); +#endif // PLUGIN_DEBUG_WINDOW diff --git a/src/plugin_directory_navigation.cpp b/src/plugin_directory_navigation.cpp index ad98578..1395535 100644 --- a/src/plugin_directory_navigation.cpp +++ b/src/plugin_directory_navigation.cpp @@ -1,3 +1,4 @@ +#if PLUGIN_DIRECTORY_NAVIGATION // @todo: On save rename files, delete files it should apply the changes // Instead of toying with Reopen maybe it should actually detect changes in directory etc. on update @@ -203,4 +204,5 @@ void DestroyDirectoryWatcher(DirectoryWatcher *w) } #endif +#endif #endif \ No newline at end of file diff --git a/src/plugin_project_management.cpp b/src/plugin_project_management.cpp index a71cb85..b5448bc 100644 --- a/src/plugin_project_management.cpp +++ b/src/plugin_project_management.cpp @@ -1,3 +1,4 @@ +#if PLUGIN_PROJECT_MANAGEMENT void SetProjectFolder(String dir) { ProjectFolder = Intern(&GlobalInternTable, dir); Scratch scratch; @@ -134,4 +135,5 @@ void CO_CreateProject(mco_coro *co) { } CO_OpenCode(co); -} RegisterCoroutineCommand(CO_CreateProject, "", "Creates a project in current buffer directory with template files and all that, asks user for input etc."); \ No newline at end of file +} RegisterCoroutineCommand(CO_CreateProject, "", "Creates a project in current buffer directory with template files and all that, asks user for input etc."); +#endif \ No newline at end of file diff --git a/src/plugin_project_management.h b/src/plugin_project_management.h index 98e07f9..de11325 100644 --- a/src/plugin_project_management.h +++ b/src/plugin_project_management.h @@ -1 +1,3 @@ +#if PLUGIN_PROJECT_MANAGEMENT void SetProjectFolder(String name); +#endif diff --git a/src/plugin_record_events.cpp b/src/plugin_record_events.cpp index dfdca25..7df9d68 100644 --- a/src/plugin_record_events.cpp +++ b/src/plugin_record_events.cpp @@ -1,3 +1,4 @@ +#if PLUGIN_RECORD_EVENTS Buffer *EventBuffer; void Serialize(Buffer *buffer, String name, EventKind *kind) { @@ -67,4 +68,5 @@ void Serialize(Buffer *buffer, Event *e) { void CMD_CopyEvents() { SaveStringInClipboard(GetString(EventBuffer)); -} RegisterCommand(CMD_CopyEvents, "ctrl-shift-alt-j", "Copy all the events from the EventBuffer"); \ No newline at end of file +} RegisterCommand(CMD_CopyEvents, "ctrl-shift-alt-j", "Copy all the events from the EventBuffer"); +#endif \ No newline at end of file diff --git a/src/plugin_record_gc.cpp b/src/plugin_record_gc.cpp index 0015626..0c1847a 100644 --- a/src/plugin_record_gc.cpp +++ b/src/plugin_record_gc.cpp @@ -1 +1,3 @@ -Buffer *GCInfoBuffer; \ No newline at end of file +#if PLUGIN_RECORD_GC +Buffer *GCInfoBuffer; +#endif \ No newline at end of file diff --git a/src/plugin_search_open_buffers.cpp b/src/plugin_search_open_buffers.cpp index 1a6f9f3..6c9dd21 100644 --- a/src/plugin_search_open_buffers.cpp +++ b/src/plugin_search_open_buffers.cpp @@ -1,3 +1,4 @@ +#if PLUGIN_SEARCH_OPEN_BUFFERS struct SearchOpenBuffersParams { String16 needle; BufferID buffer; @@ -127,3 +128,4 @@ void CMD_SearchOpenBuffers() { } SelectRange(main.view, GetLineRangeWithoutNL(main.buffer, 0)); } RegisterCommand(CMD_SearchOpenBuffers, "ctrl-shift-f", "Interactive search over the entire project in a new buffer view"); +#endif diff --git a/src/plugin_search_window.cpp b/src/plugin_search_window.cpp index 5294492..9b466e9 100644 --- a/src/plugin_search_window.cpp +++ b/src/plugin_search_window.cpp @@ -1,3 +1,4 @@ +#if PLUGIN_SEARCH_WINDOW Int SearchBufferChangeID; void CMD_Search() { @@ -110,3 +111,4 @@ void UpdateSearchWindow() { } } } +#endif diff --git a/src/plugin_status_window.cpp b/src/plugin_status_window.cpp index c61a3df..3c90f37 100644 --- a/src/plugin_status_window.cpp +++ b/src/plugin_status_window.cpp @@ -1,3 +1,4 @@ +#if PLUGIN_STATUS_WINDOW WindowID StatusWindowID; void InitStatusWindow() { @@ -97,3 +98,4 @@ void UpdateStatusWindow() { SelectRange(title.view, MakeRange(0)); ResetHistory(title.buffer); } +#endif diff --git a/src/plugin_tests.cpp b/src/plugin_tests.cpp index 390f82d..fb4e8a2 100644 --- a/src/plugin_tests.cpp +++ b/src/plugin_tests.cpp @@ -1,6 +1,5 @@ #if PLUGIN_TESTS - void Wait(mco_coro *co) { {Event ev = {};ev.kind = EVENT_KIND_INVALID; Add(&EventPlayback, ev);} Event *event = NULL; @@ -120,4 +119,4 @@ Memes and stuff)FOO"; } RegisterCoroutineCommand(CO_RunTests, "", "Basic tests"); -#endif +#endif // PLUGIN_TESTS diff --git a/src/plugin_window_management.cpp b/src/plugin_window_management.cpp index d57c8e2..f724c67 100644 --- a/src/plugin_window_management.cpp +++ b/src/plugin_window_management.cpp @@ -1,3 +1,4 @@ +#if PLUGIN_WINDOW_MANAGEMENT void CMD_JumpPrev() { BSet main = GetBSet(PrimaryWindowID); JumpToLastValidView(main.window); @@ -80,3 +81,4 @@ void CMD_GotoPrevInList() { BSet main = GetBSet(PrimaryWindowID); GotoNextInList(main.window, -1); } RegisterCommand(CMD_GotoPrevInList, "alt-e | shift-f8", "For example: when jumping from build panel to build error, a jump point is setup, user can click this button to go over to the previous compiler error"); +#endif diff --git a/src/text_editor.cpp b/src/text_editor.cpp index 6953299..15794ad 100644 --- a/src/text_editor.cpp +++ b/src/text_editor.cpp @@ -73,8 +73,6 @@ #include "render_opengl.cpp" #define PLUGIN_CONFIG 1 -#define PLUGIN_SEARCH_WINDOW 1 -#define PLUGIN_PROJECT_MANAGEMENT 1 #define PLUGIN_WINDOW_MANAGEMENT 1 #define PLUGIN_DIRECTORY_NAVIGATION 1 #define PLUGIN_SEARCH_OPEN_BUFFERS 1 @@ -88,7 +86,6 @@ #define PLUGIN_DEBUG_WINDOW 1 #define PLUGIN_RECORD_GC 1 #define PLUGIN_RECORD_EVENTS 1 -#define PLUGIN_DIRECTORY_NAVIGATION 1 #define PLUGIN_LOAD_VCVARS OS_WINDOWS #define PLUGIN_REMEDYBG OS_WINDOWS #define PLUGIN_FILE_COMMANDS 1 @@ -987,6 +984,7 @@ int main(int argc, char **argv, char **envp) } #endif +#if PLUGIN_TESTS if (1) { RunArenaTest(); For (TestFunctions) { @@ -996,6 +994,7 @@ int main(int argc, char **argv, char **envp) // ReportErrorf("Testing DONE\n"); // return 0; } +#endif if (!SDL_Init(SDL_INIT_VIDEO)) { ReportErrorf("Couldn't initialize SDL! %s", SDL_GetError());