gedit-source-code-browser icon indicating copy to clipboard operation
gedit-source-code-browser copied to clipboard

'Document' object has no attribute 'goto_line' (Gedit 44.2)

Open PJ-Singh-001 opened this issue 2 years ago • 3 comments

Gedit Version: 44.2 Distro: Ubuntu 23.04

I experience the following error when clicking on an item in the source code browser panel:

Traceback (most recent call last):
  File "/usr/lib/gedit/plugins/sourcecodebrowser/plugin.py", line 473, in on_tag_activated
    document.goto_line(line)
    ^^^^^^^^^^^^^^^^^^
AttributeError: 'Document' object has no attribute 'goto_line'

This probably has something to do with:

gedit now depends on libgedit-gtksourceview instead of GtkSourceView

PJ-Singh-001 avatar May 19 '23 23:05 PJ-Singh-001

fix available: https://github.com/MicahCarrick/gedit-source-code-browser/issues/39#issuecomment-1529733276

ildar avatar May 20 '23 05:05 ildar

This did not work for me on Gedit Version 44.2 in Ubuntu 23.10.

Any ideas on what I could do differently?

I tried applying the fix by adding import gi to plugin.py using the following command...

sudo sed -i "s|from . import ctags|from . import ctags\nimport gi|g" /usr/lib/gedit/plugins/sourcecodebrowser/plugin.py

...which changes /usr/lib/gedit/plugins/sourcecodebrowser/plugin.py...

...from...

import os
import sys
import logging
import tempfile
from . import ctags
from gi.repository import GObject, GdkPixbuf, Gedit, Gtk, PeasGtk, Gio

...to...

import os
import sys
import logging
import tempfile
from . import ctags
import gi
from gi.repository import GObject, GdkPixbuf, Gedit, Gtk, PeasGtk, Gio

...but I still get the same error.

PJ-Singh-001 avatar Jun 07 '24 22:06 PJ-Singh-001