Snippets plugin doesn't work

Bug #136876 reported by Robert Nasiadek
8
Affects Status Importance Assigned to Milestone
gedit
Fix Released
High
gedit (Ubuntu)
Fix Released
Medium
Ubuntu Desktop Bugs

Bug Description

Binary package hint: gedit

A few days ago the code snippets plugin stopped working. After pressing tab the trigger disappears, but it's replaced with a regular tab instead of the code snippet associated with the trigger.

Related branches

Revision history for this message
Robert Nasiadek (robzon) wrote :

Sorry, I forgot to mention I'm using gutsy.

Revision history for this message
Darryl Ware (dware) wrote :

I've also noticed the issue on Gutsy on both my laptop and workstation.

All of the triggering seems to work normally but the trigger text is deleted and replaced with a tab, in my case 2 spaces.

If I run gedit from the commandline it logs the following to screen...

/bin/sh: /usr/bin/esd: not found
/usr/lib/python2.5/site-packages/_xmlplus/dom/xmlbuilder.py:8: Warning: IA__g_object_remove_toggle_ref: couldn't find toggle ref 0xb5f97a30(0x86bd39c)
  from xml.dom.NodeFilter import NodeFilter
Traceback (most recent call last):
  File "/usr/lib/gedit-2/plugins/snippets/Document.py", line 644, in on_view_key_press
    return self.run_snippet()
  File "/usr/lib/gedit-2/plugins/snippets/Document.py", line 436, in run_snippet
    return self.apply_snippet(snippets[0], start, end)
  File "/usr/lib/gedit-2/plugins/snippets/Document.py", line 369, in apply_snippet
    active_info = s.insert_into(self, start)
  File "/usr/lib/gedit-2/plugins/snippets/Snippet.py", line 295, in insert_into
    self._parse(plugin_data.view, marks)
  File "/usr/lib/gedit-2/plugins/snippets/Snippet.py", line 231, in _parse
    self._insert_text(val)
  File "/usr/lib/gedit-2/plugins/snippets/Snippet.py", line 138, in _insert_text
    indented = unicode.join('\n' + unicode(self._indent), spaces_instead_of_tabs(self._view, text).split('\n'))
  File "/usr/lib/gedit-2/plugins/snippets/Helper.py", line 59, in spaces_instead_of_tabs
    return text.replace("\t", view.get_tabs_width() * ' ')
AttributeError: 'gedit.View' object has no attribute 'get_tabs_width'

Revision history for this message
Darryl Ware (dware) wrote :

If I turned off "insert spaces instead of tabs" in the preferences the plugin begun to function normally.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for your bug. Looks like gedit-plugins needed to be updated for the new gtksourceview API

Changed in gedit:
assignee: nobody → desktop-bugs
importance: Undecided → Medium
status: New → Fix Committed
Revision history for this message
Robert Nasiadek (robzon) wrote :

Thanks for the fix! :)

Revision history for this message
Robert Nasiadek (robzon) wrote :

When will the patch hit repos? This bug still exists after today's upgrades.

Revision history for this message
Jesus Sanchez (ahinosvemos) wrote :

On 2007-09-12 GtkSourceView-2 API renamed get_tabs_view() to get_tab_view().

Modify Helper.py line 59 and it will work again ;)

Changed in gedit:
status: Unknown → Fix Released
Revision history for this message
Alex Cornejo (acornejoc) wrote :

This bug is still there as of today, and the fix is very simple, why not just patch the package and close this bug?

Revision history for this message
Alex Cornejo (acornejoc) wrote :

I changed the status back to "in progress" since it seems that everyone just forgot about this bug, and it is still present with the latest updates, even though a trivial fix is available.

Changed in gedit:
status: Fix Committed → In Progress
Revision history for this message
Sebastien Bacher (seb128) wrote :

Alex, please don't change to a wrong status, we use "Fix Commited" when the bug is fixed upstream, it's easier to get a list of bugs with a patch that we might close, setting it to something else means it'll probably stay in the middle if thousand of open bugs. The fixed package has also be uploaded for this one some days ago, it's just blocked by the beta freeze at the moment to it's really fix commited, usually the maintainers know what they are doing and there is no reason to do such changes

Changed in gedit:
status: In Progress → Fix Committed
Revision history for this message
Alex Cornejo (acornejoc) wrote :

Sorry for changing to wrong status, I am not familiar with the use of each status, and I wrongly assumed that "Fix Commited" meant that the fix was already available at the repositories and you were waiting for "testers".

I'll be more careful next time.

Revision history for this message
Sebastien Bacher (seb128) wrote :

That's alright, you can read about those on https://wiki.ubuntu.com/Bugs/Status

Revision history for this message
Sebastien Bacher (seb128) wrote :

gedit (2.20.0-0ubuntu2) gutsy; urgency=low

  * debian/patches/90_from_svn_fix_snippets_syntax.patch:
    - patch from SVN, fix syntax in the snippets plugin (LP: #136876)

 -- Sebastien Bacher <email address hidden> Mon, 24 Sep 2007 18:26:38 +0200

Changed in gedit:
status: Fix Committed → Fix Released
Revision history for this message
Evandro Pastor (evandrolinux-yahoo) wrote :

I have the same error here. I am using Ubuntu 8.04

Changed in gedit:
importance: Unknown → High
Revision history for this message
Tomasz Moniuszko (tvicious) wrote :

The same with Ubuntu 10.04.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.