public void LineUncomment()
{
if (string.IsNullOrEmpty(_lineCommentPrefix))
return;
NativeScintilla.BeginUndoAction();
// Uncommenting is a lot like line commenting. However in addition
// to looking for a non-whitespace character, the string that follows
// it MUST be our line Comment Prefix. If this is the case the prefex
// is removed from the line at its position.
Range selRange = Scintilla.Selection.Range;
int start = selRange.StartingLine.Number;
int end = selRange.EndingLine.Number;
int offset = _lineCommentPrefix.Length;
for (int i = start; i <= end; i++)
{
Line l = Scintilla.Lines[i];
int firstWordChar = FindFirstNonWhitespaceChar(l.Text);
if (firstWordChar >= 0)
{
int startPos = l.StartPosition + firstWordChar;
Range commentRange = Scintilla.GetRange(startPos, startPos + offset);
if (commentRange.Text == _lineCommentPrefix)
commentRange.Text = string.Empty;
}
}
NativeScintilla.EndUndoAction();
}