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

Underline markup returns clear and doesn't underline #661

Closed
Ladas552 opened this issue Feb 16, 2024 · 2 comments · Fixed by #663
Closed

Underline markup returns clear and doesn't underline #661

Ladas552 opened this issue Feb 16, 2024 · 2 comments · Fixed by #663
Labels
bug Something isn't working

Comments

@Ladas552
Copy link

Description

Catppuccin colorscheme with TreeSitter for NeoVim prevents from using underline mark up in, for example, Neorg.

It may be because Catppuccin links to Underline group and not to @markup.underline which is described in TreeSitter's documentation under "treesitter-highlight-groups".

The output of :Inspect for Underline is:

  - @neorg.markup.underline.norg links to Underline norg                                                  
  - @neorg.markup.underline.norg links to Underline norg

While, for example, Italics output works as expected and outputs this:

  - @neorg.markup.italic.norg links to @markup.italic norg                                                
  - @neorg.markup.italic.norg links to @markup.italic norg

The attached screenshots are catppuccin version of markup, and just for example, Gruvbox version.

gruv
cat

As far as I know, this issue is reproducible only when using Catppuccin colorsheme, and not the issue of Neorg or Treesitter projects.

Neovim version

NVIM v0.9.5
Build type: Release
LuaJIT 2.1.1702233742

Terminal and multiplexer

kitty 0.31.0

Catppuccin version / branch / rev

catppuccin v1.6.0

Steps to reproduce

  1. nvim -u repro.lua
  2. :e norg.norg
  3. write _underline_
  4. ESC

Expected behavior

The _underline_ should be underlined.

Actual behavior

It doesn't markup the underline.

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
}
require("lazy").setup({
  {'catppuccin/nvim',
    lazy = false,
    priority = 1000,
    flavour = "macchiato", -- latte, frappe, macchiato, mocha
    config = function()
      require 'catppuccin' .load()
    end
  },
-- add anything else here

  {
    "nvim-neorg/neorg",
    build = ":Neorg sync-parsers",
    lazy = false, -- specify lazy = false because some lazy.nvim distributions set lazy = true by default
    -- tag = "*",
    dependencies = { "nvim-lua/plenary.nvim" },
    config = function()
      require("neorg").setup {
        load = {
          ["core.defaults"] = {}, -- Loads default behaviour
          ["core.concealer"] = {}, -- Adds pretty icons to your documents
          ["core.dirman"] = { -- Manages Neorg workspaces
            config = {
              workspaces = {
                notes = "~/notes",
              },
            },
          },
        },
      }
    end,
  },
    {
    "nvim-treesitter/nvim-treesitter",
    event = { "BufReadPre", "BufNewFile" },
    build = ":TSUpdate",
    dependencies = {
      "windwp/nvim-ts-autotag",
    },
    config = function()
      -- import nvim-treesitter plugin
      local treesitter = require("nvim-treesitter.configs")

      -- configure treesitter
      treesitter.setup({ -- enable syntax highlighting
        highlight = {
          enable = true,
        },
        -- enable indentation
        indent = { enable = true },
        -- enable autotagging (w/ nvim-ts-autotag plugin)
        autotag = {
          enable = true,
        },
        -- ensure these language parsers are installed
        ensure_installed = {
          "norg",
        },
        incremental_selection = {
          enable = true,
          keymaps = {
            init_selection = "<C-space>",
            node_incremental = "<C-space>",
            scope_incremental = false,
            node_decremental = "<bs>",
          },
        },
        -- enable nvim-ts-context-commentstring plugin for commenting tsx and jsx
        context_commentstring = {
          enable = true,
          enable_autocmd = false,
        },
      })
    end,
  },
})
vim.cmd.colorscheme("catppuccin")
@maikelthedev
Copy link

I'm not using catpuccin and yet I have the exact same issue in NvChad.

@xxieen
Copy link

xxieen commented May 13, 2024

I'm not using catpuccin and yet I have the exact same issue in NvChad.

Same, have you solved it?

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

Successfully merging a pull request may close this issue.

3 participants