aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
diff options
context:
space:
mode:
authorVolodymyr Chernetskyi <19735328+chernetskyi@users.noreply.github.com>2026-09-04 18:25:14 +0200
committerChristian Clason <ch.clason+github@icloud.com>2026-09-06 19:36:32 +0200
commit5f1f5a8c2a00145eb4bfbb5979efa14934ef90cf (patch)
tree0b3d2e3688cdac00c64f8e158f3e92bb0af4ddf4 /runtime/lua/vim
parent2ac9dfc45dd58cfae61c87ab938c49a22c3d1801 (diff)
downloadrneovim-5f1f5a8c2a00145eb4bfbb5979efa14934ef90cf.tar.gz
rneovim-5f1f5a8c2a00145eb4bfbb5979efa14934ef90cf.tar.bz2
rneovim-5f1f5a8c2a00145eb4bfbb5979efa14934ef90cf.zip
fix(treesitter): conceal_lines is not applied to injected trees
Problem: TSHighlighter._on_conceal_line() parses with the range { row, row }. A Range2 has an exclusive end, so that is the empty range, and no injected region ever intercepts it. The root tree is parsed regardless, because its region is empty, so only injections are affected: conceal_lines metadata coming from an injected language's highlights query is dropped. on_range_impl() then records the row in _conceal_checked, so the miss persists until the buffer changes. For a markdown code block nested in a markdown code block, the inner fence delimiters stay visible and nvim_win_text_height() reports 5 rows where 3 are displayed. Solution: Pass the one-row range, as the on_range_impl() call below already does. AI-assisted
Diffstat (limited to 'runtime/lua/vim')
-rw-r--r--runtime/lua/vim/treesitter/highlighter.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/lua/vim/treesitter/highlighter.lua b/runtime/lua/vim/treesitter/highlighter.lua
index b5ddd28aa2..f7e22eb5ff 100644
--- a/runtime/lua/vim/treesitter/highlighter.lua
+++ b/runtime/lua/vim/treesitter/highlighter.lua
@@ -549,7 +549,7 @@ function TSHighlighter._on_conceal_line(_, _, buf, row)
-- Do not affect potentially populated highlight state.
local highlight_states = self._highlight_states
- self.tree:parse({ row, row })
+ self.tree:parse({ row, row + 1 })
self:prepare_highlight_states(row, row)
on_range_impl(self, buf, row, 0, row + 1, 0, false, true)
self._highlight_states = highlight_states