From 565e76bdfa59447e383bb66184c4b4398f33840e Mon Sep 17 00:00:00 2001 From: bhagwan Date: Thu, 15 Jul 2021 08:57:20 -0700 Subject: [PATCH] fixed default when devicon returns nil --- lua/fzf-lua/core.lua | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lua/fzf-lua/core.lua b/lua/fzf-lua/core.lua index a20d937..f295cf9 100644 --- a/lua/fzf-lua/core.lua +++ b/lua/fzf-lua/core.lua @@ -8,15 +8,14 @@ local M = {} -- invisible unicode char as icon|git separator -- this way we can split our string by space -nbsp = "\u{00a0}" +local nbsp = "\u{00a0}" M.get_devicon = function(file, ext) - local icon = nbsp + local icon = '' if not file or #file == 0 then return icon end if config._has_devicons then - icon = require'nvim-web-devicons'.get_icon(file, ext) - else - icon = utils._if(icon == nil, '', icon) + local devicon = require'nvim-web-devicons'.get_icon(file, ext) + if devicon then icon = devicon end end return icon end