olimorris / onedarkpro.nvim

🎨 Atom's iconic One Dark theme. Cacheable, fully customisable, Tree-sitter and LSP semantic token support. Comes with variants
MIT License
821 stars 47 forks source link

TelescopePromptPrefix not being respected? #156

Closed petobens closed 1 year ago

petobens commented 1 year ago

Your OneDarkPro config

Dunno if this is a problem with onedark or telescope; I tried using:

local root = '/tmp/nvim-minimal'

-- Set stdpaths to use root dir
for _, name in ipairs({ 'config', 'data', 'state', 'cache' }) do
    vim.env[('XDG_%s_HOME'):format(name:upper())] = root .. '/' .. name
end

-- Bootstrap lazy
local lazypath = root .. '/plugins/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then
    vim.fn.system({
        'git',
        'clone',
        '--filter=blob:none',
        '--single-branch',
        'https://github.com/folke/lazy.nvim.git',
        lazypath,
    })
end
vim.opt.runtimepath:prepend(lazypath)

-- Install plugins
local plugins = {
    {
        'nvim-telescope/telescope.nvim',
        dependencies = { 'nvim-lua/plenary.nvim' },
    },
}
require('lazy').setup(plugins, {
    root = root .. '/plugins',
})

-- Plugin setup
require('onedarkpro').setup({})
vim.cmd('colorscheme onedark')
require('telescope').setup({})

But cannot quite seem to change the TelescopePromptPrefix highlight.

Error messages

No response

Describe the bug

AFAICT the TelescopePromptPrefix as per https://github.com/olimorris/onedarkpro.nvim/blob/main/lua/onedarkpro/highlights/plugins/telescope.lua#L30 should be purple but I'm seing a plain gray one.

I tried running:

lua vim.api.nvim_set_hl(0, "TelescopePromptPrefix", {fg="Green"})

but that didn't change the color either.

image

Reproduce the bug

No response

Final checks

olimorris commented 1 year ago

With this minimal config I can see a red prompt:

local root = "/tmp/onedarkpro"

-- Set stdpaths to use root dir
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- Bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "--single-branch",
    "https://github.com/folke/lazy.nvim.git",
    lazypath,
  })
end
vim.opt.runtimepath:prepend(lazypath)

-- Install plugins
local plugins = {
  {
    "nvim-telescope/telescope.nvim",
    dependencies = { "nvim-lua/plenary.nvim" },
  },
  {
    "olimorris/onedarkpro.nvim",
  },
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

-- Plugin setup
require("telescope").setup()
require("onedarkpro").setup({
  highlights = {
    TelescopePromptNormal = { fg = "${red}" },
  },
})
vim.cmd("colorscheme onedark")
Screen Shot 2023-02-07 at 13 44 22@2x

The order of the require("telescope").setup() call shouldn't matter either. Can you test this out?

petobens commented 1 year ago

If I try your config with:

highlights = {
        TelescopePromptPrefix = { fg = '${red}' },
    },

so that only the Prompt symbol should be highlighted in red then it doesn't seem to work (i.e I want only to change the prompt symbol highlight not the text). Can you reproduce this?

olimorris commented 1 year ago

What do you see if you run hi TelescopePromptPrefix?

petobens commented 1 year ago

image

Do you actually get a red hl when using TelescopePromptPrefix?

olimorris commented 1 year ago

image

Do you actually get a red hl when using TelescopePromptPrefix?

This looks correct?! I think TelescopePromptNormal might be what you're looking for. This is likely in part down to how I was applying telescope highlights in the theme. A little confusing.

xulongwu4 commented 1 year ago

I am having a similar issue with nvim lightly. However, I believe this might be a bug in neovim nightly itself as I can reproduce this behavior with multiple color schemes. @petobens, are you using the nightly build of neovim?

petobens commented 1 year ago

Hi @xulongwu4 ! I'm indeed using the nightly build.

olimorris commented 1 year ago

I'm having this too. But in a really weird way.

On opening Telescope, the prompt is the color of fg. Then if I delete a session via Telescope, you can see the prompt changes color to red (which is correct):

Screen Shot 2023-02-24 at 08 52 03

xulongwu4 commented 1 year ago

https://github.com/nvim-telescope/telescope.nvim/issues/2384

olimorris commented 1 year ago

https://github.com/nvim-telescope/telescope.nvim/issues/2384

Thanks for finding this. Will leave this issue open for now in case others come across it

olimorris commented 1 year ago

Conni's sorted this now https://github.com/nvim-telescope/telescope.nvim/pull/2403 👏🏼