mawkler / modicator.nvim

Cursor line number mode indicator plugin for Neovim
MIT License
298 stars 6 forks source link

Color not apply on the first load #9

Closed sangdth closed 1 year ago

sangdth commented 1 year ago

I love the plugin. However, it does not work in my case on initial load. But it works well after the changing mode.

I tried to set lazy = false as well as many events but unlucky. Could you help me identify the problem?

    config = function()
      local colors = require("tokyonight.colors").setup()

      require('modicator').setup({
        highlights = {
          defaults = {
            foreground = colors.blue,
            bold = true,
          },
          modes = {
            ['n'] = { foreground = colors.blue },
            ['v'] = { foreground = colors.purple },
            ['V'] = { foreground = colors.purple },
            ['i'] = { foreground = colors.green },
            ['R'] = { foreground = colors.red1 },
          }
        }
      })
    end,

https://github.com/mawkler/modicator.nvim/assets/1083478/90b8a80c-128f-4746-9d97-e05656acf36e

mawkler commented 1 year ago

Hi @sangdth! Make sure that your colorscheme's default CursorLineNr highlight is the same as the one you've specified in modicator's normal mode highlights.modes.n highlight. Modicator currently doesn't activate until there's a mode change, and so that's why you need to change modes to see your blue normal mode color.

When I find the time I might look into having modicator set the CursorLineNr highlight immediately upon being loaded.

sangdth commented 1 year ago

thanks @mawkler , I will tried that way and all good now.