static bool IsBlankLine(Mono.TextEditor.TextDocument doc, Mono.TextEditor.DocumentLine line)
 {
     for (int i = 0; i < line.Length; i++)
     {
         if (!Char.IsWhiteSpace(doc.GetCharAt(line.Offset + i)))
         {
             return(false);
         }
     }
     return(true);
 }
Esempio n. 2
0
            public static RemoveInfo GetRemoveInfo(Mono.TextEditor.TextDocument 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);
            }
 static void CheckLine(Mono.TextEditor.TextDocument doc, Mono.TextEditor.DocumentLine line, out bool isBlank, out bool isBracket)
 {
     isBlank   = true;
     isBracket = false;
     for (int i = 0; i < line.LengthIncludingDelimiter; 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;
             }
         }
     }
 }
Esempio n. 4
0
 char MonoDevelop.Core.Text.ITextSource.GetCharAt(int offset)
 {
     return(snapshot.GetCharAt(offset));
 }