Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Word wrap looks crazy on one line of this file #695

Open
sekelsta opened this issue Apr 18, 2024 · 2 comments
Open

Word wrap looks crazy on one line of this file #695

sekelsta opened this issue Apr 18, 2024 · 2 comments

Comments

@sekelsta
Copy link

Expected behaviour

Plaintext file should look like plaintext

Actual behaviour

This one line looks crazy
Screenshot at 2024-04-18 17-21-07

Steps to reproduce the behaviour

Open this file with pluma:
server-debug.txt
(had to trim a bit off the end to get it to upload)

MATE general version

1.26.0

Package version

1.26.0

Linux Distribution

Ubuntu 22.04.4 LTS 64 bit

Link to bugreport of your Distribution (requirement)

@dhasenan
Copy link

dhasenan commented Apr 28, 2024

This looks like an upstream bug with Gtk's TextBuffer class (or something more basic than that). See:

import sys
import gi
gi.require_version("Gtk", "3.0")
gi.require_version("GtkSource", "4")
from gi.repository import Gtk, GtkSource

buffer = Gtk.TextBuffer()
with open(sys.argv[1], "r") as f:
    t = f.read()
    print(len(t))
    buffer.set_text(t)
source_view = Gtk.TextView.new_with_buffer(buffer)

sv = Gtk.ScrolledWindow()
sv.add(source_view)

win = Gtk.Window()
win.add(sv)
win.connect("destroy", Gtk.main_quit)
win.show_all()
Gtk.main()

gtktextview

In Gtk+ 4, the line simply does not render instead.

@cwendling
Copy link
Member

Also note that although it's not really an excuse, the line in question is 2727232 characters long. Again, not an excuse, but it's pretty uncommon 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants