macvim-dev / macvim-dev/macvim

Mac ligature rendering results in slow scrolling when cursorline is not set

Abierto
#746 2 comentarios 2 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Lenguaje dominante
Vim Script
Estrellas
7.9k
Forks
691
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Update to the latest version of MacVim and make sure to do this:

set macligature
set nocursorline
set norelativenumber

Scroll up and down using a trackpad, and make sure to use a high enough resolution screen so the lag is noticeable. To have a reproducible benchmark, you can also maximize MacVim, open a large file, and run this Ex command from the top of the file:

let g:profstart=reltime() | for i in range(1,30) | exec "normal \<C-E>" | redraw | endfor | echo reltimestr(reltime(g:profstart)) . " seconds"

This happens because in Vim, a couple commits went in to make sure cursorline (90a997987d and 1b7fefcbce) and relativenumber (bd9a53c06c) don't cause scrolling performance issues, but MacVim's ligature rendering function redraw_for_ligature is copied from the old redraw_for_cursorline which redraws the whole screen when scrolling instead of only updating the selected lines. I don't know if redraw_for_ligature can be so easily updated though, because it would require scanning the lines to see which line needs to be redrawn.

I think there's also currently a bug as a result, in that if cursorline is set, ligatures won't render correctly when you scroll because redraw_for_ligature explicitly decides not to do anything if it detects cursorline is on probably because it was relying on the old "clear everything" behavior.

Guía de contribución

Abrir la guía de contribución

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.

Línea de trabajo

Comienza en la función redraw_for_ligature de MacVim y compárala con los cambios de Vim en los commits 90a997987d, 1b7fefcbce y bd9a53c06c. Reproduce el retraso con macligature, nocursorline y norelativenumber usando el benchmark proporcionado en un archivo grande. Se considera terminado cuando desplazarse ya no redibuja toda la pantalla y las ligaduras siguen siendo correctas cuando cursorline está habilitado.

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

Evaluación

Stack tecnológico
macos, vim
Área
desktop, performance
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
38/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.