mirror of
https://github.com/neovim/neovim.git
synced 2025-10-01 15:38:33 +00:00
perf(highlight): allow decoration providers to skip ranges without data
Continuing the work of #31400 That PR allowed the provider to be invoked multiple times per line. We want only to do that when there actually is more data later on the line. Additionally, we want to skip over lines which contain no new highlight items. The TS query cursor already tells us what the next position with more data is, so there is no need to reinvoke the range callback before that. NB: this removes the double buffering introduced in #32619 which is funtamentally incompatible with this (nvim core is supposed to keep track of long ranges by itself, without requiring a callback reinvoke blitz). Need to adjust the priorities some other way to fix the same issue.
This commit is contained in:
@@ -1051,6 +1051,13 @@ void nvim_buf_clear_namespace(Buffer buffer, Integer ns_id, Integer line_start,
|
||||
/// ```
|
||||
/// ["range", winid, bufnr, begin_row, begin_col, end_row, end_col]
|
||||
/// ```
|
||||
///
|
||||
/// In addition to returning a boolean, it is also allowed to
|
||||
/// return a `skip_row, skip_col` pair of integers. This implies
|
||||
/// that this function does not need to be called until a range
|
||||
/// which continues beyond the skipped position. A single integer
|
||||
/// return value `skip_row` is short for `skip_row, 0`
|
||||
///
|
||||
/// - on_end: called at the end of a redraw cycle
|
||||
/// ```
|
||||
/// ["end", tick]
|
||||
|
Reference in New Issue
Block a user