After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 315324 - Syntax Highlighting Bugs
Syntax Highlighting Bugs
Status: RESOLVED FIXED
Product: bluefish
Classification: Other
Component: application
1.0.3
Other Linux
: Normal normal
: ---
Assigned To: Bluefish Maintainer(s)
Bluefish Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2005-09-06 03:12 UTC by David
Modified: 2005-09-25 18:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fixed highlighting.default file (10.90 KB, application/x-gzip)
2005-09-06 04:52 UTC, Jim Hayward
Details
Another bug fixed. Use This one (30.85 KB, text/plain)
2005-09-06 05:10 UTC, Jim Hayward
Details
#3 fixed highlighting.default (30.85 KB, text/plain)
2005-09-06 05:15 UTC, Jim Hayward
Details
Updated Highlighting File (more Perl keywords) (37.15 KB, text/plain)
2005-09-07 02:29 UTC, David
Details
perl patterns (6.90 KB, text/plain)
2005-09-07 04:18 UTC, Jim Hayward
Details
perl patterns #2 (7.16 KB, text/plain)
2005-09-07 04:53 UTC, Jim Hayward
Details
My Final Perl Highlighting Version (7.38 KB, text/plain)
2005-09-07 19:03 UTC, David
Details

Description David 2005-09-06 03:12:42 UTC
Distribution/Version: Fedora Core 4

This error is always present.

Bug 1: The perl keywords syntax highlighting is not working.   In the config
file it shows under perl a section "File Functions," containing the main
keywords (print, etc) needed for perl syntax highlighting, however when viewing
the syntax under preferences, that section is missing (and therefore doesn't
work).  In addition, it seems like the syntax highlighting (going by the
highlighting text file) is missing a lot of important keywords: ie: "sub".

Bug 2: Why are none of the lists in the preferences menu in alphabetical order?
 It's really annoying trying to find what you want on the list, when it's in a
relatively arbitrary order.


Other:  I've just started using Bluefish a few days ago, but it seems like a
great program so far, minus the current lack of good syntax highlighting
presets.  Under Windows, I use TextPad for most of my coding needs, but as soon
as I get the syntax highlighting the way I like it, I think I'll probably switch
entirely over to Bluefish - at least, once I get power management working under
linux (using a laptop) and fully switch to windows.

[Feature Request:]TextPad has an excellent system for syntax highlighting,
primarily because of the ease in which users can make their own
syntax-highlighting definitions, and share them.  I think Splitting the BlueFish
syntax-highlighting definitions into multiple files (for each type), instead of
putting it all in one, would make maintaining/sharing syntax definitions in
Bluefish a lot more efficient (and possible).  

[Question:]TextPad has a lot of good, pre-defined syntax-highlighting files
(basically, lists of keywords).  Looking at the file formats, I think I can
(when I have the time), write a simple Perl script to convert at least part of
the TextPad-style syntax-definitions, into the bluefish form, rather than trying
to manually add-in all of the syntax definitions I want/need in bluefish. 
Before I try that though, is there any definition of the file-format BlueFish
uses for syntax highlighting?  A lot of it seems obvious/easy to copy, but a
full definition of the file format would be useful in creating/updating syntax
definitions.

Thanks
Comment 1 Jim Hayward 2005-09-06 04:46:09 UTC
Bug 1: OK, this is fixed was a bug in the Perl highlighting pattern. There were
actually two entries missing.

Bug 2: What do you mean by "none of the lists in the preferences menu in
alphabetical order"? Please file separate bug reports for multiple bugs.

If you have improvements to the Perl highlighting pattern they are welcome.
Please also see. http://bugzilla.gnome.org/show_bug.cgi?id=313000 This appears
to have possibly been fixed too.

The Bluefish manual has some information on changing the highlighting patterns.
http://bluefish.openoffice.nl/manual/ch03s06.html#changing-highlighting-patterns

The config file for highlighting is a colon separated array with the following
content:

mode:
patternname:
case_sensitive(0-on/1-off):
start reg-ex:
end reg-ex:
start & end pattern(1), only start(2), subpattern(3):
parent-match:
foreground-color:
background-color:
don't change weight(0), non-bold(1), bold(2):
don't change style(0), non-italic(1), italic(2):
Comment 2 Jim Hayward 2005-09-06 04:52:20 UTC
Created attachment 51848 [details]
Fixed highlighting.default file

I attached a new highlighting.default file. This is the default file used if
~/.bluefish/highlighting is missing or when you use the "reset" button in
preferences. If you are using the RPM from Fedora Extra's replace the file in
/usr/share/bluefish with this file, run bluefish, select the perl pattern and
hit reset in the preferences to get the changes.
Comment 3 Jim Hayward 2005-09-06 05:10:45 UTC
Created attachment 51849 [details]
Another bug fixed. Use This one

Here is another highlighting default file. I found another bug.
Comment 4 Jim Hayward 2005-09-06 05:15:44 UTC
Created attachment 51850 [details]
#3 fixed highlighting.default

Sigh... I attached the wrong one. This is the real fixed one.
Comment 5 Daniel Leidert 2005-09-06 11:13:20 UTC
I guess he meant, that the filetype-list is not in alphabetical order. That
should be trivial to fix.
Comment 6 Jim Hayward 2005-09-06 12:50:03 UTC
I tried opening a bunch of Perl files I could find on my system to look for
highlighting errors. I saw a few obvious errors. I'm not familiar with Perl, so
I don't know what the keywords are, but it appeared there are some not being
highlighted. We really need a Perl programmer to update the patterns.
Comment 7 David 2005-09-07 02:29:07 UTC
Created attachment 51900 [details]
Updated Highlighting File (more Perl keywords)
Comment 8 David 2005-09-07 02:29:51 UTC
Daniel: I was referring to both the filetype and Pattern listings on the "Syntax
Highlighting" preferences in particular, but if you notice, none of the various
lists in any of the other pref-sections are alphabetized either.

Neither of the updated highlights files seems to correct the problem: In all
cases, the File Functions line of the Perl syntax does not load. 

Using a little copy/pasting, I ported over the keyword listings from the default
Perl Syntax Highlighting file used in TextPad.  This highlighting schema seems
to work properly, although I haven't had a chance to update the colors -
currently all of the keywords listed are using the same highlighting color. 
When I have time (and a listing of the HTML color codes) I'll update the colors
in each keywords set.  

The updated highlighting file is attached (I think)
Comment 9 Jim Hayward 2005-09-07 03:36:38 UTC
The #3 fixed highlighting file contains the fixed line for the missing "File
Functions" line. Tested on my system it does work now. There are still
highlighting issues with the pattern that I could see.
Comment 10 Jim Hayward 2005-09-07 03:39:36 UTC
Just the fixed line. This is a single line wrap. It will wrap here.

patterns: perl:File
Functions:1:\\b(bind|binmode|close(?\:dir)?|connect|eof|fcntl|fileno|flock|getc|getpeername|getsockname|getsockopt|ioctl|listen|open(?\:dir)?|recv|read(?\:dir)?|rewinddir|seek(?\:dir)?|send|setsockopt|shutdown|socket|sysopen|sysread|sysseek|syswrite|tell(?\:dir)?|write|accept|pipe|socketpair|print|printf|select)\\b::2::#900000::2:0:
Comment 11 Jim Hayward 2005-09-07 04:18:12 UTC
Created attachment 51902 [details]
perl patterns

OK, this is just the perl patterns. I merged your changes with a couple fixes
you didn't have in the last one you posted. This still needs some work. I see
some duplicate keywords now. 

Thanks for the new keywords.
Comment 12 Jim Hayward 2005-09-07 04:53:26 UTC
Created attachment 51903 [details]
perl patterns #2

Even more bug fixes.
Comment 13 David 2005-09-07 19:03:42 UTC
Created attachment 51931 [details]
My Final Perl Highlighting Version

Thanks, that last updated file works perfectly.  I've made a few changes,
eliminating most of the duplicate keywords and tweaking the highlighting colors
used to my prefs.  The Perl segment of that file is attached.
Comment 14 Daniel Leidert 2005-09-08 16:53:48 UTC
@David: We can sort the filetype-list in alphabetical order. But it is not
possible to sort the pattern lists, because the sequence is relevant. The
current CVS version introduces a new type of highlighting engine (see [1]), so
it is IMO useless to begin to change the old highlighting engine.

[1] http://bfwiki.tellefsen.net/index.php?pagename=Scanner