GNOME Bugzilla – Bug 139267
python """Multiline string""" not hilighted when using a non C or english locale
Last modified: 2014-02-15 12:53:00 UTC
gtksourceview fails to hilight python """Multiline string"" but '''Multiline string''' (i'm using gedit2.5.91) the python.lang definition looks OK <string _name = "Multiline String" style = "String" end-at-line-end = "FALSE"> <start-regex>[uUrR]?"""</start-regex> <end-regex>"""</end-regex> </string> <string _name = "Multiline String 2" style = "String" end-at-line-end = "FALSE"> <start-regex>[uUrR]?'''</start-regex> <end-regex>'''</end-regex> </string>
hmmm... I don't know Python. Could you try to explain your problem with an example?
"""this is a multiline string """
Works for me, either double or single quotes (version 1.0.0). What version of GtkSourceView are you using?
pkg-config --modversion gtksourceview-1.0 0.9.2
> gtksourceview fails to hilight python """Multiline string"" but '''Multiline string''' (i'm using gedit2.5.91) Just realized you put only two quotes at the end of the string in your first comment, so I have to check. Is this a typo? If so, could you please post the file which doesn't work correctly? Thanks.
Created attachment 26810 [details] Screenshot
Ok, I can reproduce now, thanks a lot. Turns out this doesn't work when using a locale other than C or english. I'll investigate. Changing the subject accordingly. I can't reopen the bug... seems I need to get some bugzilla power. Could you please reopen it for me?
my locale is fr_FR.UTF-8
Ok, this turned out to be yet another problem with pattern priority. With different locales, the result from gtk_text_tag_table_foreach() is different, and thus the syntax_items list in GtkSourceBuffer is built differently. Then, in get_syntax_start() the list is searched in order, and in this case both a simple string and a multi-line string match the beginning of a multi-line string. Depending on bug 140097. Should be automatically fixed when we get that one.
*** Bug 311660 has been marked as a duplicate of this bug. ***
*** Bug 337227 has been marked as a duplicate of this bug. ***
a sorry I did a look but couldn't find it :( I copy my pbatic strings that differ from the above reported: '''prints 'chat' type messages''' '''Someone's broken this'''
*** Bug 344038 has been marked as a duplicate of this bug. ***
*** Bug 345647 has been marked as a duplicate of this bug. ***
(In reply to comment #7) > Ok, I can reproduce now, thanks a lot. Turns out this doesn't work when using a > locale other than C or english. FWIW, nud_, muntyan, and I (in #gedit on IRC) were able to reproduce this problem with en_US.UTF-8 and en_GB.UTF-8.
Precisely, we were able to reproduce it with '''foo''' type string but not with """foo""" ones.
We could try to write a simple hacky solution with the current engine waiting for a real solution with the new hl engine.
*** Bug 372045 has been marked as a duplicate of this bug. ***
Is this bug still present with gsv HEAD ?
Works in Russian, and shouldn't happen at all, since we are using UTF8-aware pcre.