UI highlight groups are drawn in the wrong color after too many different highlighting attributes are used

Abierto
#21,976 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 13 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
c, vim

Línea de trabajo

Start in src/highlight.c at get_attr_entry(), where clearing the highlight tables triggers the redraw. Read how highlight changes notify the screen and inspect the redraw behavior when many attributes are created; the report says setting need_highlight_changed there restores the expected colors. Done means the reproduction keeps LineNr red on blue after scrolling through the generated terminal output.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug
Steps to reproduce
  1. Save this as repro.vim (needs python3):
set termguicolors number
hi LineNr guifg=#ff0000 guibg=#0000ff
" print 80000 '#' characters, each with a different RGB foreground color
let s:py = 'import sys' .. "\n" .. 'for n in range(80000):' .. "\n"
      \ .. '  sys.stdout.write("\x1b[38;2;%d;%d;%dm#" % (n >> 16 & 255, n >> 8 & 255, n & 255) + ("\x1b[0m\r\n" if n % 200 == 199 else ""))'
let s:buf = term_start(['python3', '-c', s:py],
      \ {'hidden': 1, 'term_rows': 40, 'term_cols': 200,
      \  'exit_cb': {... -> timer_start(500, {... -> execute('buffer ' .. s:buf .. ' | redraw | echo "ready"', '')})}})
  1. In a terminal with true color support, run vim --clean -S repro.vim
  2. Wait until ready is shown in the command line
  3. Type gg, then <C-F> 10 times, then gg
  4. The line numbers are drawn blue on yellow
Expected behaviour

The line numbers are drawn red on blue.

Version of Vim

9.2.1373

Environment

Operating system: macOS 26.7.3 (arm64)
Terminal: WezTerm 20240203-110809-5046fc22, inside tmux 3.8
Value of $TERM: tmux-256color
Shell: bash 5.3.20

Logs and stack traces
# First two screen lines after step 4, captured with `tmux capture-pane -e`
# 9.2.1373, unpatched:
^[[38;2;0;0;255m^[[48;2;255;255;0m  1 ^[[38;2;0;0;0m^[[49m#...
^[[38;2;0;0;255m^[[48;2;255;255;0m  2 ^[[38;2;0;0;200m^[[49m#...
# with the change below applied:
^[[38;2;255;0;0m^[[48;2;0;0;255m  1 ^[[38;2;0;0;0m^[[49m#...
^[[38;2;255;0;0m^[[48;2;0;0;255m  2 ^[[38;2;0;0;200m^[[49m#...

--- a/src/highlight.c
+++ b/src/highlight.c
@@ -2836,6 +2836,7 @@ get_attr_entry(garray_T *table, attrentry_T *aep)
 
 	clear_hl_tables();
 
+	need_highlight_changed = TRUE;
 	set_must_redraw(UPD_CLEAR);
 
 	for (i = 0; i < highlight_ga.ga_len; ++i)
Lenguaje dominante
Vim Script
Estrellas
41.4k
Forks
6.2k
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de vim/vim

Todos los issues de vim/vim

Issues similares

Más issues de Web Dev

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.