diff options
author | christianchiarulli <[email protected]> | 2021-08-29 14:17:32 -0400 |
---|---|---|
committer | christianchiarulli <[email protected]> | 2021-08-29 14:17:32 -0400 |
commit | ed5559d259e38a78796a7d81421f02ba6dafac4b (patch) | |
tree | afa9c00c017382bac547265a8a1e16b9770a07eb /lua/core/lualine/utils.lua | |
parent | e7b6d3b6f5982ea1042ffd499a7b85c18f0b782e (diff) | |
parent | c7a5122fe2c14dba0f28f1c077f838f957884afc (diff) |
Merge branch 'rolling' of github.com:ChristianChiarulli/LunarVim
Diffstat (limited to 'lua/core/lualine/utils.lua')
-rw-r--r-- | lua/core/lualine/utils.lua | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lua/core/lualine/utils.lua b/lua/core/lualine/utils.lua new file mode 100644 index 00000000..cf80a99e --- /dev/null +++ b/lua/core/lualine/utils.lua @@ -0,0 +1,27 @@ +local M = {} + +function M.validate_theme() + local theme = lvim.builtin.lualine.options.theme + if type(theme) == "table" then + return + end + + local lualine_loader = require "lualine.utils.loader" + local ok = pcall(lualine_loader.load_theme, theme) + if not ok then + lvim.builtin.lualine.options.theme = "auto" + end +end + +function M.env_cleanup(venv) + if string.find(venv, "/") then + local final_venv = venv + for w in venv:gmatch "([^/]+)" do + final_venv = w + end + venv = final_venv + end + return venv +end + +return M |