- Fix code editor resize problems

- Fix crash when using `get` our `out` multiple times with the same variable name
- Show the name of the file in which the error occured
This commit is contained in:
Stone_Red
2022-01-13 07:30:37 +01:00
parent 719db0f74b
commit ea5bbda2c7
8 changed files with 76 additions and 29 deletions
+3 -3
View File
@@ -105,8 +105,8 @@ namespace YesNt.CodeEditor
string line = textEditor.Lines[textEditor.CursorPosition.Y + 1];
textEditor.Lines[textEditor.CursorPosition.Y] = line.Substring(0, Math.Min(textEditor.CursorPosition.X, line.Length));
textEditor.Lines[textEditor.CursorPosition.Y + 1] = line.Substring(Math.Min(textEditor.CursorPosition.X, line.Length));
textEditor.Lines[textEditor.CursorPosition.Y] = line[..Math.Min(textEditor.CursorPosition.X, line.Length)];
textEditor.Lines[textEditor.CursorPosition.Y + 1] = line[Math.Min(textEditor.CursorPosition.X, line.Length)..];
textEditor.CursorPosition.X = 0;
textEditor.CursorPosition.Y++;
@@ -167,7 +167,7 @@ namespace YesNt.CodeEditor
}
}
while (textEditor.Lines.Count > 0 && string.IsNullOrWhiteSpace(textEditor.Lines[textEditor.Lines.Count - 1]))
while (textEditor.Lines.Count > 0 && string.IsNullOrWhiteSpace(textEditor.Lines[^1]))
{
textEditor.Lines.RemoveAt(textEditor.Lines.Count - 1);
}