sainnhe / gruvbox-material

Gruvbox with Material Palette
MIT License
1.96k stars 166 forks source link

No italic and strikethrough for markdown_inline treesitter #195

Closed flexagoon closed 8 months ago

flexagoon commented 9 months ago

I have done the following steps before reporting this issue:

Operating system/version

Fedora Silzerblue 39

Terminal emulator/version

wezterm 20240203-110809-5046fc22

$TERM environment variable

xterm-256color

Tmux version

No response

Feature matrix

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

dressing.nvim ~
- OK vim.ui.input active
- OK vim.ui.select active: telescope

==============================================================================
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

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

mason.nvim ~
- OK mason.nvim version v1.10.0
- OK PATH: prepend
- OK Providers: 
  mason.providers.registry-api
  mason.providers.client
- OK neovim version >= 0.7.0

mason.nvim [Registries] ~
- OK Registry `github.com/mason-org/mason-registry version: 2024-02-07-secret-steer` is installed.

mason.nvim [Core utils] ~
- OK unzip: `UnZip 6.00 of 20 April 2009, by Debian. Original by Info-ZIP.`
- OK wget: `GNU Wget 1.21.3 built on linux-gnu.`
- OK curl: `curl 8.2.1 (x86_64-redhat-linux-gnu) libcurl/8.2.1 OpenSSL/3.1.1 zlib/1.2.13 brotli/1.1.0 libidn2/2.3.4 libpsl/0.21.2 (+libidn2/2.3.4) libssh/0.10.6/openssl/zlib nghttp2/1.55.1 OpenLDAP/2.6.6`
- OK gzip: `gzip 1.12`
- OK gtar: `tar (GNU tar) 1.35`
- OK bash: `GNU bash, version 5.2.26(1)-release (x86_64-redhat-linux-gnu)`
- OK sh: `Ok`

mason.nvim [Languages] ~
- WARNING Go: not available
  - ADVICE:
    - spawn: go failed with exit code - and signal -. go is not executable
- WARNING Composer: not available
  - ADVICE:
    - spawn: composer failed with exit code - and signal -. composer is not executable
- WARNING PHP: not available
  - ADVICE:
    - spawn: php failed with exit code - and signal -. php is not executable
- WARNING cargo: not available
  - ADVICE:
    - spawn: cargo failed with exit code - and signal -. cargo is not executable
- WARNING luarocks: not available
  - ADVICE:
    - spawn: luarocks failed with exit code - and signal -. luarocks is not executable
- WARNING javac: not available
  - ADVICE:
    - spawn: javac failed with exit code - and signal -. javac is not executable
- WARNING java: not available
  - ADVICE:
    - spawn: java failed with exit code - and signal -. java is not executable
- WARNING Ruby: not available
  - ADVICE:
    - spawn: ruby failed with exit code - and signal -. ruby is not executable
- WARNING RubyGem: not available
  - ADVICE:
    - spawn: gem failed with exit code - and signal -. gem is not executable
- OK node: `v21.6.1`
- OK python: `Python 3.11.7`
- OK julia: `julia version 1.10.0`
- OK npm: `10.2.4`
- OK pip: `pip 23.3.1 from /home/linuxbrew/.linuxbrew/Cellar/python@3.11/3.11.7_1/lib/python3.11/site-packages/pip (python 3.11)`
- OK python venv: `Ok`

mason.nvim [GitHub] ~
- OK GitHub API rate limit. Used: 8. Remaining: 52. Limit: 60. Reset: Fri 09 Feb 2024 12:19:27 PM MSK.
  Install and authenticate via gh-cli to increase rate limit.

==============================================================================
mkdp: health#mkdp#check

- Platform: linux
- Nvim Version: NVIM v0.9.5
  Build type: RelWithDebInfo
  LuaJIT 2.1.1692716794
  Compilation: /usr/bin/gcc -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wvla -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -fno-common -Wno-unused-result -Wimplicit-fallthrough -fdiagnostics-color=auto -fstack-protector-strong -DUNIT_TESTING -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DUSING_UV_SHARED=1 -I/usr/include/luajit-2.1 -I/usr/include -I/usr/include/luv -I/builddir/build/BUILD/neovim-0.9.5/redhat-linux-build/src/nvim/auto -I/builddir/build/BUILD/neovim-0.9.5/redhat-linux-build/include -I/builddir/build/BUILD/neovim-0.9.5/redhat-linux-build/cmake.config -I/builddir/build/BUILD/neovim-0.9.5/src -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include

  system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

  Run :checkhealth for more info
- Pre build: /var/home/flexagoon/.local/share/nvim/lazy/markdown-preview.nvim/app/bin/markdown-preview-linux
- Pre build version: 0.0.10
- OK Using pre build

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

Configuration ~
- OK no issues found

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

Performance ~
- OK Build type: RelWithDebInfo

Remote Plugins ~
- OK Up to date

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

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

Installation ~
- OK `tree-sitter` found 0.20.8 (parser generator, only needed for :TSInstallFromGrammar)
- OK `node` found v21.6.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 20231205 (Red Hat 13.2.1-6)
- 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.6.13-200.fc39.x86_64",
  sysname = "Linux",
  version = "#1 SMP PREEMPT_DYNAMIC Sat Jan 20 18:03:28 UTC 2024"
} ~

Parser/Features         H L F I J
  - bash                ✓ ✓ ✓ . ✓
  - c                   ✓ ✓ ✓ ✓ ✓
  - dart                ✓ ✓ ✓ ✓ ✓
  - dockerfile          ✓ . . . ✓
  - fish                ✓ ✓ ✓ ✓ ✓
  - gitcommit           ✓ . . . ✓
  - gitignore           ✓ . . . .
  - go                  ✓ ✓ ✓ ✓ ✓
  - gomod               ✓ . . . ✓
  - html                ✓ ✓ ✓ ✓ ✓
  - ini                 ✓ . ✓ . .
  - javascript          ✓ ✓ ✓ ✓ ✓
  - jq                  ✓ ✓ . . ✓
  - json                ✓ ✓ ✓ ✓ .
  - julia               ✓ ✓ ✓ ✓ ✓
  - lua                 ✓ ✓ ✓ ✓ ✓
  - make                ✓ . ✓ . ✓
  - markdown            ✓ . ✓ ✓ ✓
  - markdown_inline     ✓ . . . ✓
  - meson               ✓ . ✓ ✓ ✓
  - perl                ✓ . ✓ . ✓
  - php                 ✓ ✓ ✓ ✓ ✓
  - po                  ✓ . ✓ . ✓
  - python              ✓ ✓ ✓ ✓ ✓
  - scss                ✓ . ✓ ✓ .
  - templ               ✓ . . . ✓
  - toml                ✓ ✓ ✓ ✓ ✓
  - vim                 ✓ ✓ ✓ . ✓
  - vimdoc              ✓ . . . ✓
  - xml                 ✓ ✓ ✓ ✓ ✓
  - 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) ~
- Using: g:python3_host_prog = "/usr/bin/python3"
- Executable: /usr/bin/python3
- Python version: 3.12.1
- pynvim version: 0.5.0
- OK Latest pynvim is installed.

Python virtualenv ~
- OK no $VIRTUAL_ENV

Ruby provider (optional) ~
- WARNING `ruby` and `gem` must be in $PATH.
  - ADVICE:
    - Install Ruby and verify that `ruby` and `gem` commands work.

Node.js provider (optional) ~
- Node.js: v21.6.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 No usable perl executable found

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

- LSP log level : WARN
- Log path: /home/flexagoon/.local/state/nvim/lsp.log
- Log size: 485 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/flexagoon/.local/share/nvim/lazy/nvim-treesitter/parser/bash.so
- OK Parser: c          ABI: 14, path: /home/flexagoon/.local/share/nvim/lazy/nvim-treesitter/parser/c.so
- OK Parser: dart       ABI: 14, path: /home/flexagoon/.local/share/nvim/lazy/nvim-treesitter/parser/dart.so
- OK Parser: dockerfile ABI: 14, path: /home/flexagoon/.local/share/nvim/lazy/nvim-treesitter/parser/dockerfile.so
- OK Parser: fish       ABI: 14, path: /home/flexagoon/.local/share/nvim/lazy/nvim-treesitter/parser/fish.so
- OK Parser: gitcommit  ABI: 14, path: /home/flexagoon/.local/share/nvim/lazy/nvim-treesitter/parser/gitcommit.so
- OK Parser: gitignore  ABI: 13, path: /home/flexagoon/.local/share/nvim/lazy/nvim-treesitter/parser/gitignore.so
- OK Parser: go         ABI: 14, path: /home/flexagoon/.local/share/nvim/lazy/nvim-treesitter/parser/go.so
- OK Parser: gomod      ABI: 14, path: /home/flexagoon/.local/share/nvim/lazy/nvim-treesitter/parser/gomod.so
- OK Parser: html       ABI: 14, path: /home/flexagoon/.local/share/nvim/lazy/nvim-treesitter/parser/html.so
- OK Parser: ini        ABI: 14, path: /home/flexagoon/.local/share/nvim/lazy/nvim-treesitter/parser/ini.so
- OK Parser: javascript ABI: 14, path: /home/flexagoon/.local/share/nvim/lazy/nvim-treesitter/parser/javascript.so
- OK Parser: jq         ABI: 13, path: /home/flexagoon/.local/share/nvim/lazy/nvim-treesitter/parser/jq.so
- OK Parser: json       ABI: 14, path: /home/flexagoon/.local/share/nvim/lazy/nvim-treesitter/parser/json.so
- OK Parser: julia      ABI: 14, path: /home/flexagoon/.local/share/nvim/lazy/nvim-treesitter/parser/julia.so
- OK Parser: lua        ABI: 14, path: /home/flexagoon/.local/share/nvim/lazy/nvim-treesitter/parser/lua.so
- OK Parser: make       ABI: 13, path: /home/flexagoon/.local/share/nvim/lazy/nvim-treesitter/parser/make.so
- OK Parser: markdown   ABI: 14, path: /home/flexagoon/.local/share/nvim/lazy/nvim-treesitter/parser/markdown.so
- OK Parser: markdown_inline ABI: 14, path: /home/flexagoon/.local/share/nvim/lazy/nvim-treesitter/parser/markdown_inline.so
- OK Parser: meson      ABI: 14, path: /home/flexagoon/.local/share/nvim/lazy/nvim-treesitter/parser/meson.so
- OK Parser: perl       ABI: 14, path: /home/flexagoon/.local/share/nvim/lazy/nvim-treesitter/parser/perl.so
- OK Parser: php        ABI: 14, path: /home/flexagoon/.local/share/nvim/lazy/nvim-treesitter/parser/php.so
- OK Parser: po         ABI: 14, path: /home/flexagoon/.local/share/nvim/lazy/nvim-treesitter/parser/po.so
- OK Parser: python     ABI: 14, path: /home/flexagoon/.local/share/nvim/lazy/nvim-treesitter/parser/python.so
- OK Parser: scss       ABI: 13, path: /home/flexagoon/.local/share/nvim/lazy/nvim-treesitter/parser/scss.so
- OK Parser: templ      ABI: 14, path: /home/flexagoon/.local/share/nvim/lazy/nvim-treesitter/parser/templ.so
- OK Parser: toml       ABI: 13, path: /home/flexagoon/.local/share/nvim/lazy/nvim-treesitter/parser/toml.so
- OK Parser: vim        ABI: 14, path: /home/flexagoon/.local/share/nvim/lazy/nvim-treesitter/parser/vim.so
- OK Parser: vimdoc     ABI: 14, path: /home/flexagoon/.local/share/nvim/lazy/nvim-treesitter/parser/vimdoc.so
- OK Parser: xml        ABI: 14, path: /home/flexagoon/.local/share/nvim/lazy/nvim-treesitter/parser/xml.so
- OK Parser: yaml       ABI: 13, path: /home/flexagoon/.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({
  {
    "sainnhe/gruvbox-material",
      priority = 1000,
      config = function()
        vim.opt.termguicolors = true

        vim.g.gruvbox_material_better_performance = 1
        vim.g.gruvbox_material_enable_italic = 1
        vim.g.gruvbox_material_enable_bold = 1
        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 the following contents:

*foo* ~bar~

Expected behavior

The text is italic and strikethrough, as shown in the tree-sitter-markdown readme

Actual behavior

The text is normal

antoineco commented 9 months ago

This looks like a terminal-related issue to me.

Here is how it looks in WezTerm for me: image

I have this option set in my wezterm.lua, as well as the wezterm terminfo installed:

config.term = 'wezterm'

Reference: https://wezfurlong.org/wezterm/config/lua/config/term.html?h=tic#term-xterm-256color

flexagoon commented 9 months ago

@antoineco I am using Wezterm. Using the wezterm terminfo doesn't seem to help.

flexagoon commented 9 months ago

@antoineco are you sure you're using markdown+markdown_inline treesitter instead of regular syntax highlighting?

antoineco commented 9 months ago

Could you please hover the text that is supposed to be displayed as ~strikethrough~, execute :Inspect in Neovim, and share the result?

My output, for reference: image

Same thing for italics: image

antoineco commented 9 months ago

I do use Treesitter, but I'm also running Neovim's dev builds: NVIM v0.10.0-dev-2282+gabfcdd9bf. This could be making a major difference here. Let's see what your commands return.

flexagoon commented 9 months ago

Here:

Italic: image

Strikethrough: image

It seems like in my case they just link to regular @markup whereas on your screenshots they're linked to @markup.(italic|strikethrough)

flexagoon commented 9 months ago

In comparison, they are linked correctly when using the Catppuccin theme, and indeed, italic and strikethrough work with it:

image image image

antoineco commented 9 months ago

It could be because Catppuccin explicitly defines the @markup.italic and @markup.strikethrough groups, whereas we don't. I suspect that these may be built-in on Neovim's development branch, but not in v0.9. I need to investigate though. It should be relatively non intrusive to define them explicitly.

antoineco commented 9 months ago

Ok, I found why this is working out if the box on my build, those features made their way into Neovim in https://github.com/neovim/neovim/pull/27067

And the corresponding changes in Catppuccin: https://github.com/catppuccin/nvim/pull/630

zirdl commented 8 months ago

Any possible solutions for this? I have the same case with @flexagoon, only that I'm using Kitty

flexagoon commented 8 months ago

@zirdl btw I switched to Neovim nightly and the issue no longer happens for me, so you can do that if that's an option

Neovim nightly is available pre-built on AUR and Fedora COPR and Ubuntu PPA so it's not that hard to install

zirdl commented 8 months ago

@zirdl btw I switched to Neovim nightly and the issue no longer happens for me, so you can do that if that's an option

Neovim nightly is available pre-built on AUR and Fedora COPR and Ubuntu PPA so it's not that hard to install

Thank you for this

antoineco commented 8 months ago

@zirdl like @flexagoon said, since nightlies already include that feature and Neovim 0.10 is likely to be released soon, I didn't feel pressed to implement this in the colorscheme.

I understand that Neovim 0.9 users may want to use the latest features from the Tree-sitter integration, so I'm going to add it now to Gruvbox Material.