diff options
author | chaeing <[email protected]> | 2021-08-20 02:16:29 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2021-08-20 13:46:29 +0430 |
commit | 85fe093efb8353552171575809c02a5e9124fa68 (patch) | |
tree | d227b20217b08d894433fab2b3f10c5fc3297df4 /lua/core/lualine/utils.lua | |
parent | 59598723077ac6728fc585c3c88e0ec84ba430c3 (diff) |
[Feature] switch galaxyline to lualine (#1329)
Diffstat (limited to 'lua/core/lualine/utils.lua')
-rw-r--r-- | lua/core/lualine/utils.lua | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lua/core/lualine/utils.lua b/lua/core/lualine/utils.lua new file mode 100644 index 00000000..f2f29592 --- /dev/null +++ b/lua/core/lualine/utils.lua @@ -0,0 +1,24 @@ +local M = {} + +function M.validate_theme() + local theme = lvim.builtin.lualine.options.theme + + 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 |