Compare commits
2 Commits
70b752eccb
...
903159d2bd
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
903159d2bd | ||
|
|
a87d2491bb |
@@ -226,4 +226,33 @@ void CheckKeybindingColission() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Range EncloseScope(Buffer *buffer, Int pos_min, Int pos_max, String16 open, String16 close) {
|
||||
Range result = {pos_min, pos_max};
|
||||
String16 buffer_string = GetString(buffer);
|
||||
for (Int i = pos_min - 1; i >= 0; i -= 1) {
|
||||
String16 string = Skip(buffer_string, i);
|
||||
if (StartsWith(string, open)) {
|
||||
result.min = i + open.len;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (Int i = pos_max; i < buffer->len; i += 1) {
|
||||
String16 string = Skip(buffer_string, i);
|
||||
if (StartsWith(string, close)) {
|
||||
result.max = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void CMD_SelectComment() {
|
||||
BSet active = GetBSet(ActiveWindowID);
|
||||
For (active.view->carets) {
|
||||
Range scope = EncloseScope(active.buffer, it.range.min, it.range.max, u"/*", u"*/");
|
||||
it.range = scope;
|
||||
}
|
||||
|
||||
} RegisterCommand(CMD_SelectComment, "ctrl-shift-l", "Find /* and */ and select the content in between");
|
||||
@@ -2116,6 +2116,9 @@ bool RDBG_InitConnection(mco_coro *co, bool create_session = true) {
|
||||
ResolvedOpen res = ResolveOpen(ctx->arena, window, BinaryUnderDebug, ResolveOpenMeta_DontError | ResolveOpenMeta_DontExec);
|
||||
if (res.kind == OpenKind_Goto) {
|
||||
file = Intern(&GlobalInternTable, res.path);
|
||||
} else {
|
||||
ReportErrorf("Failed to find the executable pointer by BinaryUnderDebug: %S", BinaryUnderDebug);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2130,7 +2133,8 @@ bool RDBG_InitConnection(mco_coro *co, bool create_session = true) {
|
||||
}
|
||||
|
||||
if (file.len == 0) {
|
||||
file = QueryUserFile(co);
|
||||
ReportWarningf("Couldn't find neither .rdbg file, nor use the BinaryUnderDebug variable to locate the binary");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user