2021-10-11 11:42:47 +00:00
|
|
|
-- Copyright (c) 2020-2021 shadmansaleh
|
|
|
|
-- MIT license, see LICENSE for more details.
|
|
|
|
local M = require('lualine.component'):extend()
|
|
|
|
local require = require('lualine_require').require
|
2022-01-02 11:38:39 +00:00
|
|
|
local git_branch = require('lualine.components.branch.git_branch')
|
2021-10-11 11:42:47 +00:00
|
|
|
|
|
|
|
-- Initilizer
|
|
|
|
M.init = function(self, options)
|
|
|
|
M.super.init(self, options)
|
|
|
|
if not self.options.icon then
|
|
|
|
self.options.icon = '' -- e0a0
|
|
|
|
end
|
|
|
|
git_branch.init()
|
|
|
|
end
|
|
|
|
|
|
|
|
M.update_status = function(_, is_focused)
|
|
|
|
return git_branch.get_branch((not is_focused and vim.fn.bufnr()))
|
|
|
|
end
|
|
|
|
|
|
|
|
return M
|