diff --git a/src/backup/todo.txt b/src/backup/todo.txt index d753a5f..656b9ec 100644 --- a/src/backup/todo.txt +++ b/src/backup/todo.txt @@ -8,28 +8,13 @@ - Maybe 2 windows? - Guide on the first page for new users with links to configs, tutorials -- Window, View, Buffer + flags design (or is completely new kind based approach needed for Windows/Views?) - - How to make non-editable, informative, with different font size, title bar. Which might also contain tabs - - How to design clickable tree view in this way? - - How to design Command view? - - How to design popup view (input field)? - - How to design search view? or search and replace view? - -Splits: - Why constraint that name of buffer needs to be unique? For Open() and default behavior but is this required? - Try to add Tracking Allocator and rewrite the app, free all memory at the end of the app and check all is well Commands TODO: -- Search - - Ctrl + F - - Next occurence: Enter - - Prev occurence: Shift + Enter - - next occurence: F3 - - prev occurence: Shift + F3 - Console: OK concept but constrain - Turned off by default - Special: non editable, hotkeys don't work etc. -- I'M SETTING ACTIVE WINDOW AFTER COMMAND!!! DO WE CONTINUE WITH THIS? - CONSIDER AUTOMATING: CheckpointBeforeGoto - GotoBackward how to handle that in case we want to automate and create on every move? diff --git a/src/text_editor/commands.cpp b/src/text_editor/commands.cpp index 5da5588..f250377 100644 --- a/src/text_editor/commands.cpp +++ b/src/text_editor/commands.cpp @@ -675,7 +675,7 @@ void Coro_OpenCode(mco_coro *co) { } - if ((i%16) == 0) { + if ((i%32) == 0) { CoYield(co); } i += 1; diff --git a/src/text_editor/coroutines.cpp b/src/text_editor/coroutines.cpp index d72f14a..5c82a6e 100644 --- a/src/text_editor/coroutines.cpp +++ b/src/text_editor/coroutines.cpp @@ -1,5 +1,4 @@ typedef void CoroutineProc(mco_coro *co); -Array ActiveCoroutines; mco_coro *CoAdd(CoroutineProc *proc) { mco_desc desc = mco_desc_init(proc, 0); diff --git a/src/text_editor/event.cpp b/src/text_editor/event.cpp index cf18acb..04f2023 100644 --- a/src/text_editor/event.cpp +++ b/src/text_editor/event.cpp @@ -465,6 +465,7 @@ inline void AddEvent(Array *events, Event ev) { } Array GetEventsForFrame(Allocator allocator) { + ProfileFunction(); Array result = {allocator}; if (EventPlayback.len) { result = TightCopy(allocator, EventPlayback); diff --git a/src/text_editor/globals.cpp b/src/text_editor/globals.cpp index c8be602..a6090b9 100644 --- a/src/text_editor/globals.cpp +++ b/src/text_editor/globals.cpp @@ -81,6 +81,7 @@ Array Variables; Array ActiveProcesses = {}; Array ProcessEnviroment = {}; +Array ActiveCoroutines; /////////////////////////////// diff --git a/src/text_editor/text_editor.cpp b/src/text_editor/text_editor.cpp index 9e29701..b68e48f 100644 --- a/src/text_editor/text_editor.cpp +++ b/src/text_editor/text_editor.cpp @@ -605,13 +605,14 @@ void MainLoop() { } WaitForEvents = ConfigWaitForEvents; - if (IsDocumentSelectionValid() || IsScrollbarSelectionValid() || ActiveProcesses.len) { + if (IsDocumentSelectionValid() || IsScrollbarSelectionValid() || ActiveProcesses.len || ActiveCoroutines.len) { WaitForEvents = false; } // This shouldn't matter to the state of the program, only appearance for // the user { + ProfileScope(SetWindowTitle); Window *window = GetActiveWind(); View *view = GetView(window->active_view); Buffer *buffer = GetBuffer(view->active_buffer);