Skip to content

nvim_get_hl_by_name("Group", true) doesn't always return colors #18024

@adrian5

Description

@adrian5

Neovim version (nvim -v)

NVIM v0.7.0-dev+1392-gdaa8ac051

Installation

GitHub nightly builds

How to reproduce the issue

nvim --clean
  1. :lua =vim.api.nvim_get_hl_by_name("Normal", true) prints:
{                                                                                                             
  [true] = 6
}
  1. Set highlight via lua vim.api.nvim_set_hl(0, "Normal", { fg = "#ff0000", bg = "#202020" }). 1) prints:
{                                                                                                             
  [true] = 6
}
  1. Set highlight via :hi Normal guifg=#ff0000 guibg=#202020. 1) prints:
{
  background = 2105376,
  foreground = 16711680
}

Note: This behavior might be specific to the Normal group.

Expected behavior

nvim_get_hl_by_name("Normal", true) returns the group's colors.

Actual behavior

It only does so when the highlights are set the vimscript way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    apilibnvim, Nvim RPC APIhas:reproissue contains minimal reproducing steps

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions