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

treesitter markdown highlighting broken with catppuccin #655

Closed
scmx opened this issue Jan 31, 2024 · 2 comments
Closed

treesitter markdown highlighting broken with catppuccin #655

scmx opened this issue Jan 31, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@scmx
Copy link

scmx commented Jan 31, 2024

Description

I managed to reproduce the problem below :) very good issue template.


tree-sitter-grammars/tree-sitter-markdown#131
Seems like some change similar to https://github.com/savq/melange-nvim/pull/76/files is needed.
I have looked at #648 which might not be related or perhaps wasn't enough.

With treesitter markdown and catppuccin I see no highlighting of markdown files since updating treesitter. I have latest version of catppuccin and treesitter + markdown.
I have confirmed that :TSUninstall markdown restored the highlighting without treesitter, but it's gone again when :TSInstall markdown.
I tried switching to melange theme and that works fine with treesitter markdown, since that theme has been updated as mentioned in that issue.

Neovim version

NVIM v0.9.4
Build type: Release
LuaJIT 2.1.1700008891

Terminal and multiplexer

doesn't matter (alacritty 0.12.3 with tmux 3.3a)

Catppuccin version / branch / rev

catppuccin master aedcd79

Steps to reproduce

  1. nvim -u repro.lua example.md

example.md

# broken
*broken*
## broken
```typescript
console.log('works')
```

Expected behavior

Syntax highlighting should work for markdown files.

Actual behavior

There's no syntax highlighting for markdown files. But there is syntax highlighting for code blocks via markdown_inline.
catppuccin-treesitter-markdown-broken

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 = {
  "catppuccin/nvim",
  -- add any other plugins here
  {
    "nvim-treesitter/nvim-treesitter",
    config = function()
      require("nvim-treesitter.configs").setup({
        highlight = { enable = true },
        ensure_installed = { "markdown", "markdown_inline" },
      })
    end,
  },
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("catppuccin")
-- add anything else here
@scmx scmx added the bug Something isn't working label Jan 31, 2024
@nullchilly
Copy link
Contributor

Cannot reproduce, aedcd79 isn't a commit from catppuccin

unreproducible.mp4

@scmx
Copy link
Author

scmx commented Jan 31, 2024

✅ Solved by clearing rm -rf .local/share/nvim/lazy

I thought I took the commit hash I saw in lazy, but must have copied wrong 😊 .
I also realized that it might be good to do rm -rf .repro/; nvim -u repro.lua example.md to make sure that some cached stuff don't interfere.

@scmx scmx closed this as completed Jan 31, 2024
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