Not yet, but i'll look into it.
This is about as simple as I can make it:
module tb;
import gtk.Main;
import gtk.MainWindow;
import gtk.Layout;
import gtk.TextView;
import gtk.TextBuffer;
import gtk.TextIter;
class Tb : MainWindow
{
TextView te;
TextBuffer tb;
ubyte[] ub;
this()
{
super("TextBuffer test");
Layout f = new Layout(null, null);
f.setSizeRequest(300,200);
te = new TextView();
tb = te.getBuffer();
tb.addOnChanged(&bufferChanged);
te.setSizeRequest(290, 200);
te.setRightMargin(2);
te.doref();
f.put(te, 5, 5);
add(f);
showAll();
}
void serialize()
{
TextIter start = new TextIter();
TextIter end = new TextIter();
tb.getBounds(start, end);
GdkAtom atom = tb.registerSerializeTagset(null);
ub = tb.serialize(tb, atom, start, end);
}
void bufferChanged(TextBuffer b)
{
string s = b.getText();
// Set up undo checkpoint on space or line end
if (!(s[$-1..$] == " " || s[$-1..$] == "\n"))
return;
serialize();
}
}
void main(string[] args)
{
Main.init(args);
new Tb();
Main.run();
// Type something into the TextView. When you type space or enter it will crash
}