diff --git a/src/backup/todo.txt b/src/backup/todo.txt index e898ace..2d2b9d5 100644 --- a/src/backup/todo.txt +++ b/src/backup/todo.txt @@ -1,10 +1,6 @@ - What precise workflow do I need for me to be viable to use this? - From a user (novice) point of view, how does it look like? -- Search - - alt + w: word search - - alt + c: case sensitive - - Open with seek string (open at pattern) filename:32 filename:/^Window$/ - build console window - Show what process/coroutines are running and allow to kill (active process buffer?) diff --git a/src/text_editor/commands.cpp b/src/text_editor/commands.cpp index b514755..80e7422 100644 --- a/src/text_editor/commands.cpp +++ b/src/text_editor/commands.cpp @@ -704,7 +704,7 @@ void Command_SetWorkDir() { WorkDir = ChopLastSlash(main.buffer->name); } RegisterCommand(Command_SetWorkDir, ""); -String CodeEndings[] = { ".c", ".cpp", ".h", ".hpp", ".py", ".lua", ".cxx", ".hxx", }; +String CodeSkipEndings[] = {".git" }; String Coro_OpenCodeDir; void Coro_OpenCode(mco_coro *co) { @@ -714,24 +714,22 @@ void Coro_OpenCode(mco_coro *co) { int i = 0; for (int diri = 0; diri < dirs.len; diri += 1) { for (FileIter it = IterateFiles(arena, dirs[diri]); IsValid(it); Advance(&it)) { - if (it.filename == ".git") { - continue; + + bool match = false; + for (int endings_i = 0; endings_i < Lengthof(CodeSkipEndings); endings_i += 1) { + String ending = CodeSkipEndings[endings_i]; + if (EndsWith(it.absolute_path, ending)) { + match = true; + break; + } } - ProfileScopeEx(it.filename); + if (match) break; + if (it.is_directory) { Add(&dirs, it.absolute_path); } else { - bool match = false; - ForItem (ending, CodeEndings) { - if (EndsWith(it.absolute_path, ending)) { - match = true; - break; - } - } - if (match) { - BufferOpenFile(it.absolute_path); - } + BufferOpenFile(it.absolute_path); } CoYield(co);