Skip to content

Commit

Permalink
Replaces: WhoIsSethDaniel/lualine-lsp-progress.nvim -> cuducos/lsp-pr…
Browse files Browse the repository at this point in the history
…ogress.nvim@ruby

See linrongbin16/lsp-progress.nvim#95
  • Loading branch information
cuducos committed Nov 7, 2023
1 parent c78a2ea commit 8e437ef
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
23 changes: 22 additions & 1 deletion .config/nvim/lua/config/lualine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,27 @@ local function search_count()
return string.format(" %d of %d", result.current, denominator)
end

require("lsp-progress").setup()

vim.api.nvim_create_augroup("lualine_augroup", { clear = true })
vim.api.nvim_create_autocmd("User", {
pattern = "LspProgressStatusUpdated",
group = "lualine_augroup",
callback = require("lualine").refresh,
})

local lsp_progress_or_yaml_key_value = function()
if vim.bo.filetype == "yaml" then
local yaml = require("yaml_nvim").get_yaml_key_and_value()
if string.len(yaml) <= 80 then
return yaml
end
return ""
end

return require("lsp-progress").progress()
end

require("lualine").setup({
options = {
theme = "catppuccin",
Expand All @@ -30,7 +51,7 @@ require("lualine").setup({
},
},
lualine_x = {
{ "lsp_progress", hide = { "copilot", "null-ls", "ruby_lsp", "yamlls" } },
{ lsp_progress_or_yaml_key_value, hide = { "copilot", "null-ls", "ruby_lsp" } },
search_count,
"diagnostics",
"fileformat",
Expand Down
2 changes: 1 addition & 1 deletion .config/nvim/lua/plugins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ local plugins = {
"hoob3rt/lualine.nvim",
dependencies = {
{ "nvim-tree/nvim-web-devicons", opt = true },
"WhoIsSethDaniel/lualine-lsp-progress.nvim",
{ "cuducos/lsp-progress.nvim", branch = "ruby" }, -- see https://github.com/linrongbin16/lsp-progress.nvim/pull/95
},
config = function()
require("config.lualine")
Expand Down

0 comments on commit 8e437ef

Please sign in to comment.