noice.nvim icon indicating copy to clipboard operation
noice.nvim copied to clipboard

bug: Noice (?) changes custom highlight for Neorg

Open rodhash opened this issue 7 months ago • 4 comments

Did you check docs and existing issues?

  • [X] I have read all the noice.nvim docs
  • [X] I have searched the existing issues of noice.nvim
  • [X] I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

NVIM v0.10.0-dev-a84b454

Operating system/version

MacOS ventura 14.1.1

Describe the bug

Whenever I open Cmdline, noice resets my custom highlighting colors for Neorg.

In this quick vid I'm already using the minimal version to reproduce the issue and as soon as I open Cmdline, it changes all the custom colors.

https://github.com/folke/noice.nvim/assets/29671981/3fdeddfa-a94e-4732-95c1-5a4583aa443b

Steps To Reproduce

  1. Open the nvim w/ repro.lua config
  2. Open any neorg file
  3. Open the Cmdline and the custom highlighting colors get changed

Expected Behavior

No HL changes when opening Cmdline.

Repro

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/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", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  "folke/noice.nvim",
  -- add any other plugins here
  "nvim-neo-tree/neo-tree.nvim",
  "nvim-lua/plenary.nvim",
  "rodhash/nvim-web-devicons",
  "MunifTanjim/nui.nvim",
  "rcarriga/nvim-notify",
  "nvim-neorg/neorg",
  "nvim-lua/plenary.nvim",
  "nvim-treesitter/nvim-treesitter",
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here

local nvim_set_hl = vim.api.nvim_set_hl
nvim_set_hl(0, "@neorg.headings.1.title"               , { fg="#d75fff", bold = true } )
nvim_set_hl(0, "@neorg.headings.1.prefix"              , { fg="#d75fff" } )
nvim_set_hl(0, "@neorg.headings.2.title"               , { fg="#ff5f00", bold = true } )
nvim_set_hl(0, "@neorg.headings.2.prefix"              , { fg="#ff5f00" } )
nvim_set_hl(0, "@neorg.headings.3.title"               , { fg="#7f7f7f", bold = true } )

require("noice").setup()
require("neorg").setup {
    -- configuration here
    load = {
        ["core.defaults"] = {
          config = {
              default_keybinds = false,
          },
        },
        ["core.concealer"] = {}

    }
}

rodhash avatar Nov 21 '23 23:11 rodhash

well .. it seems that updating my norg parser did the trick

rodhash avatar Nov 22 '23 00:11 rodhash

nevermind .. the issue is still here.

rodhash avatar Nov 22 '23 00:11 rodhash

Search and other prompts also resets the custom highlight color.. apparently this is happening only in neorg filetype

rodhash avatar Nov 27 '23 11:11 rodhash

^ I'm also facing this issue with Neorg filetypes. The moment I transition from Normal to Command mode the highlight groups revert to the original.

It does not happen with Markdown files.

https://github.com/AlexvZyl/nordic.nvim/pull/123

juniorsundar avatar Apr 11 '24 09:04 juniorsundar