diff options
| author | Christian Chiarulli <[email protected]> | 2022-10-07 04:52:37 +0000 | 
|---|---|---|
| committer | GitHub <[email protected]> | 2022-10-07 00:52:37 -0400 | 
| commit | dcdfbf1727731c6779396ce450a6b9d33849f835 (patch) | |
| tree | b59fe8c33cb966b6d05f8d5c1e7bb57d2d06b339 /lua | |
| parent | 9dfb9ef250ba3e5a6696d8719cc2ff6b3e2ebdea (diff) | |
feat: use icon for copilot in statusline (#3173)
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/lvim/core/lualine/components.lua | 17 | 
1 files changed, 15 insertions, 2 deletions
| diff --git a/lua/lvim/core/lualine/components.lua b/lua/lvim/core/lualine/components.lua index badece1e..91411d64 100644 --- a/lua/lvim/core/lualine/components.lua +++ b/lua/lvim/core/lualine/components.lua @@ -16,6 +16,7 @@ local statusline_hl = vim.api.nvim_get_hl_by_name("StatusLine", true)  local cursorline_hl = vim.api.nvim_get_hl_by_name("CursorLine", true)  local normal_hl = vim.api.nvim_get_hl_by_name("Normal", true) +vim.api.nvim_set_hl(0, "SLCopilot", { fg = "#6CC644", bg = "NONE" })  vim.api.nvim_set_hl(0, "SLGitIcon", { fg = "#E8AB53", bg = cursorline_hl.background })  vim.api.nvim_set_hl(0, "SLBranchName", { fg = normal_hl.foreground, bg = cursorline_hl.background })  vim.api.nvim_set_hl(0, "SLProgress", { fg = "#ECBE7B", bg = statusline_hl.background }) @@ -122,12 +123,17 @@ return {        end        local buf_ft = vim.bo.filetype        local buf_client_names = {} +      local copilot_active = false        -- add client        for _, client in pairs(buf_clients) do -        if client.name ~= "null-ls" then +        if client.name ~= "null-ls" and client.name ~= "copilot" then            table.insert(buf_client_names, client.name)          end + +        if client.name == "copilot" then +          copilot_active = true +        end        end        -- add formatter @@ -141,7 +147,14 @@ return {        vim.list_extend(buf_client_names, supported_linters)        local unique_client_names = vim.fn.uniq(buf_client_names) -      return "[" .. table.concat(unique_client_names, ", ") .. "]" + +      local language_servers = "[" .. table.concat(unique_client_names, ", ") .. "]" + +      if copilot_active then +        language_servers = language_servers .. "%#SLCopilot#" .. " " .. lvim.icons.git.Octoface .. "%*" +      end + +      return language_servers      end,      separator = separator,      color = { gui = "bold" }, | 
