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 621132 - 'C/CPP' Bracket Matching is corrupted if bracked lay in char '{' '}'
'C/CPP' Bracket Matching is corrupted if bracked lay in char '{' '}'
Status: RESOLVED DUPLICATE of bug 629786
Product: gtksourceview
Classification: Platform
Component: General
2.11.x
Other Linux
: Normal normal
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2010-06-09 17:11 UTC by Rafał Bursig
Modified: 2014-05-09 19:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Adds the string class to chars in the C language (795 bytes, patch)
2010-06-09 17:58 UTC, Garrett Regier
none Details | Review
Added the char class and applied it to chars in the C language (1.20 KB, patch)
2010-06-22 15:58 UTC, Garrett Regier
rejected Details | Review

Description Rafał Bursig 2010-06-09 17:11:43 UTC
Bracket Matching engine have problem with bellow example:

{
  int c = '{';

}


Please add < ... class="char"> in c.lang file like bellow

                <context id="char" style-ref="char" class="char">
                    <match>L?'(\%{escaped-character}|.)'</match>
                </context>

and change in gtksourcebuffer.c : line ~837

/* This describes a mask of relevant context classes for highlighting matching
   brackets. Additional classes can be added below */
static const gchar *cclass_mask_definitions[] = {
	"comment",
	"string",
	"char", // <- new 'char' mask class
};
Comment 1 Garrett Regier 2010-06-09 17:58:51 UTC
Created attachment 163219 [details] [review]
Adds the string class to chars in the C language

This adds the string class to chars instead of a new char class.
Comment 2 Rafał Bursig 2010-06-09 18:26:07 UTC
Yes and No ;)

Going in this way we should have only one class which we should "omit" because this require only one check. But having many class give you better information where you are but (again ;)) give you several additional checks...

Whatever will be chused I will be happy when primary problem will be fixed in default configurations
Comment 3 Ignacio Casal Quinteiro (nacho) 2010-06-11 12:22:00 UTC
Yeah I've been thinking and probably is better having a char class. It makes also sense for not checking it in the spell plugin.
Comment 4 Garrett Regier 2010-06-22 15:58:05 UTC
Created attachment 164317 [details] [review]
Added the char class and applied it to chars in the C language
Comment 5 Garrett Regier 2010-06-23 09:40:59 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
Comment 6 Paolo Borelli 2010-06-23 18:35:19 UTC
I have reverted the commit.

As said on irc context classes are meant to have synctatic meaning to which a logic then applicated, not to just mirror the context name and then have the logic special case specific names.

For instance in this cases we need to annotate the class like skip-bracket-match or somthing like that.
Comment 7 Sébastien Wilmet 2014-05-09 19:51:32 UTC

*** This bug has been marked as a duplicate of bug 629786 ***