Skip to content

Commit 96e821e

Browse files
authored
fix: check if title ranges is the empty table (#266)
1 parent b39bd43 commit 96e821e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lua/plenary/window/border.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ function Border._create_lines(content_win_options, border_win_options)
164164
end
165165

166166
local set_title_highlights = function(bufnr, ranges, hl)
167-
if hl and ranges then
167+
-- Check if both `hl` and `ranges` are provided, and `ranges` is not the empty table.
168+
if hl and ranges and next(ranges) then
168169
for _, r in pairs(ranges) do
169170
vim.api.nvim_buf_add_highlight(bufnr, -1, hl, r[1], r[2], r[3])
170171
end

0 commit comments

Comments
 (0)