Exemplo n.º 1
0
        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;
                    }
                }
            }
        }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 3
0
            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);
            }
Exemplo n.º 4
0
 public char GetCharAt(int position)
 {
     return(document.GetCharAt(position));
 }