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:
parent
1c9767380f
commit
aa3de1b749
1 changed files with 6 additions and 12 deletions
|
@ -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;
|
||||
|
|
Reference in a new issue