Skip to content

Commit

Permalink
fix: completion item menu and word default to hl of popupmenu
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Oct 24, 2022
1 parent c178cab commit f54b41a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,8 @@ require("telescope").load_extension("noice")
| **NoiceCompletionItemKindUnit** | _NoiceCompletionItemKindDefault_ | |
| **NoiceCompletionItemKindValue** | _NoiceCompletionItemKindDefault_ | |
| **NoiceCompletionItemKindVariable** | _NoiceCompletionItemKindDefault_ | |
| **NoiceCompletionItemMenu** | _NonText_ | Normal for the popupmenu |
| **NoiceCompletionItemMenu** | _NoicePopupmenu_ | Normal for the popupmenu |
| **NoiceCompletionItemWord** | _NoicePopupmenu_ | Normal for the popupmenu |
| **NoiceConfirm** | _Normal_ | Normal for the confirm view |
| **NoiceConfirmBorder** | _DiagnosticSignInfo_ | Border for the confirm view |
| **NoiceCursor** | _Cursor_ | Fake Cursor |
Expand Down
3 changes: 2 additions & 1 deletion lua/noice/config/highlights.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ M.defaults = {
LspProgressSpinner = "Constant", -- Lsp progress spinner
LspProgressTitle = "NonText", -- Lsp progress title
LspProgressClient = "Title", -- Lsp progress client name
CompletionItemMenu = "NonText", -- Normal for the popupmenu
CompletionItemMenu = "NoicePopupmenu", -- Normal for the popupmenu
CompletionItemWord = "NoicePopupmenu", -- Normal for the popupmenu
CompletionItemKindDefault = "Special",
CompletionItemKindColor = "NoiceCompletionItemKindDefault",
CompletionItemKindFunction = "NoiceCompletionItemKindDefault",
Expand Down
4 changes: 2 additions & 2 deletions lua/noice/ui/popupmenu/nui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ function M.format_abbr(item, prefix)
local text = item.abbr or item.word
if prefix and text:lower():find(prefix:lower(), 1, true) == 1 then
item.text:append(prefix, "NoicePopupmenuMatch")
item.text:append(text:sub(#prefix + 1))
item.text:append(text:sub(#prefix + 1), "NoiceCompletionItemWord")
else
item.text:append(text)
item.text:append(text, "NoiceCompletionItemWord")
end
end

Expand Down

0 comments on commit f54b41a

Please sign in to comment.