Skip to content

Commit 59f318a

Browse files
phanenlewis6991
authored andcommitted
fix: #627
1 parent 1a1a7c5 commit 59f318a

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

lua/treesitter-context/context.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@ local function trim_contexts(context_ranges, context_lines, trim, top)
168168
while trim > 0 do
169169
local idx = top and 1 or #context_ranges
170170
local context_to_trim = context_ranges[idx]
171+
if not context_to_trim then
172+
return
173+
end
171174

172175
local height = util.get_range_height(context_to_trim)
173176

test/ts_context_spec.lua

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,15 @@ describe('ts_context', function()
105105
})
106106
end)
107107

108+
it('#627', function()
109+
exec_lua(install_langs, { 'vimdoc' })
110+
exec_lua(tc_helpers.setup, { multiwindow = true })
111+
cmd('edit test/snapshots/snapshot.md')
112+
cmd('set splitkeep=screen')
113+
cmd('help')
114+
cmd('sleep 100m')
115+
end)
116+
108117
describe('language:', function()
109118
before_each(function()
110119
exec_lua(tc_helpers.setup, {

0 commit comments

Comments
 (0)