GNOME Bugzilla – Bug 120602
highlighting is not correct after an apostrophe
Last modified: 2004-12-22 21:47:04 UTC
Highlighting this piece of XML code isn't correct: <?xml version="1.0" encoding="iso-8859-6"?> <title>I'm </title> the last </title> is highlighted, This shouldn't be ? Version 0.5
*** Bug 115300 has been marked as a duplicate of this bug. ***
From bug #115300. Gustavo wrote: | I don't think we can do much to improve this situation, except maybe | put end-at-line-end to TRUE in both string patterns. | | For a complete and definitive solution, we will have to wait for the | stack based highlighting engine. For the moment, I will go for this "work around"
*** Bug 131922 has been marked as a duplicate of this bug. ***
Look at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=226215 too. I have a patch that implements a simple workaround for this bug.
Fixed in CVS HEAD. Gustavo: I've seen it was too late for 0.9. I think we could do a 0.10 or 0.9.1 if we want some user feedback on this fix. Committed patch: Index: ChangeLog =================================================================== RCS file: /cvs/gnome/gtksourceview/ChangeLog,v retrieving revision 1.147 diff -u -p -r1.147 ChangeLog --- ChangeLog 12 Feb 2004 22:21:49 -0000 1.147 +++ ChangeLog 13 Feb 2004 17:36:47 -0000 @@ -1,3 +1,11 @@ +2004-02-13 Paolo Maggi <paolo.maggi@polito.it> + + * gtksourceview/language-specs/xml.lang: + * gtksourceview/language-specs/html.lang: fixed bug #120602 - + highlighting is not correct after an apostrophe. I'm not very happy + with the fix since it is a sort of workaround, but probably it is the best + we can do with the current highlight engine. + === gtksourceview 0.9.0 === 2004-02-12 Gustavo Giráldez <gustavo.giraldez@gmx.net> Index: gtksourceview/language-specs/html.lang =================================================================== RCS file: /cvs/gnome/gtksourceview/gtksourceview/language-specs/html.lang,v retrieving revision 1.6 diff -u -p -r1.6 html.lang --- gtksourceview/language-specs/html.lang 30 Dec 2003 16:24:04 -0000 1.6 +++ gtksourceview/language-specs/html.lang 13 Feb 2004 17:36:47 -0000 @@ -12,10 +12,9 @@ <end-regex>></end-regex> </syntax-item> - <string _name="String" style ="String" end-at-line-end="FALSE"> - <start-regex>"</start-regex> - <end-regex>"</end-regex> - </string> + <pattern-item _name="String" style="String"> + <regex>("[^<"]*")</regex> + </pattern-item> <pattern-item _name="Entity" style="Character"> <regex>&[a-zA-Z]+;</regex> Index: gtksourceview/language-specs/xml.lang =================================================================== RCS file: /cvs/gnome/gtksourceview/gtksourceview/language-specs/xml.lang,v retrieving revision 1.4 diff -u -p -r1.4 xml.lang --- gtksourceview/language-specs/xml.lang 26 May 2003 14:50:09 -0000 1.4 +++ gtksourceview/language-specs/xml.lang 13 Feb 2004 17:36:47 -0000 @@ -12,17 +12,10 @@ <end-regex>></end-regex> </syntax-item> - <string _name="String" style ="String" end-at-line-end="FALSE"> - <start-regex>"</start-regex> - <end-regex>"</end-regex> - </string> - - <string _name="String 2" style ="String" end-at-line-end="FALSE"> - <start-regex>'</start-regex> - <end-regex>'</end-regex> - </string> - - + <pattern-item _name="String" style="String"> + <regex>("[^<"]*")|('[^<']*')</regex> + </pattern-item> + <pattern-item _name="Entity" style="Keyword"> <regex>(&|%)[a-zA-Z0-9#][a-zA-Z0-9]*;</regex> </pattern-item>
Gustavo: I have not committed the patch in the new branch. BTW, I think we could safely move all the fixes to HEAD in the new branch just before moving it to HEAD.