diff options
author | Jaehwang Jung <tomtomjhj@gmail.com> | 2023-12-17 15:25:15 +0900 |
---|---|---|
committer | Lewis Russell <me@lewisr.dev> | 2023-12-17 15:40:59 +0000 |
commit | c0cb1e8e9437b738c8d3232ec4594113d2221bb2 (patch) | |
tree | dcd7f210f11f36daad267b26ca1a366d36ca33b1 /src/nvim/lua/executor.c | |
parent | f0eb3ca9163ad10753fbb75558b900a539f76e0d (diff) | |
download | rneovim-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/lua/executor.c')
0 files changed, 0 insertions, 0 deletions