Snippet plugin doesn't work properly when having a placeholder with default list values

Bug #974682 reported by Răzvan-Cosmin Rădulescu
8
This bug affects 2 people
Affects Status Importance Assigned to Milestone
gedit (Ubuntu)
Invalid
Low
Unassigned

Bug Description

1)
Description: Ubuntu 11.10
Release: 11.10

2)
gedit 3.2.3-0ubuntu0.1

3)
went to Tools > Manage Snippets... then FORTRAN 95 and changed character (c) from:

character(len=${1:10}) :: $0
to
character(len=${1:[*,10]}) :: $0

Expectation: insert text, place cursor in $1 placeholder position and give default values list to choose from

4)
What happened:
inserted "character (len= ) :: " with cursor in $1 placeholder position but no default values appeared.

Terminal:
Traceback (most recent call last):
  File "/usr/lib/gedit/plugins/snippets/document.py", line 751, in on_view_key_press
    return self.run_snippet()
  File "/usr/lib/gedit/plugins/snippets/document.py", line 598, in run_snippet
    if not self.run_snippet_trigger(word, (start, end)):
  File "/usr/lib/gedit/plugins/snippets/document.py", line 572, in run_snippet_trigger
    return self.apply_snippet(snippets[0], bounds[0], bounds[1])
  File "/usr/lib/gedit/plugins/snippets/document.py", line 503, in apply_snippet
    self.goto_placeholder(self.active_placeholder, sn.placeholders[keys[0]])
  File "/usr/lib/gedit/plugins/snippets/document.py", line 287, in goto_placeholder
    self.defaults_provider.set_defaults(next.defaults)
  File "/usr/lib/gedit/plugins/snippets/completion.py", line 169, in set_defaults
    self.proposals.append(GtkSource.CompletionItem(d))
TypeError: GObject.__init__() takes exactly 0 arguments (1 given)

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: gedit 3.2.3-0ubuntu0.1
ProcVersionSignature: Ubuntu 3.0.0-15.26-generic 3.0.13
Uname: Linux 3.0.0-15-generic x86_64
ApportVersion: 1.23-0ubuntu4
Architecture: amd64
Date: Thu Apr 5 22:46:24 2012
ExecutablePath: /usr/bin/gedit
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
SourcePackage: gedit
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Răzvan-Cosmin Rădulescu (razvancosmin-radulescu) wrote :
Revision history for this message
Jesse van den Kieboom (jessevdk) wrote :

This has been fixed upstream

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

thanks Jesse

Changed in gedit (Ubuntu):
importance: Undecided → Low
status: New → Fix Committed
Revision history for this message
Sebastien Bacher (seb128) wrote :

that's this commit right? 1035688

Revision history for this message
Sebastien Bacher (seb128) wrote :
Revision history for this message
Yves de Saint-Pern (yves-desaintpern) wrote :

Hi all,
I am afraid this bug is still (partially) present in gedit 3.8.3 (Ubuntu 13.10).

A snippet with a simple placeholderlike:
${1:[aaa,bbb,ccc]}

only prints the first default value of the list (here: aaa).
No popup showing all default values (here aaa and bbb and ccc) as a list is displayed.

Cheers,

Yves

Revision history for this message
dino99 (9d9) wrote :

This version has expired

Changed in gedit (Ubuntu):
status: Fix Committed → Invalid
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.