From ee19eda2e3b2c7e627c94e0daf9c93ab17027ab1 Mon Sep 17 00:00:00 2001 From: bhagwan Date: Thu, 7 Jul 2022 22:30:53 -0700 Subject: [PATCH] feat: 'diagnostics.icon_padding' for extra wide icons (#470) --- README.md | 3 ++- doc/fzf-lua.txt | 3 ++- lua/fzf-lua/providers/diagnostic.lua | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9ab7650..1ed3b9c 100644 --- a/README.md +++ b/README.md @@ -829,10 +829,11 @@ require'fzf-lua'.setup { }, diagnostics ={ prompt = 'Diagnostics❯ ', - cwd_only = false, -- limit to cwd only? + cwd_only = false, file_icons = true, git_icons = false, diag_icons = true, + icon_padding = '', -- add padding for wide diagnostics signs -- by default icons and highlights are extracted from 'DiagnosticSignXXX' -- and highlighted by a highlight group of the same name (which is usually -- set by your colorscheme, for more info see: diff --git a/doc/fzf-lua.txt b/doc/fzf-lua.txt index 0916e50..914d52b 100644 --- a/doc/fzf-lua.txt +++ b/doc/fzf-lua.txt @@ -868,10 +868,11 @@ open an issue and I'll be more than happy to help.** }, diagnostics ={ prompt = 'Diagnostics❯ ', - cwd_only = false, -- limit to cwd only? + cwd_only = false, file_icons = true, git_icons = false, diag_icons = true, + icon_padding = '', -- add padding for wide diagnostics signs -- by default icons and highlights are extracted from 'DiagnosticSignXXX' -- and highlighted by a highlight group of the same name (which is usually -- set by your colorscheme, for more info see: diff --git a/lua/fzf-lua/providers/diagnostic.lua b/lua/fzf-lua/providers/diagnostic.lua index cd544db..d75b998 100644 --- a/lua/fzf-lua/providers/diagnostic.lua +++ b/lua/fzf-lua/providers/diagnostic.lua @@ -170,7 +170,8 @@ M.diagnostics = function(opts) if opts.color_icons then icon = utils.ansi_from_hl(value.texthl, icon) end - entry = icon .. utils.nbsp .. utils.nbsp .. entry + entry = string.format("%s%s%s%s", + icon, opts.icon_padding or '', utils.nbsp, entry) end fzf_cb(entry, function() coroutine.resume(co) end) end