macvim-dev / macvim-dev/macvim
Mac ligature rendering results in slow scrolling when cursorline is not set
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Vim Script
- Sterne
- 7.9k
- Forks
- 691
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne bei MacVims Funktion redraw_for_ligature und vergleiche sie mit den Vim-Änderungen in den Commits 90a997987d, 1b7fefcbce und bd9a53c06c. Reproduziere die Verzögerung mit macligature, nocursorline und norelativenumber unter Verwendung des mitgelieferten Benchmarks in einer großen Datei. Als erledigt gilt die Aufgabe, wenn beim Scrollen nicht mehr der gesamte Bildschirm neu gezeichnet wird und Ligaturen bei aktiviertem cursorline korrekt bleiben.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- macos, vim
- Bereich
- desktop, performance
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 38/100