private void XKeyDown(object sender, KeyEventArgs e)
{
string line = null;
if (e.KeyCode == Keys.Enter)
{
if (SelectionLength == 0)
{
int lineNo = GetLineFromCharIndex(SelectionStart);
if (lineNo < Lines.Length)
{
line = Lines[lineNo];
}
}
else
{
// line = SelectedText.Replace("\n>", " "); // ?? this should be done where prompt is set and use prompt
line = SelectedText;
}
if (line != null)
{
parent.DelayedExecute(line);
if (SelectionStart != Text.Length)
{
e.Handled = true; // do not let Enter insert CR unless at very end
}
}
}
}