Skip to content

Breaks with gedit 3.36.1 #35

Closed
Closed

Description

@uwekel

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.

Activity

  1. PJ-Singh-001 commented on May 8, 2020

    @PJ-Singh-001

    I am also experiencing this issue.
    However, the work-around above did not work for me.

  2. PJ-Singh-001 commented on May 8, 2020

    @PJ-Singh-001

    Here's some more info...

    $ 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'
    
    
  3. uwekel commented on May 9, 2020

    @uwekel
    Author

    You still have not replaced the code as explained. See in line 401 and change "document.get_location()" into "document.get_file().get_location()".

  4. PJ-Singh-001 commented on May 9, 2020

    @PJ-Singh-001

    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.

  5. PJ-Singh-001 commented on May 24, 2020

    @PJ-Singh-001

    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).

        .
        .
        .
        document = self.window.get_active_document()
        if document:
            # location = document.get_location()
            location = document.get_file().get_location()
            if location:
        .
        .
        .
    
  6. kiplingw commented on Aug 1, 2020

    @kiplingw

    Thanks @uwekel. It worked.

  7. added a commit that references this issue on Nov 4, 2020
  8. toobaz commented on Nov 30, 2024

    @toobaz
    Contributor

    See #40 , closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions