GNOME Bugzilla – Bug 349060
Draw a vertical line on the left gutter for matching brackets spanning multiple lines
Last modified: 2018-05-26 13:46:17 UTC
I added some lines to gtk_source_view_paint_margin to make it draw a vertical line starting from an opening bracket to the closing one (when they aren't on the same line). I find it extremely useful when you have a long statement and you want to easily find on what lines the statement itself begins and ends. It uses gtk_source_iter_find_matching_bracket to check for brackets and gtk_text_view_get_line_yrange to calculate where to draw the vertical line.
Created attachment 69808 [details] [review] added some lines to gtk_source_view_paint_margin
That is a very useful addition especially for the source code editing. In Anjuta the scintilla component has this feature and I would love if gtksourceview could also include it. Anyway, there should be an option to configure it. Regards, Johannes
(In reply to comment #2) > That is a very useful addition especially for the source code editing. In > Anjuta the scintilla component has this feature and I would love if > gtksourceview could also include it. > > Anyway, there should be an option to configure it. > > Regards, > Johannes > I added the option to enable/disable it and i modified test-widget.c accordingly. Please, let me know if you like it
Created attachment 69822 [details] [review] draw a vertical line on the left margin Added enable/disable option
Created attachment 69823 [details] [review] draw a vertical line on the left margin (tests) test-widget.c modified to support enabling/disabling of the feature added
Created attachment 69824 [details] [review] draw a vertical line on the left margin Added enabling/disabling of the feature
IMHO it is good now but I talked to the maintainers and they want to wait for GtkSourceView 2.0 which might have this feature together with code folding. Regards, Johannes
Yes, currently we are in the feature freeze period of the GNOME schedule so it will be some months before we can start adding new features. As Johannes said one of the things we plan is code-folding support, and code folding does something very similar showing in the margin how many lines the expanded fold takes
Patch would still be interesting! Any change to get this into 2.4?
What about adding this implementation until we have the code folding? Once we have the code folding we can do something like in kate. Adding different colors to show the regions.
I've updated the bug title. Normally it's now a better description. Sounds useful.
It's unlikely that this feature is ever going to be implemented, so I close the bug.