OpenCode opens everything except few

This commit is contained in:
Krzosa Karol
2025-12-27 19:14:18 +01:00
parent e4b84dde90
commit 28d8348b89
2 changed files with 12 additions and 18 deletions

View File

@@ -1,10 +1,6 @@
- What precise workflow do I need for me to be viable to use this? - 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? - 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$/ - Open with seek string (open at pattern) filename:32 filename:/^Window$/
- build console window - build console window
- Show what process/coroutines are running and allow to kill (active process buffer?) - Show what process/coroutines are running and allow to kill (active process buffer?)

View File

@@ -704,7 +704,7 @@ void Command_SetWorkDir() {
WorkDir = ChopLastSlash(main.buffer->name); WorkDir = ChopLastSlash(main.buffer->name);
} RegisterCommand(Command_SetWorkDir, ""); } RegisterCommand(Command_SetWorkDir, "");
String CodeEndings[] = { ".c", ".cpp", ".h", ".hpp", ".py", ".lua", ".cxx", ".hxx", }; String CodeSkipEndings[] = {".git" };
String Coro_OpenCodeDir; String Coro_OpenCodeDir;
void Coro_OpenCode(mco_coro *co) { void Coro_OpenCode(mco_coro *co) {
@@ -714,24 +714,22 @@ void Coro_OpenCode(mco_coro *co) {
int i = 0; int i = 0;
for (int diri = 0; diri < dirs.len; diri += 1) { for (int diri = 0; diri < dirs.len; diri += 1) {
for (FileIter it = IterateFiles(arena, dirs[diri]); IsValid(it); Advance(&it)) { 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) { if (it.is_directory) {
Add(&dirs, it.absolute_path); Add(&dirs, it.absolute_path);
} else { } else {
bool match = false; BufferOpenFile(it.absolute_path);
ForItem (ending, CodeEndings) {
if (EndsWith(it.absolute_path, ending)) {
match = true;
break;
}
}
if (match) {
BufferOpenFile(it.absolute_path);
}
} }
CoYield(co); CoYield(co);