static void CheckLine(Mono.TextEditor.Document doc, Mono.TextEditor.LineSegment line, out bool isBlank, out bool isBracket) { isBlank = true; isBracket = false; if (line == null) { return; } for (int i = 0; i < line.Length; i++) { char c = doc.GetCharAt(line.Offset + i); if (c == '{') { isBracket = true; isBlank = false; } else if (!Char.IsWhiteSpace(c)) { isBlank = false; if (isBracket) { isBracket = false; break; } } } }
static bool IsBlankLine(Mono.TextEditor.Document doc, Mono.TextEditor.LineSegment line) { for (int i = 0; i < line.EditableLength; i++) { if (!Char.IsWhiteSpace(doc.GetCharAt(line.Offset + i))) { return(false); } } return(true); }
public static RemoveInfo GetRemoveInfo(Mono.TextEditor.Document document, ref int pos) { int len = 0; while (pos > 0 && IsWhiteSpace(document.GetCharAt(pos))) { --pos; ++len; } if (len > 0) { pos++; return(new RemoveInfo(pos, len)); } return(Empty); }
public char GetCharAt(int position) { return(document.GetCharAt(position)); }