Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gruvbox_material_better_performance breaks highlight for markdown <http://link> with treesitter #184

Closed
2 tasks done
misaflo opened this issue Aug 28, 2023 · 3 comments
Closed
2 tasks done
Assignees
Labels
bug Something isn't working

Comments

@misaflo
Copy link

misaflo commented Aug 28, 2023

I have done the following steps before reporting this issue:

  • I have searched the existing issues
  • I have read the FAQ in the help doc

Operating system/version

Arch Linux

Terminal emulator/version

alacritty 0.12.2

$TERM environment variable

alacritty

Tmux version

No response

Feature matrix

==============================================================================
lazy: require("lazy.health").check()

lazy.nvim ~
- OK Git installed
- OK no existing packages found by other package managers
- OK packer_compiled.lua not found

==============================================================================
nvim: require("nvim.health").check()

Configuration ~
- OK no issues found

Runtime ~
- OK $VIMRUNTIME: /usr/share/nvim/runtime

Performance ~
- OK Build type: Release

Remote Plugins ~
- OK Up to date

terminal ~
- key_backspace (kbs) terminfo entry: `key_backspace=\177`
- key_dc (kdch1) terminfo entry: `key_dc=\E[3~`
- $COLORTERM="truecolor"

==============================================================================
nvim-treesitter: require("nvim-treesitter.health").check()

Installation ~
- WARNING `tree-sitter` executable not found (parser generator, only needed for :TSInstallFromGrammar, not required for :TSInstall)
- OK `node` found v20.5.1 (only needed for :TSInstallFromGrammar)
- OK `git` executable found.
- OK `cc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
  Version: cc (GCC) 13.2.1 20230801
- OK Neovim was compiled with tree-sitter runtime ABI version 14 (required >=13). Parsers must be compatible with runtime ABI.

OS Info:
{
  machine = "x86_64",
  release = "6.4.12-arch1-1",
  sysname = "Linux",
  version = "#1 SMP PREEMPT_DYNAMIC Thu, 24 Aug 2023 00:38:14 +0000"
} ~

Parser/Features         H L F I J
  - bash                ✓ ✓ ✓ . ✓
  - comment             ✓ . . . .
  - css                 ✓ . ✓ ✓ ✓
  - git_config          ✓ . . . .
  - git_rebase          ✓ . . . ✓
  - gitattributes       ✓ . . . ✓
  - gitcommit           ✓ . . . ✓
  - gitignore           ✓ . . . .
  - json                ✓ ✓ ✓ ✓ .
  - jsonc               ✓ ✓ ✓ ✓ ✓
  - lua                 ✓ ✓ ✓ ✓ ✓
  - markdown            ✓ . ✓ ✓ ✓
  - markdown_inline     ✓ . . . ✓
  - puppet              ✓ ✓ ✓ ✓ ✓
  - python              ✓ ✓ ✓ ✓ ✓
  - ruby                ✓ ✓ ✓ ✓ ✓
  - toml                ✓ ✓ ✓ ✓ ✓
  - vim                 ✓ ✓ ✓ . ✓
  - vimdoc              ✓ . . . ✓
  - yaml                ✓ ✓ ✓ ✓ ✓

  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: wl-copy

Python 3 provider (optional) ~
- `g:python3_host_prog` is not set.  Searching for python3 in the environment.
- Executable: /usr/bin/python3
- Python version: 3.11.3
- pynvim version: 0.4.3
- OK Latest pynvim is installed.

Python virtualenv ~
- OK no $VIRTUAL_ENV

Ruby provider (optional) ~
- Ruby: ruby 3.0.6p216 (2023-03-30 revision 23a532679b) [x86_64-linux]
- 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) ~
- Node.js: v20.5.1
- 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

==============================================================================
vim.lsp: require("vim.lsp.health").check()

- LSP log level : WARN
- Log path: /home/florent/.local/state/nvim/lsp.log
- Log size: 9624 KB

vim.lsp: Active Clients ~
- No active clients

==============================================================================
vim.treesitter: require("vim.treesitter.health").check()

- Nvim runtime ABI version: 14
- OK Parser: bash       ABI: 14, path: /home/florent/.local/share/nvim/lazy/nvim-treesitter/parser/bash.so
- OK Parser: comment    ABI: 14, path: /home/florent/.local/share/nvim/lazy/nvim-treesitter/parser/comment.so
- OK Parser: css        ABI: 14, path: /home/florent/.local/share/nvim/lazy/nvim-treesitter/parser/css.so
- OK Parser: git_config ABI: 13, path: /home/florent/.local/share/nvim/lazy/nvim-treesitter/parser/git_config.so
- OK Parser: git_rebase ABI: 14, path: /home/florent/.local/share/nvim/lazy/nvim-treesitter/parser/git_rebase.so
- OK Parser: gitattributes ABI: 14, path: /home/florent/.local/share/nvim/lazy/nvim-treesitter/parser/gitattributes.so
- OK Parser: gitcommit  ABI: 14, path: /home/florent/.local/share/nvim/lazy/nvim-treesitter/parser/gitcommit.so
- OK Parser: gitignore  ABI: 13, path: /home/florent/.local/share/nvim/lazy/nvim-treesitter/parser/gitignore.so
- OK Parser: json       ABI: 14, path: /home/florent/.local/share/nvim/lazy/nvim-treesitter/parser/json.so
- OK Parser: jsonc      ABI: 13, path: /home/florent/.local/share/nvim/lazy/nvim-treesitter/parser/jsonc.so
- OK Parser: lua        ABI: 14, path: /home/florent/.local/share/nvim/lazy/nvim-treesitter/parser/lua.so
- OK Parser: markdown   ABI: 14, path: /home/florent/.local/share/nvim/lazy/nvim-treesitter/parser/markdown.so
- OK Parser: markdown_inline ABI: 14, path: /home/florent/.local/share/nvim/lazy/nvim-treesitter/parser/markdown_inline.so
- OK Parser: puppet     ABI: 14, path: /home/florent/.local/share/nvim/lazy/nvim-treesitter/parser/puppet.so
- OK Parser: python     ABI: 14, path: /home/florent/.local/share/nvim/lazy/nvim-treesitter/parser/python.so
- OK Parser: ruby       ABI: 14, path: /home/florent/.local/share/nvim/lazy/nvim-treesitter/parser/ruby.so
- OK Parser: toml       ABI: 13, path: /home/florent/.local/share/nvim/lazy/nvim-treesitter/parser/toml.so
- OK Parser: vim        ABI: 14, path: /home/florent/.local/share/nvim/lazy/nvim-treesitter/parser/vim.so
- OK Parser: vimdoc     ABI: 14, path: /home/florent/.local/share/nvim/lazy/nvim-treesitter/parser/vimdoc.so
- OK Parser: yaml       ABI: 13, path: /home/florent/.local/share/nvim/lazy/nvim-treesitter/parser/yaml.so

Minimal vimrc that can reproduce this bug.

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', -- latest stable release
    lazypath,
  })
end
vim.opt.rtp:prepend(lazypath)

require('lazy').setup({
  -- Color scheme
  {
    'sainnhe/gruvbox-material',
    lazy = false,
    priority = 1000,
    config = function()
      vim.g.gruvbox_material_better_performance = true
      vim.cmd 'colorscheme gruvbox-material'
    end,
  },

  {
    'nvim-treesitter/nvim-treesitter',
    build = ':TSUpdate',
    config = function()
      require('nvim-treesitter.configs').setup {
        ensure_installed = { 'markdown', 'markdown_inline' },
        highlight = {
          enable = true,
        },
      }
    end,
  },
 })

Steps to reproduce this bug using minimal vimrc

Open a Markdown file with a <auto_link>.

Expected behavior

<markdown_auto_link> should be highlighted. It works without gruvbox_material_better_performance.

Actual behavior

<markdown_auto_link> is not highlighted.

@misaflo misaflo added the bug Something isn't working label Aug 28, 2023
@antoineco
Copy link
Collaborator

Thanks for the detailed issue report!

If I'm not mistaken, lazy.nvim does not support runtimepath:

There is however a workaround suggested in that same issue (in the comment right below the one I linked), with a combination of init and config, and I remember it working for some syntax related issue. Could you please try that and report? If it works, I'm going to document the workaround in gruvbox-material, since lazy.nvim is very popular.

@misaflo
Copy link
Author

misaflo commented Sep 1, 2023

Thanks, I try this:

  {
    'sainnhe/gruvbox-material',
    lazy = false,
    priority = 1000,
    config = function(plugin)
      vim.opt.rtp:append(plugin.dir .. '/after/syntax')
      require('lazy.core.loader').packadd(plugin.dir .. '/after/syntax')
      vim.g.gruvbox_material_better_performance = true
      vim.cmd 'colorscheme gruvbox-material'
    end,
    init = function(plugin)
      require('lazy.core.loader').ftdetect(plugin.dir .. '/after/syntax')
    end,
  },

But that changes nothing.

@misaflo misaflo closed this as completed Sep 1, 2023
@misaflo misaflo reopened this Sep 1, 2023
@antoineco antoineco self-assigned this Sep 1, 2023
misaflo added a commit to misaflo/dotfiles that referenced this issue Sep 3, 2023
@antoineco
Copy link
Collaborator

This was fixed in commit 0322d59

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants