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 312537 - Bad syntax highlithing for python files
Bad syntax highlithing for python files
Status: RESOLVED FIXED
Product: bluefish
Classification: Other
Component: application
1.0.1
Other Linux
: Normal normal
: ---
Assigned To: Bluefish Maintainer(s)
Bluefish Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2005-08-04 06:11 UTC by Wim Champagne
Modified: 2005-08-07 21:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposal for new python highlighting patterns (28.31 KB, application/octet-stream)
2005-08-04 17:05 UTC, Wim Champagne
Details

Description Wim Champagne 2005-08-04 06:11:33 UTC
Distribution/Version: ubuntu 5.04

After using this multi-line python comment in bluefish, all other highliting
fails after this comment :

[code]
    def cutDeck(self, area='random'):
        '''This cuts the deck in 2 and puts the first piece last.
        
        Possible area's:
            bottem = beginning of the deck (between card 1 and 26)
            middle = middle of the deck (between card 13 and 39)
            top = end of the deck (between card 27 and 52)
            random = could be everywhere
            
        Note : The bottom of the deck is the first card in the list!
               The top of the deck is the last card in the list!'''
        
        '''Find the cut-point'''    
        if area == 'bottem':
            cut = random.randint(1, 26)
        elif area == 'middle':
            cut = random.randint(13, 39)
        elif area == 'top':
            cut = random.randint(26, 51)
        else:
            cut = random.randint(1, 52)
[/code]

It has problems with the following text : Possible area's
Bluefish thinks the python comment ends after the ' of area's, but this isn't true.
for python, the comment is over after : .... list!'''
Comment 1 Olivier Sessink 2005-08-04 07:44:17 UTC
did you come up with some new patterns already? Help can be found here:
http://bluefish.openoffice.nl/manual/ch03s06.html#changing-highlighting-patterns

if you have some better patterns, please  attach them to this bug then we can
add them to the default patterns.
Comment 2 Wim Champagne 2005-08-04 17:05:08 UTC
Created attachment 50243 [details]
proposal for new python highlighting patterns
Comment 3 Wim Champagne 2005-08-04 17:06:20 UTC
I modified the highlighting-patterns within bluefish.
- I raised the comment-pattern just above string-double
- I made a new pattern based on the comment pattern : multi-line comment (begin
and end tag : ''')
- I placed this new pattern between comment and string-double in the list.

It seems to work thit way

I attached my ~/.bluefish/highlight file.
Comment 4 Olivier Sessink 2005-08-07 21:11:10 UTC
works like a charm, comitted to CVS, thanks!