fixed filetype icon bug

This commit is contained in:
hoob3rt 2021-01-06 00:43:36 +01:00
parent 6da4406a5a
commit 710d5ad838
3 changed files with 14 additions and 7 deletions

View File

@ -102,11 +102,18 @@ local function statusline(is_focused)
return table.concat(status) return table.concat(status)
end end
function M.set_active_statusline()
vim.wo.statusline = statusline(1)
end
function M.set_inactive_statusline()
vim.wo.statusline = statusline()
end
local function exec_autocommands() local function exec_autocommands()
_G.statusline = statusline
_G.set_lualine_theme = set_lualine_theme _G.set_lualine_theme = set_lualine_theme
vim.cmd([[autocmd WinEnter,BufEnter * setlocal statusline=%!v:lua.statusline(1)]]) vim.cmd([[autocmd WinEnter,BufEnter * lua require('lualine').set_active_statusline()]])
vim.cmd([[autocmd WinLeave,BufLeave * setlocal statusline=%!v:lua.statusline()]]) vim.cmd([[autocmd WinLeave,BufLeave * lua require('lualine').set_inactive_statusline()]])
vim.cmd([[autocmd ColorScheme * call v:lua.set_lualine_theme()]]) vim.cmd([[autocmd ColorScheme * call v:lua.set_lualine_theme()]])
end end

View File

@ -26,7 +26,7 @@ local function branch()
end end
return git_branch return git_branch
end end
ok = (vim.fn.exists('*WebDevIconsGetFileTypeSymbol')) ok = vim.fn.exists("*WebDevIconsGetFileTypeSymbol")
if ok ~= 0 then if ok ~= 0 then
local icon = '' local icon = ''
return icon .. ' ' .. git_branch return icon .. ' ' .. git_branch

View File

@ -10,9 +10,9 @@ local function filetype()
end end
return data return data
end end
ok = (vim.fn.exists('*WebDevIconsGetdataSymbol')) ok = vim.fn.exists("*WebDevIconsGetFileTypeSymbol")
if ok ~= 0 then if ok ~= 0 then
local icon = vim.call('WebDevIconsGetdataSymbol') local icon = vim.fn.WebDevIconsGetFileTypeSymbol()
return icon .. ' ' .. data return icon .. ' ' .. data
end end
return data return data