mirror of
https://github.com/haven1433/HexManiacAdvance.git
synced 2026-03-21 17:34:13 -05:00
fix crashes with curly braces
This commit is contained in:
parent
ab6e688208
commit
bab9ff3586
|
|
@ -448,7 +448,7 @@ namespace HavenSoft.HexManiac.Core.Models.Code {
|
|||
break;
|
||||
}
|
||||
if (close == -1) {
|
||||
if (i == caret) {
|
||||
if (i == caret || (i == caret - 1 && caret == text.Count)) {
|
||||
text.Insert(i + 1, '\r');
|
||||
text.Insert(i + 2, '\n');
|
||||
}
|
||||
|
|
@ -827,7 +827,7 @@ namespace HavenSoft.HexManiac.Core.Models.Code {
|
|||
partialDocumentation = candidates[0].Usage + Environment.NewLine + string.Join(Environment.NewLine, candidates[0].Documentation);
|
||||
}
|
||||
|
||||
if (context.Index > 0 && context.Line[context.Index - 1] == ' ' && tokens.Length > 0) {
|
||||
if (context.Index > 0 && context.Index < context.Line.Length && context.Line[context.Index - 1] == ' ' && tokens.Length > 0) {
|
||||
// I'm directly after a space, I'm at the start of a new token, there is no existing documentation
|
||||
var skipCount = candidates[0].LineCode.Count;
|
||||
if (skipCount == 0) skipCount = 1;
|
||||
|
|
|
|||
|
|
@ -463,7 +463,7 @@ namespace HavenSoft.HexManiac.Core.ViewModels.Tools {
|
|||
if (lines[i].Trim() == "{") {
|
||||
var type = queue.Count == 0 ? ExpectedPointerType.Unknown : queue.Dequeue();
|
||||
i += 1;
|
||||
while (lines[i].Trim() != "}") {
|
||||
while (i < lines.Length && lines[i].Trim() != "}") {
|
||||
results.Add(new(i, type, lines[i]));
|
||||
i += 1;
|
||||
if (lines.Length <= i) break;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user