Skip to content

Commit

Permalink
docs: update icon_fetcher usage and example
Browse files Browse the repository at this point in the history
  • Loading branch information
eph authored and eph committed Dec 27, 2024
1 parent a3717e7 commit 9bab554
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,24 @@ symbols = {
}
```

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.

- You can customize the split command used for creating the outline window split
Expand Down

0 comments on commit 9bab554

Please sign in to comment.