diff --git a/src/backup/todo.txt b/src/backup/todo.txt index 594fb37..43c7f50 100644 --- a/src/backup/todo.txt +++ b/src/backup/todo.txt @@ -21,7 +21,6 @@ Debug session: - Some bad allocating happening in Clipboard for sure New UI Session -- Move CommandWindow hooks to hooks - Cleanup String16/String with Open and EvalCommands after lua refactor - Uneditable buffers ? - Maybe marked allocations??? So that we can associate allocations with a buffer or view and then dealloc all at the same time @@ -35,7 +34,6 @@ New UI Session - DBBuffer - Guide on the first page for new users with links to configs, tutorials -- 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 - Maybe fix OS layer returning with "/" at the end for directories - Fix open code pattern diff --git a/src/text_editor/window_command.cpp b/src/text_editor/window_command.cpp index 3636422..0c3fd38 100644 --- a/src/text_editor/window_command.cpp +++ b/src/text_editor/window_command.cpp @@ -45,28 +45,26 @@ void CommandWindowUpdate() { ProfileFunction(); BSet active = GetBSet(ActiveWindowID); if (active.window->id == CommandWindowID) { - if (!ProcessIsActive(active.view->id)) { - Scratch scratch; - String16 line_string = GetLineStringWithoutNL(active.buffer, 0); - if (active.view->prev_search_line != line_string) { - active.view->prev_search_line = line_string; - Array ratings = FuzzySearchLines(scratch, active.buffer, 1, active.buffer->line_starts.len, line_string); + Scratch scratch; + String16 line_string = GetLineStringWithoutNL(active.buffer, 0); + if (active.view->prev_search_line != line_string) { + active.view->prev_search_line = line_string; + Array ratings = FuzzySearchLines(scratch, active.buffer, 1, active.buffer->line_starts.len, line_string); - Buffer *scratch_buff = CreateScratchBuffer(scratch, active.buffer->cap); - RawAppend(scratch_buff, line_string); - For(IterateInReverse(&ratings)) { - String16 s = GetLineStringWithoutNL(active.buffer, it.index); - if (s.len == 0) continue; - RawAppend(scratch_buff, u"\n"); - RawAppend(scratch_buff, s); - } - - Caret caret = active.view->carets[0]; - SaveCaretHistoryBeforeBeginEdit(active.buffer, active.view->carets); - SelectEntireBuffer(active.view); - Replace(active.view, GetString(scratch_buff)); - active.view->carets[0] = caret; + Buffer *scratch_buff = CreateScratchBuffer(scratch, active.buffer->cap); + RawAppend(scratch_buff, line_string); + For(IterateInReverse(&ratings)) { + String16 s = GetLineStringWithoutNL(active.buffer, it.index); + if (s.len == 0) continue; + RawAppend(scratch_buff, u"\n"); + RawAppend(scratch_buff, s); } + + Caret caret = active.view->carets[0]; + SaveCaretHistoryBeforeBeginEdit(active.buffer, active.view->carets); + SelectEntireBuffer(active.view); + Replace(active.view, GetString(scratch_buff)); + active.view->carets[0] = caret; } } }