Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: selected icon highlight with color_devicons to false #2187

Merged
merged 2 commits into from
Oct 8, 2022

Conversation

Diaoul
Copy link
Contributor

@Diaoul Diaoul commented Oct 4, 2022

Description

The background color is off on selected text

image

Type of change

  • Bug fix

image

How Has This Been Tested?

Locally

Configuration:

  • Neovim version (nvim --version): NVIM v0.9.0-dev-16-g56998feeb
  • Operating system and version: Arch Linux

Checklist:

  • My code follows the style guidelines of this project (stylua)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (lua annotations)

@Diaoul Diaoul marked this pull request as ready for review October 4, 2022 07:29
@Diaoul
Copy link
Contributor Author

Diaoul commented Oct 4, 2022

Also note that this is now possible to do globally at the nvim-web-devicons level with nvim-tree/nvim-web-devicons#157

local devicons = require "nvim-web-devicons"
devicons.setup {
    override = {
        default_icon = {
            icon = "",
            color = "#ebdbb2",
            cterm_color = "223",
        },
    },
    color_icons = false,
}

And it will pick the default icon's color (not nil though, so it's a bit less flexible that the option in telescope)

@T-727
Copy link

T-727 commented Oct 6, 2022

Hey,
I tried all 4 combos of color_devicons and color_icons options and couldn't reproduce this,
could you provide steps/minimal-config please?

@Diaoul
Copy link
Contributor Author

Diaoul commented Oct 7, 2022

Sorry I did not include that in the first place. Here is something I just used with catppuccin theme to make it not look too bad.

Configuration

        use { "wbthomason/packer.nvim" }
        use { "nvim-lua/plenary.nvim" }
        use {
            "kyazdani42/nvim-web-devicons",
            config = function()
              local devicons = require "nvim-web-devicons"
              devicons.setup {
                  color_icons = true,
              }
            end,
        }
        use {
            "nvim-telescope/telescope.nvim",
            config = function()
              require("telescope").setup {
                  defaults = {
                      color_devicons = true,
                  },
              }
            end,
        }
         use {
             "catppuccin/nvim",
             as = "catppuccin",
             config = function()
              vim.g.catppuccin_flavour = "mocha"
              require("catppuccin").setup { }
              vim.cmd [[colorscheme catppuccin]]
             end,
         }

Steps

  • Just open telescope (find files or something)

Output

Telescope at true (default) and devicons true (default):
image

Telescope at false and devicons true (default):
image

👉 I think you need :PackerCompile in between configuration changes.

@Conni2461
Copy link
Member

thanks :)

Shouldn't we also drop TelescopeResultsFileIcon from plugin/telescope.lua, the hl group is only used here

@Diaoul
Copy link
Contributor Author

Diaoul commented Oct 8, 2022

Good catch 👍

@Conni2461 Conni2461 merged commit 5fadc24 into nvim-telescope:master Oct 8, 2022
Conni2461 pushed a commit that referenced this pull request Jan 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants