mirror of
https://github.com/neovim/neovim.git
synced 2025-09-22 03:08:27 +00:00
fix(decorations): better approximation of botline #24794
Problem: * The guessed botline might be smaller than the actual botline e.g. when there are folds and the user is typing in insert mode. This may result in incorrect treesitter highlights for injections. * botline can be larger than the last line number of the buffer, which results in errors when placing extmarks. Solution: * Take a more conservative approximation. I am not sure if it is sufficient to guarantee correctness, but it seems to be good enough for the case mentioned above. * Clamp it to the last line number. Co-authored-by: Lewis Russell <me@lewisr.dev>
This commit is contained in:
@@ -1035,7 +1035,8 @@ void nvim_buf_clear_namespace(Buffer buffer, Integer ns_id, Integer line_start,
|
||||
/// window callbacks)
|
||||
/// ["buf", bufnr, tick]
|
||||
/// - on_win: called when starting to redraw a
|
||||
/// specific window.
|
||||
/// specific window. botline_guess is an approximation
|
||||
/// that does not exceed the last line number.
|
||||
/// ["win", winid, bufnr, topline, botline_guess]
|
||||
/// - on_line: called for each buffer line being redrawn.
|
||||
/// (The interaction with fold lines is subject to change)
|
||||
|
Reference in New Issue
Block a user