You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The object model of gedit has obviously changed. In the file "plugin.py" you need to replace the code "document.get_location()" to "document.get_file().get_location()". Then it works again.
Reacted by Andrej Elias, Galin Wu and Wolfgang Blessen
$ gedit
Traceback (most recent call last):
File "/usr/lib/gedit/plugins/sourcecodebrowser/plugin.py", line 456, in on_sourcetree_draw
self._load_active_document_symbols()
File "/usr/lib/gedit/plugins/sourcecodebrowser/plugin.py", line 401, in _load_active_document_symbols
location = document.get_location()
AttributeError: 'Document' object has no attribute 'get_location'
Thank you very much. It was very altruistic of you to post this workaround so others could benefit, and you considerately responded to my comment to help guide me.
I reapplied the code change, and it worked. (Previously, perhaps I had forgoten to close all instances of gedit after applying the fix).
.
.
.
document = self.window.get_active_document()
if document:
# location = document.get_location()
location = document.get_file().get_location()
if location:
.
.
.
Activity
PJ-Singh-001 commentedon May 8, 2020
I am also experiencing this issue.
However, the work-around above did not work for me.
PJ-Singh-001 commentedon May 8, 2020
Here's some more info...
uwekel commentedon May 9, 2020
You still have not replaced the code as explained. See in line 401 and change "document.get_location()" into "document.get_file().get_location()".
PJ-Singh-001 commentedon May 9, 2020
I did!
Then I reverted it just to capture the error with the original code, when the change had no effect.
I’ll try making the change again, and capture any errors with the modified code.
PJ-Singh-001 commentedon May 24, 2020
uwekel,
Thank you very much. It was very altruistic of you to post this workaround so others could benefit, and you considerately responded to my comment to help guide me.
I reapplied the code change, and it worked. (Previously, perhaps I had forgoten to close all instances of gedit after applying the fix).
kiplingw commentedon Aug 1, 2020
Thanks @uwekel. It worked.
fix "Breaks with gedit 3.36.1"
Fix AttributeError: 'Document' object has no attribute 'get_location'
toobaz commentedon Nov 30, 2024
See #40 , closing