fix(dap.hover): change format of expand marker
This commit is contained in:
@@ -212,16 +212,9 @@ end
|
|||||||
|
|
||||||
---@param content ow.dap.hover.Content
|
---@param content ow.dap.hover.Content
|
||||||
function Node:format_into(content)
|
function Node:format_into(content)
|
||||||
if self:is_expandable() then
|
|
||||||
local marker = self.is_expanded and "-" or "+"
|
|
||||||
content:add(marker .. " ", "@comment")
|
|
||||||
else
|
|
||||||
content:add(" ")
|
|
||||||
end
|
|
||||||
|
|
||||||
local tree_prefix = self:get_tree_prefix()
|
local tree_prefix = self:get_tree_prefix()
|
||||||
if tree_prefix ~= "" then
|
if tree_prefix ~= "" then
|
||||||
content:add(tree_prefix, "@comment")
|
content:add(tree_prefix, "DapHoverPrefix")
|
||||||
end
|
end
|
||||||
|
|
||||||
local text
|
local text
|
||||||
@@ -232,6 +225,17 @@ function Node:format_into(content)
|
|||||||
end
|
end
|
||||||
|
|
||||||
content:add_with_treesitter(text, self.lang)
|
content:add_with_treesitter(text, self.lang)
|
||||||
|
|
||||||
|
if self:is_expandable() then
|
||||||
|
if self.is_expanded then
|
||||||
|
for _, child in ipairs(self.children) do
|
||||||
|
content:newline()
|
||||||
|
child:format_into(content)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
content:add(" ...", "DapHoverExpandMarker")
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
---@async
|
---@async
|
||||||
|
|||||||
@@ -17,6 +17,21 @@ Window.__index = Window
|
|||||||
Window.NAMESPACE = "ow.dap.hover.Window"
|
Window.NAMESPACE = "ow.dap.hover.Window"
|
||||||
Window.NS_ID = vim.api.nvim_create_namespace(Window.NAMESPACE)
|
Window.NS_ID = vim.api.nvim_create_namespace(Window.NAMESPACE)
|
||||||
|
|
||||||
|
local function setup_highlights()
|
||||||
|
vim.api.nvim_set_hl(0, "DapHoverPrefix", {
|
||||||
|
link = "@comment",
|
||||||
|
})
|
||||||
|
vim.api.nvim_set_hl(0, "DapHoverExpandMarker", {
|
||||||
|
link = "@comment",
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
setup_highlights()
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("ColorScheme", {
|
||||||
|
callback = setup_highlights,
|
||||||
|
})
|
||||||
|
|
||||||
local instance = nil
|
local instance = nil
|
||||||
|
|
||||||
---@param session dap.Session
|
---@param session dap.Session
|
||||||
|
|||||||
Reference in New Issue
Block a user