GTK4 with gtksourceview5 in C: How do i change the style of the current highlited line?
07:10 25 Nov 2025

I tried using the GTK inspector to try and find the correct css node for but to no avail

I tried every selector i could think of like

.GtkSourceView.sourceview.view text .current-line  

or even simpler ones

.GtkSourceView current-line

and the list goes on

I also dint really find anything in their documentation (both GTK and gtkviewsource) to help me

I activated the current line hightlight with

gtk_source_view_set_highlight_current_line(GTK_SOURCE_VIEW(global_editor->source_view), TRUE);

these are the CSS nodes that worked:

.GtkSourceView {
    background-color: black;
    color: red;
    
}

.GtkSourceView gutter {
    background-color: #252526;
    border-right: 1px solid #3c3c3c;
    padding: 0 4px;
}

.GtkSourceView selection {
    color: red;
    background-color: yellow;
}

.GtkSourceView gutterrenderer {
    color:yellowgreen; 
}

here is the hightlight im talking about: gtksourceview5 highlight example

another highlight example

c gtk4 gtksourceview