fix: Incorporate nesting depth in hover highlight
This commit is contained in:
@@ -253,6 +253,8 @@ function M.get_lines(flattened_outline_items)
|
|||||||
local hl_end = #string_prefix + #node.icon
|
local hl_end = #string_prefix + #node.icon
|
||||||
local hl_type = config.options.symbols[symbols.kinds[node.kind]].hl
|
local hl_type = config.options.symbols[symbols.kinds[node.kind]].hl
|
||||||
table.insert(hl_info, { node_line, hl_start, hl_end, hl_type })
|
table.insert(hl_info, { node_line, hl_start, hl_end, hl_type })
|
||||||
|
|
||||||
|
node.prefix_length = #string_prefix + #node.icon + 1
|
||||||
end
|
end
|
||||||
return lines, hl_info
|
return lines, hl_info
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -74,11 +74,13 @@ M.add_hover_highlights = function(bufnr, nodes)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local marker_fac = (config.options.fold_markers and 1) or 0
|
local marker_fac = (config.options.fold_markers and 1) or 0
|
||||||
|
if node.prefix_length then
|
||||||
ui.add_hover_highlight(
|
ui.add_hover_highlight(
|
||||||
bufnr,
|
bufnr,
|
||||||
node.line_in_outline - 1,
|
node.line_in_outline - 1,
|
||||||
(node.depth + marker_fac) * 2
|
node.prefix_length
|
||||||
)
|
)
|
||||||
|
end
|
||||||
::continue::
|
::continue::
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user