GtkTextBuffer is merging my tags



Hi All,

there seems to be some optimization on the GtkTextBuffer which causes
automatic merging of GtkTextTags. Is there a way to turn this off? Or
some workaround?

If I'm doing something like this:
gtk_text_buffer_get_end_iter(buffer, &iter);
gtk_text_buffer_insert_with_tags_by_name(b, &i, "one\n", -1, "x", NULL);
gtk_text_buffer_insert_with_tags_by_name(b, &i, "two\n", -1, "x", NULL);
gtk_text_buffer_insert_with_tags_by_name(b, &i, "thr\n", -1, "x", NULL);

I would expect it to result in a structure like this:
<x>one
</x><x>two
</x><x>thr
</x>

But instead  I get:
<x>one
two
thr</x>

I'm sure this is the correct behavior for most formatting tasks, but I
was hoping that I could use GtkTextTags also for saving some semantic
information. In this case I wanted to use it for something like lists.

For example, I would like to have this:
<list>
 <list-item>aaa</list-item>
 <list-item>bbb</list-item>
</list>

Not this:
<list>
  <list-item>aaa
bbb</list-item>
</list>

Is it possible to somehow preserve this information and turn the
auto-merging off? I'm using GTK+ 2.10.12 on Linux.
Any help would be highly appreciated!

Thank you!
Conny




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]