From 5f6abd34f5c12534df0d79ee3507d40106ad505d Mon Sep 17 00:00:00 2001 From: Maria Solano Date: Sun, 19 Apr 2026 16:05:51 -0700 Subject: [PATCH] fix(lsp): notify when maximum created `hl` groups is reached #39231 --- runtime/lua/vim/lsp/document_color.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/runtime/lua/vim/lsp/document_color.lua b/runtime/lua/vim/lsp/document_color.lua index 3799da4e8d..3f99787fbc 100644 --- a/runtime/lua/vim/lsp/document_color.lua +++ b/runtime/lua/vim/lsp/document_color.lua @@ -86,6 +86,10 @@ local function get_hl_group(hex_code, style) -- Limit number of created highlight groups to 10000 to not approach near -- a hard limit of 19999 highlight groups (`:h E849`) if n_color_cache > 10000 then + vim.notify_once( + 'E849: The maximum number of highlight groups has been reached.', + vim.log.levels.WARN + ) return nil end