Beispiel #1
0
        void HighlightInBlock(Gtk.TextIter start, Gtk.TextIter end)
        {
            foreach (TrieHit hit in galago.Trie.FindMatches(start.GetText(end)))
            {
                Gtk.TextIter match_start =
                    Buffer.GetIterAtOffset(start.Offset + hit.Start);

                // Don't create links inside note or URL links
                if (match_start.HasTag(url_tag) ||
                    match_start.HasTag(link_tag))
                {
                    continue;
                }

                Gtk.TextIter match_end = match_start;
                match_end.ForwardChars(hit.End - hit.Start);

                Logger.Log("Matching Person '{0}' at {1}-{2}...",
                           hit.Key,
                           hit.Start,
                           hit.End);
                Buffer.ApplyTag(person_tag, match_start, match_end);
            }
        }
Beispiel #2
0
	public static bool TagEndsHere (TextTag tag, TextIter currentIter, TextIter nextIter)
	{
		return (currentIter.HasTag (tag) && !nextIter.HasTag (tag));
	}
Beispiel #3
0
		// does the character at offset in the GtkTextIter has
		// this text tag applied?
		bool CharHasTag(TextIter iter, 
				TextTag tag, int char_offset_in_line) 
		{

			TextIter offset_iter;

			offset_iter = iter;
			offset_iter.LineOffset = char_offset_in_line;
		
			return offset_iter.HasTag (tag);
		}