Skip to content

Commit 938003c

Browse files
isakbmlewis6991
authored andcommitted
fix(render): fixes #596 separator overlapping context
1 parent 4976d8b commit 938003c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lua/treesitter-context/context.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,11 @@ function M.get(bufnr, winid)
341341
for parents, query in iter_context_parents(bufnr, line_range) do
342342
for _, parent in ipairs(parents) do
343343
local parent_start_row = parent:range()
344-
local contexts_end_row = top_row + math.min(max_lines, contexts_height)
344+
345+
-- NOTE: this avoids covering up context by separator line
346+
local separator_offset = config.separator and 1 or 0
347+
348+
local contexts_end_row = top_row + separator_offset + math.min(max_lines, contexts_height)
345349

346350
-- Only process the parent if it is not in view.
347351
if parent_start_row < contexts_end_row then

0 commit comments

Comments
 (0)