Compare commits

..

8 Commits

Author SHA1 Message Date
Krzosa Karol
20d71722ea GC temp buffers after they are 25th in history 2026-03-22 10:12:36 +01:00
Krzosa Karol
cf383c9772 Update todos 2026-03-22 10:12:18 +01:00
Krzosa Karol
82dceaca68 Missing include 2026-03-22 10:12:07 +01:00
Krzosa Karol
4f4940bcd3 Add memory usage in debug window 2026-03-22 10:11:25 +01:00
Krzosa Karol
aff3403404 Add macros 2026-03-21 17:09:40 +01:00
Krzosa Karol
b04b566681 Box mouse select 2026-03-21 16:57:19 +01:00
Krzosa Karol
aa85d9420a Fix tests 2026-03-21 16:57:07 +01:00
Krzosa Karol
4c21026842 CMD_OpenFileSystemBrowser 2026-03-21 16:56:36 +01:00
12 changed files with 188 additions and 277 deletions

View File

@@ -18,6 +18,8 @@ typedef void OSErrorReport(const char *, ...);
#include <poll.h> #include <poll.h>
#include <execinfo.h> #include <execinfo.h>
#include <backtrace.h> #include <backtrace.h>
#include <sys/resource.h>
API void (*Error)(const char *, ...); API void (*Error)(const char *, ...);

View File

@@ -80,7 +80,8 @@ void UpdateCoroutines(Event *event) {
#endif #endif
double took = GetTimeSeconds() - start; double took = GetTimeSeconds() - start;
if (took > (0.016666 / 3.0)) { bool dont_loop_on_coroutines_when_budget_is_ok_exit_immediately = Testing;
if (dont_loop_on_coroutines_when_budget_is_ok_exit_immediately || (took > (0.016666 / 3.0))) {
break; break;
} }
} }

View File

@@ -13,6 +13,7 @@ bool SearchWordBoundary = false;
bool BreakOnError = false; bool BreakOnError = false;
Int ErrorCount; Int ErrorCount;
bool DebugTraceBufferInits = false; bool DebugTraceBufferInits = false;
bool Testing = false;
Allocator SysAllocator = {SystemAllocatorProc}; Allocator SysAllocator = {SystemAllocatorProc};
float DPIScale = 1.0f; float DPIScale = 1.0f;
@@ -64,6 +65,8 @@ Vec2I MouseMiddleAnchor;
RandomSeed UniqueBufferNameSeed = {}; RandomSeed UniqueBufferNameSeed = {};
Array<Event> EventPlayback; Array<Event> EventPlayback;
Array<Event> MacroPlayback;
bool RecordingMacro = false;
BlockArena Perm; BlockArena Perm;
// clipboard // clipboard

View File

@@ -253,3 +253,21 @@ void CMD_ClearCarets() {
active.view->carets.len = 1; active.view->carets.len = 1;
active.view->carets[0] = MakeCaret(GetFront(active.view->carets[0])); active.view->carets[0] = MakeCaret(GetFront(active.view->carets[0]));
} RegisterCommand(CMD_ClearCarets, "escape", "Clear all carets and reset to 1 caret, also do some windowing stuff that closes things on escape"); } RegisterCommand(CMD_ClearCarets, "escape", "Clear all carets and reset to 1 caret, also do some windowing stuff that closes things on escape");
void CMD_ToggleMacroRecording() {
if (RecordingMacro) {
RecordingMacro = false;
Pop(&MacroPlayback); // Remove the ctrl-m from macro playback thing
} else {
RecordingMacro = true;
MacroPlayback.len = 0;
}
} RegisterCommand(CMD_ToggleMacroRecording, "ctrl-m", "Start recording a macro");
void CMD_PlayMacro() {
if (RecordingMacro) {
return;
}
For (MacroPlayback) Add(&EventPlayback, it);
} RegisterCommand(CMD_PlayMacro, "alt-m", "Start playing back a macro recording");

View File

@@ -48,7 +48,13 @@ void UpdateDebugWindow() {
return; return;
} }
RawReplaceText(set.buffer, GetRange(set.buffer), u"Active buffers and views:\n"); RawReplaceText(set.buffer, GetRange(set.buffer), u"");
#if OS_POSIX
struct rusage usage;
getrusage(RUSAGE_SELF, &usage);
RawAppendf(set.buffer, "MemoryUsage: %lld\n", usage.ru_maxrss);
#endif
For (Views) { For (Views) {
Buffer *buffer = GetBuffer(it->active_buffer); Buffer *buffer = GetBuffer(it->active_buffer);
RawAppendf(set.buffer, "view->id:%lld, buffer->id:%lld, buffer->name:%S\n", (long long)it->id.id, (long long)buffer->id.id, buffer->name); RawAppendf(set.buffer, "view->id:%lld, buffer->id:%lld, buffer->name:%S\n", (long long)it->id.id, (long long)buffer->id.id, buffer->name);

View File

@@ -8,6 +8,16 @@ void CMD_OpenUpFolder() {
Open(name); Open(name);
} RegisterCommand(CMD_OpenUpFolder, "ctrl-o", "Open current's file directory or up directory in other cases"); } RegisterCommand(CMD_OpenUpFolder, "ctrl-o", "Open current's file directory or up directory in other cases");
void CMD_OpenSystemFileBrowser() {
Scratch scratch;
String string = GetPrimaryDirectory();
#if OS_WINDOWS
Open(Format(scratch, "!!explorer %S", string));
#else
Open(Format(scratch, "!!xdg-open %S & disown", string));
#endif
} RegisterCommand(CMD_OpenSystemFileBrowser, "ctrl-alt-r", "Opens the directory of current file in the systems file browser");
void InsertDirectoryNavigation(Buffer *buffer) { void InsertDirectoryNavigation(Buffer *buffer) {
Assert(buffer->is_dir); Assert(buffer->is_dir);
Scratch scratch; Scratch scratch;

View File

@@ -15,6 +15,7 @@ void New(Window *window, String name = "") {
name = GetUniqueBufferName(dir, "new"); name = GetUniqueBufferName(dir, "new");
} }
WindowOpenBufferView(window, name); WindowOpenBufferView(window, name);
RunGCThisFrame = true;
} }
void CMD_New() { void CMD_New() {

View File

@@ -1,9 +1,10 @@
#if PLUGIN_TESTS #if PLUGIN_TESTS
bool Testing = false;
void Wait(mco_coro *co) { void Wait(mco_coro *co) {
Add(&EventPlayback, {EVENT_KIND_INVALID}); {Event ev = {};ev.kind = EVENT_KIND_INVALID; Add(&EventPlayback, ev);}
for (Event *event = Yield(co); event->kind != EVENT_KIND_INVALID; event = Yield(co)) { Event *event = NULL;
for (event = Yield(co); event->kind != EVENT_KIND_INVALID; event = Yield(co)) {
} }
} }
@@ -11,7 +12,6 @@ void Wait(mco_coro *co, int updates) {
for (int i = 0; i < updates; i += 1) { for (int i = 0; i < updates; i += 1) {
{Event ev = {};ev.kind = EVENT_UPDATE; Add(&EventPlayback, ev);} {Event ev = {};ev.kind = EVENT_UPDATE; Add(&EventPlayback, ev);}
} }
{Event ev = {};ev.kind = EVENT_KIND_INVALID; Add(&EventPlayback, ev);}
Wait(co); Wait(co);
} }
@@ -27,6 +27,7 @@ void OpenCloseCodeTest(mco_coro *co) {
void CO_RunTests(mco_coro *co) { void CO_RunTests(mco_coro *co) {
Testing = true; Testing = true;
WaitForEvents = false; WaitForEvents = false;
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_RETURN; ev.xwindow = 1412; ev.ywindow = 1032; ev.xmouse = 1234; ev.ymouse = 594; Add(&EventPlayback, ev);} {Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_RETURN; ev.xwindow = 1412; ev.ywindow = 1032; ev.xmouse = 1234; ev.ymouse = 594; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_RETURN; ev.xwindow = 1412; ev.ywindow = 1032; ev.xmouse = 1234; ev.ymouse = 594; Add(&EventPlayback, ev);} {Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_RETURN; ev.xwindow = 1412; ev.ywindow = 1032; ev.xmouse = 1234; ev.ymouse = 594; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_RETURN; ev.xwindow = 1412; ev.ywindow = 1032; ev.xmouse = 1234; ev.ymouse = 594; Add(&EventPlayback, ev);} {Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_RETURN; ev.xwindow = 1412; ev.ywindow = 1032; ev.xmouse = 1234; ev.ymouse = 594; Add(&EventPlayback, ev);}
@@ -54,6 +55,7 @@ void CO_RunTests(mco_coro *co) {
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1412; ev.ywindow = 1032; ev.xmouse = 1234; ev.ymouse = 594; ev.text = "f"; Add(&EventPlayback, ev);} {Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1412; ev.ywindow = 1032; ev.xmouse = 1234; ev.ymouse = 594; ev.text = "f"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1412; ev.ywindow = 1032; ev.xmouse = 1234; ev.ymouse = 594; ev.text = "f"; Add(&EventPlayback, ev);} {Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1412; ev.ywindow = 1032; ev.xmouse = 1234; ev.ymouse = 594; ev.text = "f"; Add(&EventPlayback, ev);}
Wait(co); Wait(co);
String16 result = uR"FOO( String16 result = uR"FOO(
@@ -65,211 +67,47 @@ Memes and stuff)FOO";
BSet set = GetBSet(PrimaryWindowID); BSet set = GetBSet(PrimaryWindowID);
Assert(AreEqual(result, GetString(set.buffer))); Assert(AreEqual(result, GetString(set.buffer)));
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_LSHIFT; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.shift = 1; Add(&EventPlayback, ev);} // Test the box selection
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.shift = 1; ev.text = "M"; Add(&EventPlayback, ev);} CMD_New();
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.text = "e"; Add(&EventPlayback, ev);} {Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_RETURN; ev.xwindow = 1412; ev.ywindow = 1032; ev.xmouse = 1234; ev.ymouse = 594; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.text = "m"; Add(&EventPlayback, ev);} {Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_RETURN; ev.xwindow = 1412; ev.ywindow = 1032; ev.xmouse = 1234; ev.ymouse = 594; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.text = "e"; Add(&EventPlayback, ev);} {Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_RETURN; ev.xwindow = 1412; ev.ywindow = 1032; ev.xmouse = 1234; ev.ymouse = 594; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.text = "s"; Add(&EventPlayback, ev);} {Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_RETURN; ev.xwindow = 1412; ev.ywindow = 1032; ev.xmouse = 1234; ev.ymouse = 594; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_LCTRL; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.ctrl = 1; Add(&EventPlayback, ev);} {Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_RETURN; ev.xwindow = 1412; ev.ywindow = 1032; ev.xmouse = 1234; ev.ymouse = 594; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_L; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.ctrl = 1; Add(&EventPlayback, ev);} {Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_RETURN; ev.xwindow = 1412; ev.ywindow = 1032; ev.xmouse = 1234; ev.ymouse = 594; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_C; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.ctrl = 1; Add(&EventPlayback, ev);} {Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_RETURN; ev.xwindow = 1412; ev.ywindow = 1032; ev.xmouse = 1234; ev.ymouse = 594; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_LCTRL; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.ctrl = 1; Add(&EventPlayback, ev);} {Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_LSHIFT; ev.xwindow = 1412; ev.ywindow = 1032; ev.xmouse = 1234; ev.ymouse = 594; ev.shift = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_RETURN; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.ctrl = 1; Add(&EventPlayback, ev);} {Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1412; ev.ywindow = 1032; ev.xmouse = 1234; ev.ymouse = 594; ev.shift = 1; ev.text = "M"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_V; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.ctrl = 1; Add(&EventPlayback, ev);} {Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1412; ev.ywindow = 1032; ev.xmouse = 1234; ev.ymouse = 594; ev.text = "e"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_RETURN; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.ctrl = 1; Add(&EventPlayback, ev);} {Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1412; ev.ywindow = 1032; ev.xmouse = 1234; ev.ymouse = 594; ev.text = "m"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_V; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.ctrl = 1; Add(&EventPlayback, ev);} {Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1412; ev.ywindow = 1032; ev.xmouse = 1234; ev.ymouse = 594; ev.text = "e"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_RETURN; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.ctrl = 1; Add(&EventPlayback, ev);} {Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1412; ev.ywindow = 1032; ev.xmouse = 1234; ev.ymouse = 594; ev.text = "s"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_V; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.ctrl = 1; Add(&EventPlayback, ev);} {Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_SPACE; ev.xwindow = 1412; ev.ywindow = 1032; ev.xmouse = 1234; ev.ymouse = 594; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_RETURN; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.ctrl = 1; Add(&EventPlayback, ev);} {Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1412; ev.ywindow = 1032; ev.xmouse = 1234; ev.ymouse = 594; ev.text = " "; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_V; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.ctrl = 1; Add(&EventPlayback, ev);} {Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_LSHIFT; ev.xwindow = 1412; ev.ywindow = 1032; ev.xmouse = 1234; ev.ymouse = 594; ev.shift = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_RETURN; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.ctrl = 1; Add(&EventPlayback, ev);} {Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1412; ev.ywindow = 1032; ev.xmouse = 1234; ev.ymouse = 594; ev.text = "a"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_V; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.ctrl = 1; Add(&EventPlayback, ev);} {Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1412; ev.ywindow = 1032; ev.xmouse = 1234; ev.ymouse = 594; ev.text = "n"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_RETURN; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.ctrl = 1; Add(&EventPlayback, ev);} {Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1412; ev.ywindow = 1032; ev.xmouse = 1234; ev.ymouse = 594; ev.text = "d"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_V; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.ctrl = 1; Add(&EventPlayback, ev);} {Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_SPACE; ev.xwindow = 1412; ev.ywindow = 1032; ev.xmouse = 1234; ev.ymouse = 594; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_RETURN; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.ctrl = 1; Add(&EventPlayback, ev);} {Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1412; ev.ywindow = 1032; ev.xmouse = 1234; ev.ymouse = 594; ev.text = " "; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_V; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.ctrl = 1; Add(&EventPlayback, ev);} {Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1412; ev.ywindow = 1032; ev.xmouse = 1234; ev.ymouse = 594; ev.text = "s"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_RETURN; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.ctrl = 1; Add(&EventPlayback, ev);} {Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1412; ev.ywindow = 1032; ev.xmouse = 1234; ev.ymouse = 594; ev.text = "t"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_V; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.ctrl = 1; Add(&EventPlayback, ev);} {Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1412; ev.ywindow = 1032; ev.xmouse = 1234; ev.ymouse = 594; ev.text = "u"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_LCTRL; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.ctrl = 1; Add(&EventPlayback, ev);} {Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1412; ev.ywindow = 1032; ev.xmouse = 1234; ev.ymouse = 594; ev.text = "f"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_RETURN; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; Add(&EventPlayback, ev);} {Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1412; ev.ywindow = 1032; ev.xmouse = 1234; ev.ymouse = 594; ev.text = "f"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_PAGEUP; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_RETURN; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_LALT; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.alt = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_LSHIFT; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.shift = 1; ev.alt = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_DOWN; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.shift = 1; ev.alt = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_DOWN; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.shift = 1; ev.alt = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_DOWN; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.shift = 1; ev.alt = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_DOWN; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.shift = 1; ev.alt = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_DOWN; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.shift = 1; ev.alt = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_DOWN; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.shift = 1; ev.alt = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_DOWN; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.shift = 1; ev.alt = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_DOWN; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.shift = 1; ev.alt = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_LCTRL; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.shift = 1; ev.ctrl = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_RIGHT; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.shift = 1; ev.ctrl = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_C; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.ctrl = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_RIGHT; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_SPACE; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.text = " "; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_LCTRL; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.ctrl = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_V; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.ctrl = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_LCTRL; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.ctrl = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_BACKSPACE; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.ctrl = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_LSHIFT; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.shift = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.shift = 1; ev.text = "T"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.text = "h"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.text = "i"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.text = "n"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.text = "g"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.text = "s"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_SPACE; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.text = " "; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_LCTRL; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.ctrl = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_V; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.ctrl = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_B; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.ctrl = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_SPACE; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.text = " "; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_LSHIFT; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.shift = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.shift = 1; ev.text = "A"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_BACKSPACE; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.shift = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_COMMA; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.shift = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.shift = 1; ev.text = "<"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_BACKSLASH; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.shift = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.shift = 1; ev.text = "|"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_LCTRL; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.ctrl = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_RETURN; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.ctrl = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_LCTRL; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.ctrl = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_V; ev.xwindow = 1920; ev.ywindow = 1061; ev.xmouse = 835; ev.ctrl = 1; Add(&EventPlayback, ev);}
Wait(co); Wait(co);
result = uR"FOO( result = uR"FOO(
Memes Things Memes <|
Memes
Memes Things Memes <|
Memes
Memes Things Memes <|
Memes
Memes Things Memes <|
Memes
Memes Things Memes <|
Memes
Memes Things Memes <|
Memes
Memes Things Memes <|
Memes
Memes Things Memes <|
Memes
Memes Things Memes <|
Memes
)FOO";
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_RETURN; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_LSHIFT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.shift = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.shift = 1; ev.text = "L"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "e"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "t"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_APOSTROPHE; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "'"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "s"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_SPACE; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = " "; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "t"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_BACKSPACE; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "d"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "o"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_SPACE; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = " "; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "t"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "h"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "i"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "s"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_UP; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_DOWN; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_BACKSPACE; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_END; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_PAGEDOWN; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_RETURN; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_LSHIFT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.shift = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.shift = 1; ev.text = "M"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "e"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "m"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "e"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "s"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_SPACE; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = " "; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "a"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "n"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "d"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_SPACE; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = " "; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "s"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "u"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_BACKSPACE; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "t"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "u"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "f"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "f"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_LALT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.alt = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_LSHIFT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.shift = 1; ev.alt = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_UP; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.shift = 1; ev.alt = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_SPACE; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = " "; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_LSHIFT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.shift = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_BACKSLASH; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.shift = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.shift = 1; ev.text = "|"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_LSHIFT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.shift = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_COMMA; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.shift = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.shift = 1; ev.text = "<"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_SPACE; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = " "; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_LSHIFT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.shift = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.shift = 1; ev.text = "T"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "h"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "i"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "n"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "g"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_SPACE; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = " "; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "t"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "h"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "i"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "n"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "g"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_RETURN; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "t"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "h"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "i"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "n"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "g"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_ESCAPE; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_UP; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_UP; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_LSHIFT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.shift = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_LCTRL; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.shift = 1; ev.ctrl = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_LEFT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.shift = 1; ev.ctrl = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_LSHIFT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.shift = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_LCTRL; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.shift = 1; ev.ctrl = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_L; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.shift = 1; ev.ctrl = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_BACKSPACE; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_LSHIFT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.shift = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.shift = 1; ev.text = "N"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "o"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_LSHIFT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.shift = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.shift = 1; ev.text = "T"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "h"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "i"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "n"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_TEXT_INPUT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.text = "g"; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_LSHIFT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.shift = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_LCTRL; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.shift = 1; ev.ctrl = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_LALT; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.shift = 1; ev.ctrl = 1; ev.alt = 1; Add(&EventPlayback, ev);}
{Event ev = {};ev.kind = EVENT_KEY_PRESS; ev.key = SDLK_J; ev.xwindow = 1920; ev.ywindow = 2121; ev.ymouse = 1289; ev.shift = 1; ev.ctrl = 1; ev.alt = 1; Add(&EventPlayback, ev);}
Wait(co);
result = uR"FOO(Let's do this |< NoThing NoThing
NoThing
Memes and stuff |< NoThing NoThing
NoThing)FOO";
Memes and stuff)FOO";
set = GetBSet(PrimaryWindowID);
Assert(AreEqual(result, GetString(set.buffer)));
if (ErrorCount != 0) { if (ErrorCount != 0) {
Scratch scratch; Scratch scratch;
String string = AllocCharString(scratch, LogBuffer); String string = AllocCharString(scratch, LogBuffer);

View File

@@ -1,72 +1,57 @@
/* /*
- [x] list_functions.sh and rg in general in the color mode is prinitng differently from terminal as well as output is truncated!
- [ ] Syntax for executing commands from root of project, or maybe commands should be executed from root of the CurrentDirectory and there should be a cd command instead of OpenProject ## Basics
- [ ] Fuzzy search over executed command ouput - [ ] Ctrl+Shift+ArrowDown at the end of buffer, doesn't capture characters on last line without new line, same at the top
- [ ] When inserting parenthesis and selection is there, put the parens on both sides? - [ ] When inserting parenthesis and selection is there, put the parens on both sides?
- [ ] KillProcess in console !!! - should also kill all the children ........... - [ ] I noticed WordComplete getting busted after using editor for a while and returning cutdown words but not sure how to repro ...
- [x] ctrl-e with these short main.c:290: breaks a little, need to first click ctrl-e and then alt-e to jump - [ ] Rewrite WordComplete to use CoroutineCreate, maybe try reducing globals to just the coroutine itself
- [ ] Use command window without special fuzzy search features to type commands and stuff for executing shell etc.. - [ ] WorkComplete, Bounded search, after a while it becomes problematic with many buffers
## Monaco like design for familiarity ## Monaco like design for familiarity
- [x] Ctrl+Alt+- and Ctrl+Shift+- Jump back, jump forward
- [x] ctrl-shift-l select all occurences of a string
- [ ] ctrl-tab - switch file lister with instant hold release semantics? - [ ] ctrl-tab - switch file lister with instant hold release semantics?
- [ ] SearchAndReplace how to do better? - [ ] SearchAndReplace how to do better?
- [ ] ctrl-alt-MouseClick should add a cursor instead of alt-MouseClick
- [ ] ctrl-t find workspace symbols? how can we do it? - [ ] ctrl-t find workspace symbols? how can we do it?
- [ ] ctrl-b what to do with this?
- [ ] ctrl-alt-r open containing folder (file explorer system)
- [ ] ctrl-alt-MouseMove should do a box select with multiple cursors thing
- [ ] Snippet design? - [ ] Snippet design?
## Refactor
- [ ] Make a platform layer and separate SDL stuff out - [ ] Make a platform layer and separate SDL stuff out
- [x] ReplaceAll - heap-use-after-free address, how to debug? I think would be nice to iterate all buffer ids and their addresses along with the state - [ ] Report a regression in SDL in newer versions that make it so that events are doubled when unpressing the held button
- [x] BRO, the caret teleports on linux when I press the arrow for too long
- [ ] Report SDL newest vs SDL previous version on wayland
- [ ] Ctrl+Shift+ArrowDown at the end of buffer, doesn't capture characters on last line without new line
- [ ] Remove -lbacktrace and add my backtrace library thing - [ ] Remove -lbacktrace and add my backtrace library thing
- [ ] Refactor build.sh to accept commands and remove build_web.sh - [ ] Refactor build.sh to accept commands and remove build_web.sh
- [ ] Cleanups
- [ ] How to enable framerate to be unlimited and not break scrolling?
- [x] When dragging a file into the editor, would be nice if the file opened in the window user dropped the file into. Not the active window.
- [ ] When 2 views of same buffer are open, the view with caret below the caret which modifies the view - starts moving and getting messed up
- [ ] Reduce number of created buffers to one per window, should be enough
- [ ] GetWindowZOrder to IterateWindowsInZOrder - [ ] GetWindowZOrder to IterateWindowsInZOrder
- [ ] Rework history API, tagging modification blocks with carets? - [ ] Investigate reworking history API, tagging modification blocks with carets?
- [ ] How to enable framerate to be unlimited and not break scrolling?
- [ ] When 2 views of same buffer are open, the view with caret below the caret which modifies the view - starts moving and getting messed up
- [ ] The lexing / parsing code for config / bindings appears sloppy would be nice to clean it up but I don't have any ideas - [ ] The lexing / parsing code for config / bindings appears sloppy would be nice to clean it up but I don't have any ideas
- [ ] Directory tree doesn't make much sense! Maybe just consolidate into one folder? create nice names - the raddbg idea didn't pan out well here - [ ] Redesign `:QueryFile`
## Features
- [ ] KillProcess in console !!! - should also kill all the children ...........
- [ ] BeginLog and EndLog, show all logs in the UI thing at the end
- [ ] Fuzzy search over executed command ouput
- [ ] Command window but for executing commands without special fuzzy stuff?
- [ ] Implement Regex and jumps using regex so as to allow for using ctags
- [ ] Add UndoKinds (SnapshotUndo, DiffUndo), I want to enable history in fuzzy search buffers without a huge memory cost
- [ ] General parser / data description thing, rewrite other parsers using this, rewrite env handling
- [ ] DirNav, update lister when files change on disk
- [ ] Investigate ways to bind "open" commands to keys from config
- [ ] Ability to access and set clipboard as well as affect selection in the open scripts
- [ ] Syntax for executing commands from root of project, or maybe commands should be executed from root of the CurrentDirectory
## Test
- [ ] Test BlockArena correctnsess - random allocations, writes and undos, try to crash - [ ] Test BlockArena correctnsess - random allocations, writes and undos, try to crash
- [ ] General parser / data description thing ## Low
- [ ] Rewrite other parsers using this
- [ ] Rewrite Env handling (to not be OS specific)
- New error mechanism - we were losing errors when ReportError was called multiple times, I still want that but I don't want to lose errors, so turn it into a summary list of errors
- [ ] BeginLog EndLog, and then show all logs as a list in the UI thing
- [ ] Undo kinds (to enable history in fuzzy buffers)
- [ ] Add undo kind. Snapshot kind, so that history is possible in weird buffers without paying a huge memory cost. The idea is that we would store the exact buffer state to replace with, editor would just save history of first line etc.
- [ ] Macros
- [ ] Regex
- [ ] ctags based indexing
- [ ] WordComplete
- [ ] Rewrite WordComplete to use CoroutineCreate, maybe try reducing globals to just the coroutine itself
- [ ] More bounded? seems like it might be problematic on a bigger project but so far it isn't (even for SDL or raddbg)
- [ ] Shell / terminal buffer plugin (keep the shell alive and talk with it) - [ ] Shell / terminal buffer plugin (keep the shell alive and talk with it)
- [ ] Directory Navigation - [ ] Fix somehow OpenCode hanging the editor on big files
- [ ] Remake lister when files change on disk
- [ ] When saving apply all the modifications instead (like deleting files, renaming etc.) or maybe that's not even needed considering we are integrating shell commands -----------------------------------------------------------------------
- [ ] OpenCode
- [ ] Hangs the editor on big files ## :QueryFile problems
- [ ] Open - User doesn't see that he in a special mode
- [ ] Way to bind "open" commands to keys from config - Coroutine is boundless here and the boundries of the mode are too lossely defined, it makes it strange when you learn that you are still in this mode
- [ ] Ability to access and set clipboard as well as affect selection in the open scripts - How do we kill all the views/buffers we entered? Do we care?
- [ ] QueryFile
- [ ] Indicate to user that he is choosing a file
- [ ] Define clear rules for opt out (like switching to different window) and kill or views that were for choosing?
*/ */
#define PLUGIN_PROFILER 1 #define PLUGIN_PROFILER 1
@@ -319,6 +304,27 @@ void OnCommand(Event event) {
Int p = ScreenSpaceToBufferPos(selected.window, selected.view, selected.buffer, mouse); Int p = ScreenSpaceToBufferPos(selected.window, selected.view, selected.buffer, mouse);
Caret &caret = selected.view->carets[0]; Caret &caret = selected.view->carets[0];
caret = SetFrontWithAnchor(caret, DocumentAnchor, p); caret = SetFrontWithAnchor(caret, DocumentAnchor, p);
if (event.alt && event.shift) {
Int front = GetFront(DocumentAnchor);
XY from = PosToXY(selected.buffer, front);
XY to = ScreenSpaceToXY(selected.window, selected.view, mouse);
Int min_line = Min(from.y, to.y);
Int max_line = Max(from.y, to.y);
Int min_col = Min(from.x, to.x);
Int max_col = Max(from.x, to.x);
selected.view->carets.len = 0;
for (Int line = min_line; line <= max_line; line += 1) {
XY left_xy = {min_col, line};
XY right_xy = {max_col, line};
Int left = XYToPosWithoutNL(selected.buffer, left_xy);
Int right = XYToPosWithoutNL(selected.buffer, right_xy);
Caret new_selection = MakeCaret(left, right);
Add(&selected.view->carets, new_selection);
}
MergeCarets(selected.buffer, &selected.view->carets);
}
} }
if (ResizerSelected.id != -1 && Mouse(LEFT_UP)) { if (ResizerSelected.id != -1 && Mouse(LEFT_UP)) {
@@ -425,8 +431,11 @@ void OnCommand(Event event) {
DocumentSelected = active.window->id; DocumentSelected = active.window->id;
Int p = ScreenSpaceToBufferPos(active.window, active.view, active.buffer, mouse); Int p = ScreenSpaceToBufferPos(active.window, active.view, active.buffer, mouse);
if (event.alt) Insert(&active.view->carets, MakeCaret(p, p), 0); if (event.alt) {
if (!event.alt && !event.shift) active.view->carets.len = 1; Insert(&active.view->carets, MakeCaret(p, p), 0);
} else if (!event.alt && !event.shift) {
active.view->carets.len = 1;
}
Caret &caret = active.view->carets[0]; Caret &caret = active.view->carets[0];
if (event.shift) { if (event.shift) {
@@ -558,6 +567,7 @@ void GarbageCollect() {
return; return;
} }
RunGCThisFrame = false; RunGCThisFrame = false;
ReportConsolef("GarbageCollect");
ProfileFunction(); ProfileFunction();
Allocator sys_allocator = GetSystemAllocator(); Allocator sys_allocator = GetSystemAllocator();
@@ -579,8 +589,8 @@ void GarbageCollect() {
continue; continue;
} }
bool ref = ViewIsReferenced(it); Int ref = ViewIsReferenced(it);
if (ref) { if (ref < 25) {
continue; continue;
} }
@@ -851,6 +861,9 @@ void MainLoop() {
FrameEvents.len = 0; FrameEvents.len = 0;
GetEventsForFrame(&FrameEvents); GetEventsForFrame(&FrameEvents);
For (FrameEvents) { For (FrameEvents) {
if (RecordingMacro) {
Add(&MacroPlayback, it);
}
#if PLUGIN_RECORD_EVENTS #if PLUGIN_RECORD_EVENTS
if (it.kind != EVENT_UPDATE && !Testing) { if (it.kind != EVENT_UPDATE && !Testing) {
Serialize(EventBuffer, &it); Serialize(EventBuffer, &it);

View File

@@ -5,6 +5,7 @@ void JumpTempBuffer(BSet *set, String buffer_name) {
set->view = WindowOpenBufferView(set->window, buffer_name); set->view = WindowOpenBufferView(set->window, buffer_name);
set->buffer = GetBuffer(set->view->active_buffer); set->buffer = GetBuffer(set->view->active_buffer);
set->buffer->temp = true; set->buffer->temp = true;
RunGCThisFrame = true;
} }
void AddCommand(Array<Command> *arr, String name, Trigger *trigger, CMDFunction *function) { void AddCommand(Array<Command> *arr, String name, Trigger *trigger, CMDFunction *function) {

View File

@@ -103,6 +103,22 @@ API bool ViewIsCrumb(ViewID view_id) {
return false; return false;
} }
API Int GetViewReferencedInHistoryRating(ViewID view_id) {
ForItem (window, Windows) {
For (window->goto_redo) if (it.view_id == view_id) return 1;
Int i = 0;
For (window->goto_history) {
i += 1;
if (it.view_id == view_id) {
return i;
}
}
}
return 0;
}
bool ViewIsActive(ViewID id) { bool ViewIsActive(ViewID id) {
For (Windows) { For (Windows) {
if (it->active_view == id) { if (it->active_view == id) {
@@ -112,16 +128,16 @@ bool ViewIsActive(ViewID id) {
return false; return false;
} }
API bool ViewIsReferenced(View *view) { API Int ViewIsReferenced(View *view) {
if (view->special) { if (view->special) {
return true; return 1;
} }
if (ViewIsCrumb(view->id)) { if (ViewIsActive(view->id)) {
return true; return 1;
} }
return ViewIsActive(view->id); return GetViewReferencedInHistoryRating(view->id);
} }
bool BufferIsReferenced(Buffer *buffer) { bool BufferIsReferenced(Buffer *buffer) {

View File

@@ -176,20 +176,22 @@ Window *SwitchWindow(int direction) {
return result; return result;
} }
Int ScreenSpaceToBufferPos(Window *window, View *view, Buffer *buffer, Vec2I mouse) { XY ScreenSpaceToXY(Window *window, View *view, Vec2I mouse) {
Vec2I mworld = mouse - window->document_rect.min + view->scroll; Vec2I mworld = mouse - window->document_rect.min + view->scroll;
double px = (double)mworld.x / (double)window->font->char_spacing; double px = (double)mworld.x / (double)window->font->char_spacing;
double py = (double)mworld.y / (double)window->font->line_spacing; double py = (double)mworld.y / (double)window->font->line_spacing;
XY xy = {(Int)round(px), (Int)floor(py)}; XY xy = {(Int)round(px), (Int)floor(py)};
return xy;
}
Int ScreenSpaceToBufferPos(Window *window, View *view, Buffer *buffer, Vec2I mouse) {
XY xy = ScreenSpaceToXY(window, view, mouse);
Int result = XYToPosWithoutNL(buffer, xy); Int result = XYToPosWithoutNL(buffer, xy);
return result; return result;
} }
Int ScreenSpaceToBufferPosErrorOutOfBounds(Window *window, View *view, Buffer *buffer, Vec2I mouse) { Int ScreenSpaceToBufferPosErrorOutOfBounds(Window *window, View *view, Buffer *buffer, Vec2I mouse) {
Vec2I mworld = mouse - window->document_rect.min + view->scroll; XY xy = ScreenSpaceToXY(window, view, mouse);
double px = (double)mworld.x / (double)window->font->char_spacing;
double py = (double)mworld.y / (double)window->font->line_spacing;
XY xy = {(Int)round(px), (Int)floor(py)};
Int result = XYToPosErrorOutOfBounds(buffer, xy); Int result = XYToPosErrorOutOfBounds(buffer, xy);
return result; return result;
} }