ray-x / navigator.lua

Code analysis & navigation plugin for Neovim. Navigate codes like a breeze🎐 Exploring LSP and 🌲Treesitter symbols a piece of 🍰 Take control like a boss 🦍
MIT License
1.31k stars 58 forks source link

Unable to override default configs #306

Closed Zach-Johnson closed 5 months ago

Zach-Johnson commented 5 months ago

Hi - I'm confused about how to override default config values. It seems like the defaults are persisting regardless of what config I set up. I've just now tried it with the playground in this repo. I've set the following in the navigator section of the init.lua:

    {
      'ray-x/navigator.lua',
      dev = (plugin_folder() ~= ''),
      -- '~/github/ray-x/navigator.lua',
      dependencies = { 'ray-x/guihua.lua', build = 'cd lua/fzy && make' },
      config = function()
        require('navigator').setup({
          keymaps = {
            {
              key = '<Leader>rn',
              func = require('navigator.rename').rename,
              desc = 'rename',
            },
          },
          lsp = {
           icons = {
            diagnostic_err = '👎',
            }
          },
        })
      end,
    },

I'd expect that the icon for diagnostics gets overridden but it does not

ray-x commented 5 months ago

Should use this instead (also more examples in the README.md)

    {
      'ray-x/navigator.lua',
      dev = (plugin_folder() ~= ''),
      -- '~/github/ray-x/navigator.lua',
      dependencies = { 'ray-x/guihua.lua', build = 'cd lua/fzy && make' },
      config = function()
        require('navigator').setup({
          keymaps = {
            {
              key = '<Leader>rn',
              func = require('navigator.rename').rename,
              desc = 'rename',
            },
          },
         icons = {
          enable=true,
          diagnostic_err = '👎',
          }
        })
      end,
    }
Zach-Johnson commented 5 months ago

Ah, I was confused by the other config. Thanks very much 🙏