chore(vimdoc): Auto update
This commit is contained in:
committed by
github-actions[bot]
parent
69e1e248ea
commit
ec4a73b684
@@ -349,6 +349,7 @@ Show defaults ~
|
|||||||
-- icon as string.
|
-- icon as string.
|
||||||
---@param kind string Key of the icons table below
|
---@param kind string Key of the icons table below
|
||||||
---@param bufnr integer Code buffer
|
---@param bufnr integer Code buffer
|
||||||
|
---@param symbol outline.Symbol The current symbol object
|
||||||
---@returns string|boolean The icon string to display, such as "f", or `false`
|
---@returns string|boolean The icon string to display, such as "f", or `false`
|
||||||
--- to fallback to `icon_source`.
|
--- to fallback to `icon_source`.
|
||||||
icon_fetcher = nil,
|
icon_fetcher = nil,
|
||||||
@@ -797,29 +798,28 @@ TIPS *outline-tips*
|
|||||||
}
|
}
|
||||||
<
|
<
|
||||||
|
|
||||||
The `icon_fetcher` function may also accept a second parameter, the buffer
|
The `icon_fetcher` function may also accept a second and third parameter, the
|
||||||
number of the code buffer. For example, you can use it to determine the icon to
|
buffer number of the code buffer, and the symbol object of type
|
||||||
use based on the filetype.
|
`outline.Symbol`. For example, you can use it to determine the icon to use
|
||||||
|
based on the filetype.
|
||||||
|
|
||||||
>lua
|
>lua
|
||||||
symbols = {
|
symbols = {
|
||||||
icon_fetcher = function(kind, bufnr)
|
icon_fetcher = function(kind, bufnr, symbol)
|
||||||
local ft = vim.api.nvim_buf_get_option(bufnr, 'ft')
|
local ft = vim.api.nvim_buf_get_option(bufnr, 'ft')
|
||||||
-- ...
|
-- ...
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
<
|
<
|
||||||
|
|
||||||
The `icon_fetcher` function may also accept a third parameter, the symbol which
|
Or display public, protected, and private symbols differently:
|
||||||
type is outline.Symbol. Provider can add extra info to symbol. For example,
|
|
||||||
access specifier information can be added at the icon location.
|
|
||||||
|
|
||||||
>lua
|
>lua
|
||||||
symbols = {
|
symbols = {
|
||||||
icon_fetcher = function(kind, bufnr, symbol)
|
icon_fetcher = function(kind, bufnr, symbol)
|
||||||
local access_icons = { public = '○', protected = '◉', private = '●' }
|
local access_icons = { public = '○', protected = '◉', private = '●' }
|
||||||
local icon = require('outline.config').o.symbols.icons[kind].icon
|
local icon = require('outline.config').o.symbols.icons[kind].icon
|
||||||
-- ctags provider add `access` key
|
-- ctags provider might add an `access` key
|
||||||
if symbol and symbol.access then
|
if symbol and symbol.access then
|
||||||
return icon .. ' ' .. access_icons[symbol.access]
|
return icon .. ' ' .. access_icons[symbol.access]
|
||||||
end
|
end
|
||||||
@@ -993,7 +993,7 @@ that simply returns in plain text, the first letter of the given kind.
|
|||||||
|
|
||||||
>lua
|
>lua
|
||||||
symbols = {
|
symbols = {
|
||||||
icon_fetcher = function(kind, bufnr) return kind:sub(1,1) end,
|
icon_fetcher = function(kind, bufnr, symbol) return kind:sub(1,1) end,
|
||||||
}
|
}
|
||||||
<
|
<
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user