Compare commits

..

2 Commits

Author SHA1 Message Date
Krzosa Karol
372287f557 CMD_SetProjectHere, look for project files 2026-01-19 08:44:05 +01:00
Krzosa Karol
8ecfc82d8f RemedyBGPlugin: Look for .rdbg file in project dir if BinaryUnderDebug not set 2026-01-19 08:43:52 +01:00
2 changed files with 23 additions and 5 deletions

View File

@@ -9,11 +9,6 @@ void SetProjectDirectory(String dir) {
}
}
void CMD_SetProjectDirectoryHere() {
BSet main = GetBSet(PrimaryWindowID);
SetProjectDirectory(GetDirectory(main.buffer));
} RegisterCommand(CMD_SetProjectDirectoryHere, "", "Sets work directory to the directory of the current buffer, it also renames couple special buffers to make them accomodate the new ProjectDirectory");
void CO_OpenCode(mco_coro *co) {
Array<String> patterns = SplitWhitespace(CoCurr->arena, OpenCodePatterns);
Array<String> exclude_patterns = SplitWhitespace(CoCurr->arena, OpenCodeExcludePatterns);
@@ -59,3 +54,17 @@ void CO_OpenCode(mco_coro *co) {
"Open all code files in current ProjectDirectory, the code files are determined through NonCodePatterns_EndsWith config variable list",
data->dont_wait_until_resolved = true;
);
void CMD_SetProjectHere() {
BSet main = GetBSet(PrimaryWindowID);
String directory = GetDirectory(main.buffer);
SetProjectDirectory(directory);
#if PLUGIN_CONFIG
Scratch scratch;
for (FileIter it = IterateFiles(scratch, directory); IsValid(it); Advance(&it)) {
if (EndsWith(it.filename, "project.te")) {
LoadConfig(it.absolute_path);
}
}
#endif
} RegisterCommand(CMD_SetProjectHere, "", "Sets the project directory, opens the project file etc.");

View File

@@ -2116,6 +2116,15 @@ bool RDBG_InitConnection(mco_coro *co) {
}
}
if (file.len == 0) {
Scratch scratch;
for (FileIter it = IterateFiles(scratch, ProjectDirectory); IsValid(it); Advance(&it)) {
if (EndsWith(it.filename, ".rdbg")) {
file = Intern(&GlobalInternTable, it.absolute_path);
}
}
}
if (file.len == 0) {
file = QueryUserFile(co);
}