mirror of
https://github.com/nvim-tree/nvim-web-devicons
synced 2024-09-16 13:44:06 +02:00
doc: add note to plugin authors to check before calling setup
This commit is contained in:
parent
cfde423c67
commit
5b1e78d22f
1 changed files with 14 additions and 0 deletions
14
README.md
14
README.md
|
@ -106,6 +106,20 @@ require'nvim-web-devicons'.setup {
|
|||
}
|
||||
```
|
||||
|
||||
#### Note To Plugin Authors
|
||||
|
||||
Please check that nvim-web-devicons has not already been setup first, to prevent clobbering user's overrides e.g.
|
||||
|
||||
```lua
|
||||
local has_devicons, devicons = pcall(require, "nvim-web-devicons")
|
||||
|
||||
if has_devicons then
|
||||
if not devicons.has_loaded() then
|
||||
devicons.setup()
|
||||
end
|
||||
---
|
||||
```
|
||||
|
||||
### Get Icon
|
||||
|
||||
Get the icon for a given file by passing in the `name`, the `extension` and an _optional_ options `table`.
|
||||
|
|
Loading…
Reference in a new issue