stab in the dark to fix this startup exception

It doesn't actually happen for me. I rewrote GetCurrentLine() to
be more consistent with the rest of the codebase about newlines,
hopefully this will work for everyone.
This commit is contained in:
RogueAI42 2017-08-01 17:47:09 +10:00
parent 1c9767380f
commit aa3de1b749

View file

@ -76,13 +76,14 @@ namespace ShiftOS.Frontend.Apps
Dock = GUI.DockStyle.Fill;
}
private static readonly string[] delimiters = { Environment.NewLine };
public string[] Lines
{
get
{
return Text.Split(new[] { Environment.NewLine }, StringSplitOptions.None);
return Text.Split(delimiters, StringSplitOptions.None);
}
}
@ -121,18 +122,11 @@ namespace ShiftOS.Frontend.Apps
}
private static readonly Regex regexNl = new Regex(Regex.Escape(Environment.NewLine));
public int GetCurrentLine()
{
int line = 0;
for(int i = 0; i < Index; i++)
{
if(Text[i]=='\n')
{
line++;
continue;
}
}
return line;
return regexNl.Matches(Text.Substring(0, Index)).Count;
}
float _vertOffset = 0.0f;