diff --git a/README.md b/README.md index 67433ea..ad0f462 100644 --- a/README.md +++ b/README.md @@ -918,6 +918,24 @@ symbols = { -- ... end, } +``` + + The `icon_fetcher` function may also accept a third parameter, the symbol + which type is outline.Symbol. Provider can add extra info to symbol. + For example, access specifier information can be added at the icon location. + +```lua +symbols = { + icon_fetcher = function(kind, bufnr, symbol) + local access_icons = { public = '○', protected = '◉', private = '●' } + local icon = require('outline.config').o.symbols.icons[kind].icon + -- ctags provider add `access` key + if symbol and symbol.access then + return icon .. ' ' .. access_icons[symbol.access] + end + return icon + end, +} ``` See [this section](#custom-icons) for other examples of this function.