mawkler / modicator.nvim

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

Doesn't use command-line mode highlight #26

Closed gregorias closed 9 months ago

gregorias commented 10 months ago

The issue

The plugin doesn't use command-line mode highlight if I only press ":". I need to type something for the color change to trigger.

image

Reproduction

  1. Use the init.lua below
vim.o.cursorline = true
vim.o.number = true
vim.o.termguicolors = true

-- | Fetches Lazy if not present.
local function bootstrap_lazy()
  local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
  if not vim.loop.fs_stat(lazypath) then
    vim.fn.system({
      "git",
      "clone",
      "--filter=blob:none",
      "https://github.com/folke/lazy.nvim.git",
      "--branch=stable",
      lazypath,
    })
  end
  vim.opt.rtp:prepend(lazypath)
end
bootstrap_lazy()

require("lazy").setup({
  {
    "folke/tokyonight.nvim",
  },
  {
    "hoob3rt/lualine.nvim",
    opts = {},
  },
  {
    "mawkler/modicator.nvim",
    dependencies = { "folke/tokyonight.nvim" },
    opts = {
    },
  },
})
vim.cmd("colorscheme tokyonight")
  1. Run nvim and press ":"

Additional comments

Possibly you need to handle "CmdLineEnter" event as a stop gap measure. If ModeChanged is not firing when expected, I'd consider reporting it up to Neovim. It's a relatively new feature (https://github.com/neovim/neovim/issues/4399).

mawkler commented 10 months ago

I've created an issue here: https://github.com/neovim/neovim/issues/25851

mawkler commented 9 months ago

I've added a temporary workaround for this until this gets fixed upstream. Let me know if you have any other problem!