feat(nvim): improve nvim-ufo folded display
This commit is contained in:
parent
2b721ac85b
commit
84ae1a0778
@ -12,7 +12,7 @@ return {
|
|||||||
-- Show numbers for fold text
|
-- Show numbers for fold text
|
||||||
local handler = function(virtText, lnum, endLnum, width, truncate)
|
local handler = function(virtText, lnum, endLnum, width, truncate)
|
||||||
local newVirtText = {}
|
local newVirtText = {}
|
||||||
local suffix = (" %d "):format(endLnum - lnum)
|
local suffix = (" {...} %d "):format(endLnum - lnum)
|
||||||
local sufWidth = vim.fn.strdisplaywidth(suffix)
|
local sufWidth = vim.fn.strdisplaywidth(suffix)
|
||||||
local targetWidth = width - sufWidth
|
local targetWidth = width - sufWidth
|
||||||
local curWidth = 0
|
local curWidth = 0
|
||||||
@ -38,13 +38,12 @@ return {
|
|||||||
return newVirtText
|
return newVirtText
|
||||||
end
|
end
|
||||||
|
|
||||||
local ft_options = { norg = "" }
|
local ft_options = { norg = "", octo = "" }
|
||||||
return {
|
return {
|
||||||
provider_selector = function(_, filetype, _)
|
provider_selector = function(_, filetype, _)
|
||||||
return ft_options[filetype] or { "treesitter", "indent" }
|
return ft_options[filetype] or { "treesitter", "indent" }
|
||||||
end,
|
end,
|
||||||
fold_virt_text_handler = handler,
|
fold_virt_text_handler = handler,
|
||||||
disabled = { "norg" },
|
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user