sainnhe / gruvbox-material

Gruvbox with Material Palette
MIT License
1.82k stars 164 forks source link

Breaks folke/noice.nvim #148

Closed Integralist closed 1 month ago

Integralist commented 1 year ago

I have done the following steps before reporting this issue:

Operating system/version

macOS Monterey 12.6

Terminal emulator/version

Alacritty

$TERM environment variable

xterm-256color

Tmux version

I'm using Zellij

Feature matrix


mason: require("mason.health").check()
========================================================================
## mason.nvim report
  - OK: neovim version >= 0.7.0
  - OK: **Go**: `go version go1.18.5 darwin/arm64`
  - OK: **cargo**: `cargo 1.64.0 (387270bc7 2022-09-16)`
  - WARNING: **luarocks**: not available
  - OK: **Ruby**: `ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [arm64-darwin21]`
  - OK: **RubyGem**: `3.3.11`
  - OK: **Composer**: `Composer version 2.4.2 2022-09-14 16:11:15`
  - OK: **PHP**: `PHP 8.1.11 (cli) (built: Sep 29 2022 19:44:28) (NTS)`
  - OK: **npm**: `8.5.5`
  - OK: **node**: `v17.9.0`
  - OK: **python3**: `Python 3.10.7`
  - OK: **pip3**: `pip 22.2.2 from /opt/homebrew/lib/python3.10/site-packages/pip (python 3.10)`
  - WARNING: **javac**: not available
  - OK: **java**: `java version "1.8.0_341"`
  - WARNING: **julia**: not available
  - OK: **wget**: `GNU Wget 1.21.3 built on darwin21.3.0.`
  - OK: **curl**: `curl 7.79.1 (x86_64-apple-darwin21.0) libcurl/7.79.1 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.11 nghttp2/1.45.1`
  - OK: **gzip**: `Apple gzip 353.100.22`
  - OK: **tar**: `bsdtar 3.5.1 - libarchive 3.5.1 zlib/1.2.11 liblzma/5.0.5 bz2lib/1.0.8 `
  - OK: **bash**: `GNU bash, version 5.2.2(1)-release (aarch64-apple-darwin21.6.0)`
  - OK: **sh**: `Ok`
  - OK: GitHub API rate limit. Used: 0. Remaining: 60. Limit: 60. Reset: Sun  9 Oct 12:28:27 2022.

nvim: health#nvim#check
========================================================================
## Configuration
  - OK: no issues found

## Performance
  - OK: Build type: Release

## Remote Plugins
  - OK: Up to date

## terminal
  - INFO: key_backspace (kbs) terminfo entry: key_backspace=^H
  - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~
  - INFO: $COLORTERM='24bit'

nvim-treesitter: require("nvim-treesitter.health").check()
========================================================================
## Installation
  - OK: `tree-sitter` found 0.20.7 (parser generator, only needed for :TSInstallFromGrammar)
  - OK: `node` found v17.9.0 (only needed for :TSInstallFromGrammar)
  - OK: `git` executable found.
  - OK: `cc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
    Version: Apple clang version 14.0.0 (clang-1400.0.29.102)
  - OK: Neovim was compiled with tree-sitter runtime ABI version 14 (required >=13). Parsers must be compatible with runtime ABI.

## Parser/Features H L F I J
  - html           ✓ ✓ ✓ ✓ ✓
  - python         ✓ ✓ ✓ ✓ ✓
  - regex          ✓ . . . .
  - javascript     ✓ ✓ ✓ ✓ ✓
  - yaml           ✓ ✓ ✓ ✓ ✓
  - zig            ✓ . ✓ ✓ ✓
  - markdown       ✓ . ✓ . ✓
  - rust           ✓ ✓ ✓ ✓ ✓
  - cmake          ✓ . ✓ . .
  - json           ✓ ✓ ✓ ✓ .
  - vim            ✓ ✓ ✓ . ✓
  - make           ✓ . ✓ . ✓
  - hcl            ✓ . ✓ ✓ ✓
  - lua            ✓ ✓ ✓ ✓ ✓
  - toml           ✓ ✓ ✓ ✓ ✓
  - ruby           ✓ ✓ ✓ ✓ ✓
  - c              ✓ ✓ ✓ ✓ ✓
  - dockerfile     ✓ . . . ✓
  - go             ✓ ✓ ✓ ✓ ✓
  - http           ✓ . . . ✓
  - gomod          ✓ . . . ✓
  - gowork         ✓ . . . ✓
  - bash           ✓ ✓ ✓ . ✓
  - help           ✓ . . . .
  - css            ✓ . ✓ ✓ ✓

  Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[j]ections
         +) multiple parsers found, only one will be used
         x) errors found in the query, try to run :TSUpdate {lang}

provider: health#provider#check
========================================================================
## Clipboard (optional)
  - OK: Clipboard tool found: pbcopy

## Python 3 provider (optional)
  - WARNING: No Python executable found that can `import neovim`. Using the first available executable for diagnostics.
  - WARNING: Could not load Python 3:
    /opt/homebrew/bin/python3 does not have the "neovim" module.
    /opt/homebrew/bin/python3.10 does not have the "neovim" module.
    /opt/homebrew/bin/python3.9 does not have the "neovim" module.
    python3.8 not found in search path or not executable.
    python3.7 not found in search path or not executable.
    python not found in search path or not executable.
    - ADVICE:
      - See :help |provider-python| for more information.
      - You may disable this provider (and warning) by adding `let g:loaded_python3_provider = 0` to your init.vim
  - INFO: Executable: Not found

## Python virtualenv
  - OK: no $VIRTUAL_ENV

## Ruby provider (optional)
  - INFO: Ruby: ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [arm64-darwin21]
  - WARNING: `neovim-ruby-host` not found.
    - ADVICE:
      - Run `gem install neovim` to ensure the neovim RubyGem is installed.
      - Run `gem environment` to ensure the gem bin directory is in $PATH.
      - If you are using rvm/rbenv/chruby, try "rehashing".
      - See :help |g:ruby_host_prog| for non-standard gem installations.
      - You may disable this provider (and warning) by adding `let g:loaded_ruby_provider = 0` to your init.vim

## Node.js provider (optional)
  - INFO: Node.js: v17.9.0
  - WARNING: Missing "neovim" npm (or yarn, pnpm) package.
    - ADVICE:
      - Run in shell: npm install -g neovim
      - Run in shell (if you use yarn): yarn global add neovim
      - Run in shell (if you use pnpm): pnpm install -g neovim
      - You may disable this provider (and warning) by adding `let g:loaded_node_provider = 0` to your init.vim

## Perl provider (optional)
  - WARNING: "Neovim::Ext" cpan module is not installed
    - ADVICE:
      - See :help |provider-perl| for more information.
      - You may disable this provider (and warning) by adding `let g:loaded_perl_provider = 0` to your init.vim

telescope: require("telescope.health").check()
========================================================================
## Checking for required plugins
  - OK: plenary installed.
  - OK: nvim-treesitter installed.

## Checking external dependencies
  - OK: rg: found ripgrep 13.0.0
  - OK: fd: found fd 8.4.0

## ===== Installed extensions =====

## Telescope Extension: `changed_files`
  - INFO: No healthcheck provided

## Telescope Extension: `emoji`
  - INFO: No healthcheck provided

## Telescope Extension: `fzf`
  - INFO: No healthcheck provided

## Telescope Extension: `heading`
  - INFO: No healthcheck provided

## Telescope Extension: `notify`
  - INFO: No healthcheck provided

## Telescope Extension: `ui-select`
  - INFO: No healthcheck provided

## Telescope Extension: `windows`
  - INFO: No healthcheck provided

vim.lsp: require("vim.lsp.health").check()
========================================================================
  - INFO: LSP log level : WARN
  - INFO: Log path: /Users/integralist/.local/state/nvim/lsp.log
  - INFO: Log size: 1602 KB

vim.treesitter: require("vim.treesitter.health").check()
========================================================================
  - INFO: Runtime ABI version : 14
  - OK: Loaded parser for bash: ABI version 13
  - OK: Loaded parser for c: ABI version 13
  - OK: Loaded parser for cmake: ABI version 13
  - OK: Loaded parser for css: ABI version 13
  - OK: Loaded parser for dockerfile: ABI version 13
  - OK: Loaded parser for go: ABI version 13
  - OK: Loaded parser for gomod: ABI version 13
  - OK: Loaded parser for gowork: ABI version 13
  - OK: Loaded parser for hcl: ABI version 13
  - OK: Loaded parser for help: ABI version 14
  - OK: Loaded parser for html: ABI version 13
  - OK: Loaded parser for http: ABI version 13
  - OK: Loaded parser for javascript: ABI version 13
  - OK: Loaded parser for json: ABI version 13
  - OK: Loaded parser for lua: ABI version 13
  - OK: Loaded parser for make: ABI version 13
  - OK: Loaded parser for markdown: ABI version 13
  - OK: Loaded parser for python: ABI version 13
  - OK: Loaded parser for regex: ABI version 13
  - OK: Loaded parser for ruby: ABI version 13
  - OK: Loaded parser for rust: ABI version 13
  - OK: Loaded parser for toml: ABI version 13
  - OK: Loaded parser for vim: ABI version 14
  - OK: Loaded parser for yaml: ABI version 13
  - OK: Loaded parser for zig: ABI version 13
  - OK: Loaded parser for c: ABI version 13
  - OK: Loaded parser for help: ABI version 14
  - OK: Loaded parser for lua: ABI version 13
  - OK: Loaded parser for vim: ABI version 14

which_key: health#which_key#check
========================================================================
## WhichKey: checking conflicting keymaps
  - WARNING: conflicting keymap exists for mode **"n"**, lhs: **"yS"**
  - INFO: rhs: ` `
  - WARNING: conflicting keymap exists for mode **"n"**, lhs: **"ys"**
  - INFO: rhs: ` `
  - WARNING: conflicting keymap exists for mode **"n"**, lhs: **"gc"**
  - INFO: rhs: `<Plug>kommentary_motion_default`
  - WARNING: conflicting keymap exists for mode **"n"**, lhs: **"\\g"**
  - INFO: rhs: `<Cmd>Telescope changed_files<CR>`

Minimal vimrc that can reproduce this bug.

vim.cmd([[set runtimepath=$VIMRUNTIME]])
vim.cmd([[set packpath=/tmp/nvim/site]])
local package_root = "/tmp/nvim/site/pack"
local install_path = package_root .. "/packer/start/packer.nvim"
local function load_plugins()
  require("packer").startup({
    {
      "wbthomason/packer.nvim",
      {
        "folke/noice.nvim",
        requires = {
          "MunifTanjim/nui.nvim",
          "rcarriga/nvim-notify",
        },
      },
      {
        "folke/tokyonight.nvim",
      },
      {
        "sainnhe/gruvbox-material", -- ADDING THIS AND SWITCHING TO THE COLORSCHEME IS WHAT BREAKS THE 'Noice' plugin rendering.
      },
    },
    config = {
      package_root = package_root,
      compile_path = install_path .. "/plugin/packer_compiled.lua",
      display = { non_interactive = true },
    },
  })
end

_G.load_config = function()
  require("noice").setup()
  vim.opt.termguicolors = true
  vim.cmd([[colorscheme tokyonight]])
end
if vim.fn.isdirectory(install_path) == 0 then
  print("Installing Noice 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 load_config()]])

Steps to reproduce this bug using minimal vimrc

  1. nvim -u /tmp/minimal.lua.
  2. :colorscheme gruvbox-material (optional: :set background=dark, it breaks in light and dark).

Expected behavior

The UI for 'Noice' should render like:

Screenshot 2022-10-09 at 11 34 09

Actual behavior

But switching to this colorscheme breaks it like so:

Screenshot 2022-10-09 at 11 34 20
Integralist commented 1 year ago

Looks like this works around the issue for now: https://github.com/folke/noice.nvim/issues/40#issuecomment-1272521226

sainnhe commented 1 year ago

Seems like there is not a plugin specific highlight group for this component, so this issue can't be fixed in color scheme level (DiagnosticInfo is not a plugin specific hi group, it's a general hi group and will effect many components and plugins).

antoineco commented 1 year ago

This is very similar to https://github.com/sainnhe/everforest/pull/88

I agree, it would be a better (and very common) design from the plugin to set its own highlight groups and link them to core groups by default, instead of using the core groups directly. (cc. @folke)

As explained in https://github.com/nvim-lualine/lualine.nvim/pull/836, most IDEs use underline/undercurl to highlight diagnostic hints and issues, so it can be expected from (Neo)vim themes to adopt that styling too. Diagnostic groups are a poor choice to highlight borders.

antoineco commented 1 year ago

Update: looks like Noice now defaults to its own highlight groups 🎉 (https://github.com/folke/noice.nvim/issues/46)

The description of all built-in highlight groups is here: https://github.com/folke/noice.nvim/blob/d45fd10/README.md#-highlight-groups

@Integralist have you tried with the latest version? It would be nice to get feedback from an actual user to know whether or not we need to add explicit highlights for this plugin 🙂

Integralist commented 1 year ago

@antoineco hi, yes I'm setting the highlight groups myself here: https://github.com/Integralist/dotfiles/blob/main/.config/nvim/lua/plugins/colorschemes.lua#L12-L32

antoineco commented 1 month ago

This plugin is no longer broken since:

Screenshot 2024-06-02 at 11 51 28