Unable to serialize contents of a Gtk.TextBuffer
I have a Vala/Gtk3 app that incorporates a Gtk.TextView widget as well as the following bit of code...
Gtk.TextIter start_iter;
Gtk.TextIter end_iter;
var format = textview.buffer.register_serialize_tagset(null);
textview.buffer.get_start_iter(out start_iter);
textview.buffer.get_end_iter(out end_iter);
var text = (string) textview.buffer.serialize(textview.buffer, format, start_iter, end_iter);
print(text + "\n");
This code should serialize the textview buffer's contents (including applied text tags) into the variable text and then display all this information; however, when run, only the following "header" line is output:
GTKTEXTBUFFERCONTENTS-0001
The reason I believe this to be a bug in Vala (or an API?) is, the comparable code works as expected in Python.