GNOME Bugzilla – Bug 315324
Syntax Highlighting Bugs
Last modified: 2005-09-25 18:24:26 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
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):
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.
Created attachment 51849 [details] Another bug fixed. Use This one Here is another highlighting default file. I found another bug.
Created attachment 51850 [details] #3 fixed highlighting.default Sigh... I attached the wrong one. This is the real fixed one.
I guess he meant, that the filetype-list is not in alphabetical order. That should be trivial to fix.
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.
Created attachment 51900 [details] Updated Highlighting File (more Perl keywords)
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)
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.
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:
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.
Created attachment 51903 [details] perl patterns #2 Even more bug fixes.
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.
@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