OpenCode opens everything except few
This commit is contained in:
@@ -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?)
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user