diff --git a/docs/changelog.rst b/docs/changelog.rst index 2a8d93308..943f05b69 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -25,6 +25,7 @@ To update |kitty|, :doc:`follow the instructions `. - Linux: Allow using fonts with spacing=90 in addition to fonts with spacing=100 (:iss:`1968`) +- Use selection foreground color for underlines as well (:iss:`1982`) 0.14.4 [2019-08-31] --------------------- diff --git a/kitty/cell_vertex.glsl b/kitty/cell_vertex.glsl index 44e58accd..11b58259d 100644 --- a/kitty/cell_vertex.glsl +++ b/kitty/cell_vertex.glsl @@ -172,13 +172,15 @@ void main() { foreground = color_to_vec(resolved_fg); float has_dim = float((text_attrs >> DIM_SHIFT) & ONE); effective_text_alpha = inactive_text_alpha * mix(1.0, dim_opacity, has_dim); -#ifdef USE_SELECTION_FG - // Selection - foreground = choose_color(float(is_selected & ONE), color_to_vec(highlight_fg), foreground); -#endif - // Underline and strike through (rendered via sprites) float in_url = float((is_selected & TWO) >> 1); decoration_fg = choose_color(in_url, color_to_vec(url_color), to_color(colors[2], resolved_fg)); +#ifdef USE_SELECTION_FG + // Selection + vec3 selection_color = color_to_vec(highlight_fg); + foreground = choose_color(float(is_selected & ONE), selection_color, foreground); + decoration_fg = choose_color(float(is_selected & ONE), selection_color, decoration_fg); +#endif + // Underline and strike through (rendered via sprites) underline_pos = choose_color(in_url, to_sprite_pos(pos, url_style, ZERO, ZERO), to_sprite_pos(pos, (text_attrs >> DECORATION_SHIFT) & THREE, ZERO, ZERO)); strike_pos = to_sprite_pos(pos, ((text_attrs >> STRIKE_SHIFT) & ONE) * FOUR, ZERO, ZERO);