fixed filetype icon bug
This commit is contained in:
parent
6da4406a5a
commit
710d5ad838
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue