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

bug: two underline at once for markdown #180

Open
2 tasks done
rodhash opened this issue Dec 3, 2024 · 0 comments
Open
2 tasks done

bug: two underline at once for markdown #180

rodhash opened this issue Dec 3, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@rodhash
Copy link

rodhash commented Dec 3, 2024

Did you check existing issues?

  • I have read all the tree-sitter docs if it relates to using the parser
  • I have searched the existing issues

Tree-Sitter CLI Version, if relevant (output of tree-sitter --version)

tree-sitter 0.25.0 (18e4a2405b52ecd3cb9aefdd05d6554e76823473)

Describe the bug

It seems we have some integration bug between this parser and iTerm2.

After installilng this parser hyperlinks get a 2nd (dashed) underline and it looks quite weird:

Image

notes:

  1. In iTerm2 "Underline OSC 8 hyperlinks" is already disabled. This dashed underline shows up only in neovim w/ this parser installed.
  2. This bug doesn't happen when using other terminals like Kitty.

Any idea how to disable this 2nd (dashed) underline?

As a workaround I'm disabling the parser for markdown files but this isn't ideal.

Nvim v0.11.0-dev-1028+g6dad1f9f1
iTerm 3.5.10

Thanks.

Steps To Reproduce/Bad Parse Tree

  1. install markdown + this parser
  2. open a MD file
  3. To to a line with hyperlinks
  4. You should see double underline

Expected Behavior/Parse Tree

No dobule underline (specially the dashed one)

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 = {
  "nvim-treesitter/nvim-treesitter",
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})



require'nvim-treesitter.configs'.setup {
  -- A list of parser names, or "all" (the listed parsers MUST always be installed)
  ensure_installed = { "markdown", "markdown_inline" },

  -- Install parsers synchronously (only applied to `ensure_installed`)
  sync_install = false,

  -- Automatically install missing parsers when entering buffer
  -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
  auto_install = true,


  ---- If you need to change the installation directory of the parsers (see -> Advanced Setup)
  -- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")!

  highlight = {
    enable = true,

    -- NOTE: these are the names of the parsers and not the filetype. (for example if you want to
    -- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is
    -- the name of the parser)
    -- list of language that will be disabled
    -- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files
  },
}
@rodhash rodhash added the bug Something isn't working label Dec 3, 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

1 participant