matchparen: improve match update mechanism
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- vim
- Ambito
- tooling
Direzione di ricerca
Start with Vim's matchparen implementation and reproduce the issue using vim --cmd 'autocmd TextChangedI * sleep 3' a.c, then type inside a pair of parentheses. Trace the highlight updates triggered by cursor movement and text changes. Done means slow updates no longer expose an intermediate incorrect highlight and duplicate highlight computations are reduced.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I mentioned this problem in a previous issue https://github.com/vim/vim/issues/20791, but at that time I did not provide a reproduction method.
If we have a '()' in a file a.c and open it with:
vim --cmd 'autocmd TextChangedI * sleep 3' a.c
then type text inside the (), we can see that the highlight stays in the wrong position the whole time.
The current matchparen mechanism removes the previous highlight after the text has changed, then recomputes the highlight and renders it. This means there is inevitably an intermediate moment where the highlight is wrong.
If the machine is slow, or if more work is added in TextChangedI, this becomes clearly visible. In particular, if the previous highlight position is replaced by a tab, it can go from one wrong highlight position to eight cells being highlighted at once, which is very noticeable.
I think that even when the computation is slow or there is a lot of work to do, it should still be possible to avoid showing an incorrect highlight.
After switching to a display with a lower refresh rate, I started seeing this intermediate incorrect highlight very frequently, and it became clearly visible.
I am not sure what the best update mechanism would be, but reducing the number of renders and avoiding any intermediate incorrect display seems like a good direction.
In the current matchparen, just entering a file triggers two highlight computations, and in Insert mode, typing a single character also triggers two highlight computations. I suspect this is because cursor movement and text change are both causing recomputation.
I understand this may be difficult to solve and the impact is limited, but I wanted to report it in case it can be improved.
- Lingua principale
- Vim Script
- Stelle
- 41.1k
- Fork
- 6.1k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di vim/vim
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 63/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
Clean up dependabot noiseApertaTask
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 87/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
owasp-dep-scan/dosai#79 ·
I maintainer di solito rispondono entro 1 giorno