Skip to content

Commit

Permalink
fix(configs,sources.path): concat nil when icons disabled (#190)
Browse files Browse the repository at this point in the history
  • Loading branch information
bekaboo committed Oct 31, 2024
1 parent 9d8cad9 commit 28bcb1c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,19 +301,19 @@ vim.ui.select = require('dropbar.utils.menu').select
icons = {
enable = true,
kinds = {
---Directory icon and highlighting getter, set to `false` to disable
---Directory icon and highlighting getter, set to empty string to disable
---@param path string path to the directory
---@return string: icon for the directory
---@return string?: highlight group for the icon
---@type fun(path: string): string, string?|false
---@type fun(path: string): string, string?|string?
dir_icon = function(_)
return M.opts.icons.kinds.symbols.Folder, 'DropBarIconKindFolder'
end,
---File icon and highlighting getter, set to `false` to disable
---File icon and highlighting getter, set to empty string to disable
---@param path string path to the file
---@return string: icon for the file
---@return string?: highlight group for the icon
---@type fun(path: string): string, string?|false
---@type fun(path: string): string, string?|string?
file_icon = function(path)
local icon_kind_opts = M.opts.icons.kinds
local file_icon = icon_kind_opts.symbols.File
Expand Down Expand Up @@ -1443,16 +1443,16 @@ used by the plugin:
- `opts.icons.enable`: `boolean`
- Whether to enable icons
- Default: `true`
- `opts.icons.kinds.dir_icon`: `fun(path: string): string, string?|false`
- Directory icon and highlighting getter, set to `false` to disable
- `opts.icons.kinds.dir_icon`: `fun(path: string): string, string?|string?`
- Directory icon and highlighting getter, set to empty string to disable
- Default:
```lua
function(_)
return M.opts.icons.kinds.symbols.Folder, 'DropBarIconKindFolder'
end
```
- `opts.icons.kinds.file_icon`: `fun(path: string): string, string?|false`
- File icon and highlighting getter, set to `false` to disable
- `opts.icons.kinds.file_icon`: `fun(path: string): string, string?|string?`
- File icon and highlighting getter, set to empty string to disable
- Default:
```lua
function(path)
Expand Down
8 changes: 4 additions & 4 deletions doc/dropbar.txt
Original file line number Diff line number Diff line change
Expand Up @@ -684,16 +684,16 @@ by the plugin:
- `opts.icons.enable`: `boolean`
- Whether to enable icons
- Default: `true`
- `opts.icons.kinds.dir_icon`: `fun(path: string): string, string?|false`
- Directory icon and highlighting getter, set to `false` to disable
- `opts.icons.kinds.dir_icon`: `fun(path: string): string, string?|string?`
- Directory icon and highlighting getter, set to empty string to disable
- Default: >lua

function(_)
return M.opts.icons.kinds.symbols.Folder, 'DropBarIconKindFolder'
end
<
- `opts.icons.kinds.file_icon`: `fun(path: string): string, string?|false`
- File icon and highlighting getter, set to `false` to disable
- `opts.icons.kinds.file_icon`: `fun(path: string): string, string?|string?`
- File icon and highlighting getter, set to empty string to disable
- Default: >lua

function(path)
Expand Down
12 changes: 6 additions & 6 deletions lua/dropbar/configs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ M.opts = {
icons = {
enable = true,
kinds = {
---Directory icon and highlighting getter, set to `false` to disable
---Directory icon and highlighting getter, set to empty string to disable
---@param path string path to the directory
---@return string: icon for the directory
---@return string?: highlight group for the icon
---@type fun(path: string): string, string?|false
---@type fun(path: string): string, string?|string?
dir_icon = function(_)
return M.opts.icons.kinds.symbols.Folder, 'DropBarIconKindFolder'
end,
---File icon and highlighting getter, set to `false` to disable
---File icon and highlighting getter, set to empty string to disable
---@param path string path to the file
---@return string: icon for the file
---@return string?: highlight group for the icon
---@type fun(path: string): string, string?|false
---@type fun(path: string): string, string?|string?
file_icon = function(path)
local icon_kind_opts = M.opts.icons.kinds
local file_icon = icon_kind_opts.symbols.File
Expand Down Expand Up @@ -771,8 +771,8 @@ function M.set(new_opts)
return ' '
end,
})
M.opts.icons.kinds.dir_icon = false
M.opts.icons.kinds.file_icon = false
M.opts.icons.kinds.dir_icon = ''
M.opts.icons.kinds.file_icon = ''
M.opts.icons.kinds.symbols = blank_icons
M.opts.icons.ui.bar = blank_icons
M.opts.icons.ui.menu = blank_icons
Expand Down

0 comments on commit 28bcb1c

Please sign in to comment.