Gtk.TextView with the following:
class GemtextWidget(Gtk.TextView): def __init__(self, text, *args, **kwargs): buf = Gtk.TextBuffer() buf.insert(buf.get_end_iter(), text) super().new_with_buffer( *args, wrap_mode=Gtk.WrapMode.WORD, vexpand=False, hexpand=False, editable=False, cursor_visible=False, buffer=buf, **kwargs )
When that subclass is instantiated with text (in this case from https://gemini.circumlunar.space/docs/specification.gmi), it looks like this, initially:
Upon resize, however, the correct behavior is exhibited:
The proper behavior always occurs when the text is unwrapped, but that is of course at the cost of horizontal scrolling.
Why might extra space be present, and how can I remove it?
In case it’s helpful, here’s a screenshot full application on initial render:
…and the window after a resize, making everything work properly: