aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/private/helpers.c
diff options
context:
space:
mode:
authorJaehwang Jung <tomtomjhj@gmail.com>2023-12-17 15:25:15 +0900
committerLewis Russell <me@lewisr.dev>2023-12-17 15:40:59 +0000
commitc0cb1e8e9437b738c8d3232ec4594113d2221bb2 (patch)
treedcd7f210f11f36daad267b26ca1a366d36ca33b1 /src/nvim/api/private/helpers.c
parentf0eb3ca9163ad10753fbb75558b900a539f76e0d (diff)
downloadrneovim-c0cb1e8e9437b738c8d3232ec4594113d2221bb2.tar.gz
rneovim-c0cb1e8e9437b738c8d3232ec4594113d2221bb2.tar.bz2
rneovim-c0cb1e8e9437b738c8d3232ec4594113d2221bb2.zip
perf(treesitter): filter out trees outside the visible range early
Problem: Treesitter highlighter's on_line was iterating all the parsed trees, which can be quite a lot when injection is used. This may slow down scrolling and cursor movement in big files with many comment injections (e.g., lsp/_meta/protocol.lua). Solution: In on_win, collect trees inside the visible range, and use them in on_line. NOTE: This optimization depends on the correctness of on_win's botline_guess parameter (i.e., it's always greater than or equal to the line numbers passed to on_line). The documentation does not guarantee this, but I have never noticed a problem so far.
Diffstat (limited to 'src/nvim/api/private/helpers.c')
0 files changed, 0 insertions, 0 deletions