hrsh7th / nvim-cmp

A completion plugin for neovim coded in Lua.
MIT License
7.53k stars 377 forks source link

feat:allow highlight overrides for scrollbar and scrollbar thumb #1741

Closed jakewvincent closed 3 weeks ago

jakewvincent commented 8 months ago

This PR adds two config options to window.completion which allow the user to override the default highlight groups for the winhighlight of the scrollbar and the scrollbar thumb, which were previously hard-coded. The following files are changed:

  1. lua/cmp/config/default.lua: Added entries in default config table for scrollbar_highlight and scrollbar_thumb_highlight
  2. lua/cmp/config/window.lua: Added entries in the settings table returned by window.bordered() for scrollbar_highlight and scrollbar_thumb_highlight
  3. lua/cmp/utils/window.lua: in window.update(), retrieve the default or user-customized values for scrollbar_highlight and scrollbar_thumb_highlight, and use those when setting the window options (this is where the previous hard-coded values are replaced)
  4. lua/cmp/types/cmp.lua: Defined scrollbar_highlight and scrollbar_thumb_highlight in cmp.WindowConfig class.
  5. doc/cmp.txt: Updated documentation