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 628805 - "bracket matching" for HTML
"bracket matching" for HTML
Status: RESOLVED DUPLICATE of bug 300458
Product: gedit
Classification: Applications
Component: general
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: Gedit maintainers
Gedit maintainers
Depends on:
Blocks:
 
 
Reported: 2010-09-05 00:03 UTC by ⚡Static⚡
Modified: 2013-05-19 16:39 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description ⚡Static⚡ 2010-09-05 00:03:27 UTC
There is a "highlight matching bracket" checkbox in the preferences, which highlights the matching bracket. It works for most languages, but it isn't practical for HTML. It would be really good to have "bracket matching" for HTML, or ability to define regex bracket highlighting. If you can tell me which source files I would need to look at to try doing it myself, that would be neat too.
Comment 1 ⚡Static⚡ 2010-09-09 01:22:32 UTC
So, anyone know what source files I should edit? Or is there some other file which defines this?
Comment 2 José Aliste 2010-09-09 01:53:31 UTC
Please be more verbose describing the bug. Can you describe why it's not practical? what do you propose to make it better?
Comment 3 ⚡Static⚡ 2010-09-09 02:15:13 UTC
In HTML, it only highlights the "<" and ">" brackets. This isn't very helpful, as it is quite easy to find the end of a tag. What would be better is to highlight both the start and end tags.
Examples where the stars mark where it should highlight.
Currently Highlights:
<div class="example">Write stuff here</div>
*-------------------*----------------------
Should Highlights:

<div class="example">Write stuff here</div>
*********************----------------******


I propose making a file in which you can define a regex for each language to highlight certain brackets for a certain language.
Example file layout:

HTML:
start:"/<.*?>/"
end:"/<\/.*?>/"

C:
start:"/{/"
end:"/}/"

Oh, and this is an enhancement, not a bug.
Comment 4 José Aliste 2010-09-09 13:33:34 UTC
Well, there is already infrastructure for that, but I believe that what you want is not currently possible. You should look for the lang files in your system and if you crae to look the code it is gtksourcecontextengine. Please take into account that managing a real-time parse of a file is not an easy task. Anyway, if you wish to work on it, you'd be more than welcome.
Comment 5 ⚡Static⚡ 2010-09-09 19:05:00 UTC
I'm not sure where to look. I'm running an Ubuntu system, and I found the following which seems relevant.
/usr/share/gtksourceview-2.0/language-specs

I cannot find gtksourcecontextengine though. I have the source for version 2.90.0.
Comment 6 Sébastien Wilmet 2013-05-19 16:39:00 UTC

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