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

nvim-web-devicons user overrides are clobbered #2775

Open
alex-courtis opened this issue May 13, 2024 · 1 comment
Open

nvim-web-devicons user overrides are clobbered #2775

alex-courtis opened this issue May 13, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@alex-courtis
Copy link
Member

Description

See nvim-tree/nvim-web-devicons#464

Neovim version

https://github.com/nvim-tree/nvim-web-devicons/issues/464

Operating system and version

Linux 6.8.9-arch1-2

Windows variant

No response

nvim-tree version

edd4e25

Clean room replication

vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1

vim.cmd [[set runtimepath=$VIMRUNTIME]]
vim.cmd [[set packpath=/tmp/nvt-min/site]]
local package_root = "/tmp/nvt-min/site/pack"
local install_path = package_root .. "/packer/start/packer.nvim"
local function load_plugins()
  require("packer").startup {
    {
      "wbthomason/packer.nvim",
      "nvim-tree/nvim-tree.lua",
      "nvim-tree/nvim-web-devicons",
      -- ADD PLUGINS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
    },
    config = {
      package_root = package_root,
      compile_path = install_path .. "/plugin/packer_compiled.lua",
      display = { non_interactive = true },
    },
  }
end
if vim.fn.isdirectory(install_path) == 0 then
  print "Installing nvim-tree and dependencies."
  vim.fn.system { "git", "clone", "--depth=1", "https://github.com/wbthomason/packer.nvim", install_path }
end
load_plugins()
require("packer").sync()
vim.cmd [[autocmd User PackerComplete ++once echo "Ready!" | lua setup()]]
vim.opt.termguicolors = true
vim.opt.cursorline = true

-- MODIFY NVIM-TREE SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
_G.setup = function()
  require("nvim-tree").setup {}
end

local devicons = require('nvim-web-devicons')
devicons.setup({
      -- NOTE: override the icon
      override_by_extension = {
        java = { icon = "", color = "#e46368", name = "Java" },
        [".gitignore"] = { icon = "", color = "#428850", name = "GitIgnore" },
        js = { icon = "", color = "#f7cd6d", name = "JavaScript" },
        json = { icon = "", color = "#f7cd6d", name = "JSON" },
        ts = { icon = "󰛦", color = "#87b2e2", name = "TypeScript" },
        html = { icon = "", color = "#de7558", name = "Html" },
        rb = { icon = "", color = "#ef757c", name = "Rb" },
        rake = { icon = "", color = "#ef757c", name = "Rake" },
        rakefile = { icon = "", color = "#ef757c", name = "RakeFile" },
        jbuilder = { icon = "", color = "#f7cd6d", name = "Jbuilder" },
        lua = { icon = "", color = "#37c88e", name = "Lua" }
      },
      color_icons = true,
      default = false,
      strict = true,
})

Steps to reproduce

nvim-tree/nvim-web-devicons#462

Expected behavior

Overridden icons used

Actual behavior

Default icons used

@alex-courtis alex-courtis added the bug Something isn't working label May 13, 2024
@alex-courtis
Copy link
Member Author

A preserve option seems the best course of action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant