nvim icon indicating copy to clipboard operation
nvim copied to clipboard

Underline markup returns clear and doesn't underline

Open Ladas552 opened this issue 2 years ago • 0 comments

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")

Ladas552 avatar Feb 16 '24 16:02 Ladas552