summaryrefslogtreecommitdiffstatshomepage
path: root/test/functional/vimscript/executable_spec.lua
diff options
context:
space:
mode:
authorEvgeni Chasnovski <evgeni.chasnovski@gmail.com>2026-04-18 03:16:11 +0300
committerGitHub <noreply@github.com>2026-04-17 17:16:11 -0700
commit7219b816eaae8b2f5b6c8c99e791b2a10dc89e14 (patch)
tree2723296e0312814eb4e5dd1248d4917b2b65f46d /test/functional/vimscript/executable_spec.lua
parenteb569a695f8a44700da49087a5fa0126ff0df8e1 (diff)
fix(lsp): limit number of created highlight groups (#39133)
* fix(api): allow silencing "Too many highlight groups" error Problem: Using Lua's `vim.api.nvim_set_hl(0, 'New', {...})` can fail if there are too many existing highlight groups. However, this error can not be silenced with `pcall`. Solution: Make it possible to silence in `nvim_set_hl` and `nvim_get_hl_id_by_name`. * fix(lsp): limit number of groups created by `document_color()` Problem: A file can contain many string colors that would be highlighted by an LSP server. If this number crosses 19999 (maximum number of allowed highlight groups), there are general issues with creating other highlight groups, which can break functionality outside of `vim.lsp.document_color`. Solution: Limit number of highlight groups that are created by `vim.lsp.document_color` to 10000 (half of allowed maximum). This is not a 100% solution (since there can exist more than 10000 other highlight groups), but explicitly checking number of groups is slow and 10000 should (hopefully) be enough for most use cases.
Diffstat (limited to 'test/functional/vimscript/executable_spec.lua')
0 files changed, 0 insertions, 0 deletions