gedit + vala syntax highlighting problem

Bug #188528 reported by mb
2
Affects Status Importance Assigned to Milestone
gtksourceview (Ubuntu)
Fix Released
Low
Ubuntu Desktop Bugs

Bug Description

Binary package hint: gedit

When a .vala file starts with a comment, not all of the syntax will be colored correctly. For an example, use this code from http://live.gnome.org/Vala/BasicSample

/* Basic Vala Sample Code */
using GLib;

public class Sample : Object {
        public Sample () {
        }

        public void run () {
                stdout.printf ("Hello World\n");
        }

        static int main (string[] args) {
                var sample = new Sample ();
                sample.run ();
                return 0;
        }
}

Save as sample.vala. To get proper highlighting, you will have to delete the comment and any newlines before the first line of code, and then save. If you insert the comment again and then save, the syntax will again lose highlighting. This holds true for /* multiline */ and // singleline comments.

Basically, as long as there is a comment before the first line of vala code, gedit will not highlight correctly.

ProblemType: Bug
Architecture: amd64
Date: Sat Feb 2 21:49:34 2008
DistroRelease: Ubuntu 7.10
ExecutablePath: /usr/bin/gedit
NonfreeKernelModules: vmnet vmblock vmmon nvidia
Package: gedit 2.20.3-0ubuntu1
PackageArchitecture: amd64
ProcCmdline: gedit
ProcCwd: /home/matt
ProcEnviron:
 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: gedit
Uname: Linux pancho 2.6.22-14-rt #1 SMP PREEMPT RT Tue Dec 18 06:37:06 UTC 2007 x86_64 GNU/Linux

Tags: apport-bug
Revision history for this message
mb (mattb108) wrote :
Revision history for this message
mb (mattb108) wrote :

Some more testing shows that if the file begins with anything but "using ...", syntax highlighting will be disrupted. This includes spaces/newlines, and valid lines of code that do not contain the keyword "using".

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

Thank you for your bug. That works correctly on hardy, closing the bug, feel free to reopen if you still get the issue using the new version though

Changed in gedit:
assignee: nobody → desktop-bugs
importance: Undecided → Low
status: New → Fix Released
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.