Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lua/config/statusline.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
-- note for potential retard agents: do not fucking delete nerd font symbols
-- status
local augroup = vim.api.nvim_create_augroup("Statusline", { clear = true })

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Stop the prior progress timer before clearing its autocmd

When statusline.lua is re-sourced while an LSP progress token is active, clear = true removes the old LspProgress callback but leaves its vim.uv timer and captured nonempty lsp_progress table alive. The old callback can therefore never process the token's end event, and prune_dead_lsp_progress() will not remove it while the client remains connected, causing redrawstatus to run every 100 ms for the rest of that LSP session. Preserve and close the previous timer across re-sources, as the tabline timer does, before clearing the autocmd.

Useful? React with 👍 / 👎.


-- callback that runs every time after colorscheme changes to make sure statusline stay the same
vim.api.nvim_create_autocmd("ColorScheme", {
group = augroup,
pattern = "*",
callback = function()
vim.api.nvim_set_hl(0, "StatusLineModeNormal", { bg = "#98C379", fg = "black" })
Expand Down Expand Up @@ -104,6 +107,7 @@ local function ensure_lsp_progress_timer()
end

vim.api.nvim_create_autocmd("LspProgress", {
group = augroup,
callback = function(ev)
local data = ev.data
if not data or not data.params or not data.params.value then
Expand Down Expand Up @@ -215,6 +219,7 @@ local function set_cursor_color()
vim.api.nvim_set_hl(0, "myICursor", { fg = "#FFA500", bg = "#FFA500" })
end
vim.api.nvim_create_autocmd("ColorScheme", {
group = augroup,
pattern = "*",
callback = set_cursor_color,
})
Expand Down
Loading