SDL_Window *SDLWindow; SDL_GLContext SDL_WindowGLContext; SDL_Cursor *SDL_MouseCursor; SDL_SystemCursor SDL_MouseCursorLastID; bool IsInFullscreen; int FullScreenSizeX, FullScreenSizeY; int FullScreenPositionX, FullScreenPositionY; bool AppIsRunning = true; bool WaitForEventsState = true; bool RunGCThisFrame; bool SearchCaseSensitive = false; bool SearchWordBoundary = false; bool BreakOnError = false; Int ErrorCount; bool DebugTraceBufferInits = false; bool Testing = false; Allocator SysAllocator = {SystemAllocatorProc}; float DPIScale = 1.0f; // @WARNING: be careful about using this, should only be used for debugging // the problem with this is that we want events to be reproducible. // We eat as many events as we can in a frame, we abstract the frame and so on. // Dont use it Int FrameID; WindowID WindowIDs; ViewID ViewIDs; Int BufferIDs; Array Windows; Array Views; Array Buffers; View *LogView; Buffer *LogBuffer; // Replace with ref to null buffer? BufferID NullBufferID; ViewID NullViewID; WindowID NullWindowID; #if PLUGIN_SEARCH_WINDOW WindowID SearchWindowID; ViewID SearchViewID; BufferID SearchBufferID; #endif Trigger *EscapeKey; Trigger *EnterKey; Trigger *OpenKeySet; Trigger *EnterOrEscapeKeySet; Trigger *AltEnterKeySet; Trigger *ShiftEnterKeySet; WindowID NextActiveWindowID; WindowID ActiveWindowID; WindowID PrimaryWindowID; WindowID ScrollbarSelected = {-1}; WindowID DocumentSelected = {-1}; WindowID ResizerSelected = {-1}; WindowID ResizerHover = {-1}; Caret DocumentAnchor; Vec2I MouseMiddleAnchor; RandomSeed UniqueBufferNameSeed = {}; Array EventPlayback; Array MacroPlayback; bool RecordingMacro = false; BlockArena Perm; // clipboard BlockArena ClipboardArena; String16 SavedClipboardString; Array SavedClipboardCarets = {SysAllocator}; struct InternTable { HashTable strings; // general allocator BlockArena arena; }; String Intern(InternTable *table, String string) { String *value = table->strings.get(string); if (!value) { String copy = Copy(table->arena, string); table->strings.put(copy, copy); return copy; } return *value; } // We use the intern table to optimize for space, I don't want to worry about freeing // buffer names and event text data so let it all accumulate and interning will at least // optimize worst offenders (like event text) InternTable GlobalInternTable; Array GlobalCommands; Array TestFunctions; Array Variables; Array ActiveProcesses = {}; Array ProcessEnviroment = {}; struct CCtx { mco_coro *co; String name; BlockArena arena; bool dont_wait_until_resolved; void *user_ctx; }; Array ActiveCoroutines; Color GruvboxDark0Hard = {0x1d, 0x20, 0x21, 0xff}; Color GruvboxDark0 = {0x28, 0x28, 0x28, 0xff}; Color GruvboxDark0Soft = {0x32, 0x30, 0x2f, 0xff}; Color GruvboxDark1 = {0x3c, 0x38, 0x36, 0xff}; Color GruvboxDark2 = {0x50, 0x49, 0x45, 0xff}; Color GruvboxDark3 = {0x66, 0x5c, 0x54, 0xff}; Color GruvboxDark4 = {0x7c, 0x6f, 0x64, 0xff}; Color GruvboxGray245 = {0x92, 0x83, 0x74, 0xff}; Color GruvboxGray244 = {0x92, 0x83, 0x74, 0xff}; Color GruvboxLight0Hard = {0xf9, 0xf5, 0xd7, 0xff}; Color GruvboxLight0 = {0xfb, 0xf1, 0xc7, 0xff}; Color GruvboxLight0Soft = {0xf2, 0xe5, 0xbc, 0xff}; Color GruvboxLight1 = {0xeb, 0xdb, 0xb2, 0xff}; Color GruvboxLight2 = {0xd5, 0xc4, 0xa1, 0xff}; Color GruvboxLight3 = {0xbd, 0xae, 0x93, 0xff}; Color GruvboxLight4 = {0xa8, 0x99, 0x84, 0xff}; Color GruvboxBrightRed = {0xfb, 0x49, 0x34, 0xff}; Color GruvboxBrightGreen = {0xb8, 0xbb, 0x26, 0xff}; Color GruvboxBrightYellow = {0xfa, 0xbd, 0x2f, 0xff}; Color GruvboxBrightBlue = {0x83, 0xa5, 0x98, 0xff}; Color GruvboxBrightPurple = {0xd3, 0x86, 0x9b, 0xff}; Color GruvboxBrightAqua = {0x8e, 0xc0, 0x7c, 0xff}; Color GruvboxBrightOrange = {0xfe, 0x80, 0x19, 0xff}; Color GruvboxNeutralRed = {0xcc, 0x24, 0x1d, 0xff}; Color GruvboxNeutralGreen = {0x98, 0x97, 0x1a, 0xff}; Color GruvboxNeutralYellow = {0xd7, 0x99, 0x21, 0xff}; Color GruvboxNeutralBlue = {0x45, 0x85, 0x88, 0xff}; Color GruvboxNeutralPurple = {0xb1, 0x62, 0x86, 0xff}; Color GruvboxNeutralAqua = {0x68, 0x9d, 0x6a, 0xff}; Color GruvboxNeutralOrange = {0xd6, 0x5d, 0x0e, 0xff}; Color GruvboxFadedRed = {0x9d, 0x00, 0x06, 0xff}; Color GruvboxFadedGreen = {0x79, 0x74, 0x0e, 0xff}; Color GruvboxFadedYellow = {0xb5, 0x76, 0x14, 0xff}; Color GruvboxFadedBlue = {0x07, 0x66, 0x78, 0xff}; Color GruvboxFadedPurple = {0x8f, 0x3f, 0x71, 0xff}; Color GruvboxFadedAqua = {0x42, 0x7b, 0x58, 0xff}; Color GruvboxFadedOrange = {0xaf, 0x3a, 0x03, 0xff}; RegisterVariable(Color, TextColor, GruvboxDark0Hard); RegisterVariable(Color, BackgroundColor, GruvboxLight0Hard); RegisterVariable(Color, InactiveWindowColor, {0x00, 0x00, 0x00, 0x1F}); RegisterVariable(Color, LineNumberTextColor, GruvboxDark4); RegisterVariable(Color, LineHighlightColor, GruvboxLight0Soft); RegisterVariable(Color, PrimaryCaretColor, GruvboxDark0Hard); RegisterVariable(Color, SecondaryCaretColor, GruvboxGray245); RegisterVariable(Color, SelectionColor, GruvboxLight1); RegisterVariable(Color, SelectedWhitespaceColor, GruvboxLight4); RegisterVariable(Color, MouseUnderlineColor, GruvboxDark0Hard); RegisterVariable(Color, CaretUnderlineColor, GruvboxGray245); RegisterVariable(Color, ScrollbarBackgroundColor, GruvboxLight2); RegisterVariable(Color, ScrollerColor, GruvboxLight1); RegisterVariable(Color, ScrollerSelectedColor, GruvboxLight0Hard); RegisterVariable(Color, SecondaryWindowStyle_TextColor, GruvboxDark0Hard); RegisterVariable(Color, SecondaryWindowStyle_BackgroundColor, GruvboxLight0Hard); RegisterVariable(Color, SecondaryWindowStyle_SelectionColor, GruvboxLight3); RegisterVariable(Color, SecondaryWindowStyle_LineHighlightColor, GruvboxLight0Soft); RegisterVariable(Color, SecondaryWindowStyle_OutlineColor, GruvboxLight3); RegisterVariable(Color, ResizerBackgroundColor, GruvboxLight0Hard); RegisterVariable(Color, ResizerOutlineColor, GruvboxLight3); RegisterVariable(Int, WaitForEvents, 1); RegisterVariable(Int, DrawLineNumbers, 1); RegisterVariable(Int, DrawScrollbar, 1); RegisterVariable(Int, IndentSize, 4); RegisterVariable(Int, FontSize, 15); RegisterVariable(String, PathToFont, ""); RegisterVariable(Float, UndoMergeTime, 0.3); RegisterVariable(Float, JumpHistoryMergeTime, 0.3); RegisterVariable(String, InternetBrowser, "firefox"); RegisterVariable(String, OpenCodePatterns, ".c .h .cpp .hpp .cc .cxx .rs .go .zig .py .lua .js .ts .jsx .tsx .java .kt .swift .cs .rb .php .html .css .scss .bat .sh .bash .zsh .sql .asm .s .cmake .make .json .yaml .toml .ini .txt .md .rst .Makefile .Dockerfile .gitignore .bashrc .zshrc"); RegisterVariable(String, OpenCodeExcludePatterns, ""); RegisterVariable(Int, TrimTrailingWhitespace, 1); RegisterVariable(String, HomeFolder, ""); RegisterVariable(String, ConfigFolder, ""); // PROJECT_MANAGEMENT // Set at the beginning of the program to current directory RegisterVariable(String, ProjectFolder, ""); // PLUGIN_BUILD_WINDOW RegisterVariable(String, Build1OnWindows, "build.bat"); RegisterVariable(String, Build1OnUnix, "sh build.sh"); RegisterVariable(String, Build2OnWindows, "build.bat release"); RegisterVariable(String, Build2OnUnix, "sh build.sh release"); RegisterVariable(String, Build3OnWindows, "build.bat slow"); RegisterVariable(String, Build3OnUnix, "sh build.sh slow"); RegisterVariable(String, Build4OnWindows, "build.bat"); RegisterVariable(String, Build4OnUnix, "sh build.sh"); // PLUGIN_LOAD_VCVARS RegisterVariable(String, VCVarsPath, "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Auxiliary/Build/vcvars64.bat"); // PLUGIN_REMEDYBG RegisterVariable(String, BinaryUnderDebug, ""); RegisterVariable(String, RemedyBGPath, "remedybg.exe");