Addressing the C:/Program Files (x86)/ situation
This commit is contained in:
@@ -309,11 +309,6 @@ API Int GetWordEnd(Buffer *buffer, Int pos) {
|
|||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsOpenBoundary(char c) {
|
|
||||||
bool result = c == 0 || IsParen(c) || IsBrace(c) || c == ':' || c == '\t' || c == '\n' || c == '"' || c == '\'';
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
API bool IsLoadWord(char16_t w) {
|
API bool IsLoadWord(char16_t w) {
|
||||||
bool result = w == u'-' || w == u'/' || w == u'\\' || w == u':' || w == u'$' || w == u'_' || w == u'.' || w == u'!' || w == u'@';
|
bool result = w == u'-' || w == u'/' || w == u'\\' || w == u':' || w == u'$' || w == u'_' || w == u'.' || w == u'!' || w == u'@';
|
||||||
if (!result) {
|
if (!result) {
|
||||||
|
|||||||
@@ -212,6 +212,11 @@ void MouseLoadWord(Event event, ResolveOpenMeta meta = ResolveOpenMeta_Normal) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IsOpenBoundary(char c) {
|
||||||
|
bool result = c == 0 || IsBrace(c) || c == ':' || c == '\t' || c == '\n' || c == '"' || c == '\'';
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
ResolvedOpen ResolveOpen(Allocator alo, Window *window, String path, ResolveOpenMeta meta) {
|
ResolvedOpen ResolveOpen(Allocator alo, Window *window, String path, ResolveOpenMeta meta) {
|
||||||
ResolvedOpen result = {};
|
ResolvedOpen result = {};
|
||||||
path = Trim(path);
|
path = Trim(path);
|
||||||
@@ -285,18 +290,51 @@ ResolvedOpen ResolveOpen(Allocator alo, Window *window, String path, ResolveOpen
|
|||||||
}
|
}
|
||||||
path = {pstart.data, (Int)(p.data - pstart.data)};
|
path = {pstart.data, (Int)(p.data - pstart.data)};
|
||||||
|
|
||||||
if (At(p, 0) == ':') {
|
// @todo: verify!
|
||||||
p = Skip(p, 1);
|
// For (LINE:COLUMN): error: - we can either backtrack at the end since we are including
|
||||||
result.line = SkipInt(&p);
|
// the parenthesis and whitespace or alternatively we can look for patterns on every
|
||||||
if (At(p, 0) == ':') {
|
// character move in the loop... For now let's do backtracking. This doesn't handle all paths
|
||||||
p = Skip(p, 1);
|
// but not sure if that's even what we want. ALL paths is hard.
|
||||||
Int b = SkipInt(&p);
|
{
|
||||||
result.col = b;
|
Int i = path.len - 1;
|
||||||
|
if (At(path, i) == ')') {
|
||||||
|
i -= 1;
|
||||||
|
|
||||||
|
Int end = i;
|
||||||
|
while (IsDigit(At(path, i))) {
|
||||||
|
i -= 1;
|
||||||
}
|
}
|
||||||
} else if (At(p, 0) == '(') {
|
Int start = i;
|
||||||
|
String b = {path.data + 1 + start, (end - start)};
|
||||||
|
|
||||||
|
if (At(path, i) == ')') {
|
||||||
|
i -= 1;
|
||||||
|
path.len = i + 1;
|
||||||
|
result.line = strtoll(b.data, NULL, 10);
|
||||||
|
} else if (At(path, i) == ',') {
|
||||||
|
i -= 1;
|
||||||
|
|
||||||
|
end = i;
|
||||||
|
while (IsDigit(At(path, i))) {
|
||||||
|
i -= 1;
|
||||||
|
}
|
||||||
|
start = i;
|
||||||
|
String a = {path.data + 1 + start, (end - start)};
|
||||||
|
|
||||||
|
if (At(path, i) == '(') {
|
||||||
|
i -= 1;
|
||||||
|
path.len = i + 1;
|
||||||
|
result.line = strtoll(a.data, NULL, 10);
|
||||||
|
result.col = strtoll(b.data, NULL, 10);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result.line == 0 && At(p, 0) == ':') {
|
||||||
p = Skip(p, 1);
|
p = Skip(p, 1);
|
||||||
result.line = SkipInt(&p);
|
result.line = SkipInt(&p);
|
||||||
if (At(p, 0) == ',') {
|
if (At(p, 0) == ':') {
|
||||||
p = Skip(p, 1);
|
p = Skip(p, 1);
|
||||||
Int b = SkipInt(&p);
|
Int b = SkipInt(&p);
|
||||||
result.col = b;
|
result.col = b;
|
||||||
|
|||||||
Reference in New Issue
Block a user