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

@ -23,7 +23,7 @@ M.inactive_sections = {
lualine_c = { 'filename' },
lualine_x = { 'location' },
lualine_y = { },
lualine_z = { }
lualine_z = { }
}
M.extensions = {
@ -102,11 +102,18 @@ local function statusline(is_focused)
return table.concat(status)
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()
_G.statusline = statusline
_G.set_lualine_theme = set_lualine_theme
vim.cmd([[autocmd WinEnter,BufEnter * setlocal statusline=%!v:lua.statusline(1)]])
vim.cmd([[autocmd WinLeave,BufLeave * setlocal statusline=%!v:lua.statusline()]])
vim.cmd([[autocmd WinEnter,BufEnter * lua require('lualine').set_active_statusline()]])
vim.cmd([[autocmd WinLeave,BufLeave * lua require('lualine').set_inactive_statusline()]])
vim.cmd([[autocmd ColorScheme * call v:lua.set_lualine_theme()]])
end

View File

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

View File

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