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

Concealer stopped working after upgrade to 8.0 #1417

Closed
2 tasks done
michaeyk opened this issue May 8, 2024 · 8 comments
Closed
2 tasks done

Concealer stopped working after upgrade to 8.0 #1417

michaeyk opened this issue May 8, 2024 · 8 comments
Labels
bug Issues related to bugs. Please attach a severity, a priority and category with this label.

Comments

@michaeyk
Copy link

michaeyk commented May 8, 2024

Prerequisites

  • I am using the latest stable release of Neovim
  • I am using the latest version of the plugin

Neovim Version

NVIM v0.9.5

Neorg setup

require("neorg").setup {
    load = {
        ["core.defaults"] = {},
        ["core.dirman"] = {
            config = {
                workspaces = {
                    notes = "~/documents/notes",
                },
                default_workspace = "notes",
            }
        },
        -- ["core.tempus"] = {}, -- need nvim 10.0 or greater
            ["core.completion"] = { config = { engine = "nvim-cmp", name = "[Norg]" } },
        ["core.integrations.telescope"] = {},
        ["core.integrations.treesitter"] = {},
        ["core.concealer"] = {
            config = {
                folds = false,
                icon_preset = "diamond",
            }
        },
        ["core.summary"] = {},
        ["core.export"] = {},
        ["core.keybinds"] = {
            -- https://github.com/nvim-neorg/neorg/blob/main/lua/neorg/modules/core/keybinds/keybinds.lua
                config = {
                    default_keybinds = true,
                    neorg_leader = "<Leader>",
                },
        },
    },
}

-- These groups allow customization of the Neorg highlights
vim.api.nvim_set_hl(0, '@neorg.markup.bold.norg', { link = 'NeorgCustomBold'})
vim.api.nvim_set_hl(0, '@neorg.markup.italic.norg', { link = 'NeorgCustomItalic'})
vim.api.nvim_set_hl(0, '@neorg.markup.strikethrough.norg', { link = 'NeorgCustomStrikethrough'})
vim.api.nvim_set_hl(0, '@neorg.links.description.norg', { link = 'NeorgCustomLink'})

-- This autocommand allows for automatic concealing of Neorg files.
-- There is a plugin already that does that, but this is a failsafe.
vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, {
        pattern = {"*.norg"},
        callback = function ()
        vim.opt.conceallevel = 2
        vim.opt.concealcursor = 'nc'
        end
        })

Actual behavior

Conceal doesn't work for links.
2024-05-08-121031_screenshot

Expected behavior

Links should be hidden unless cursor is on them. Strikethrough doesn't work either. Lists work as expected.

Steps to reproduce

Noticed the problem after a successful upgrade to 8.0.

Potentially conflicting plugins

Not sure. I tried commenting out some of my plugins, no help.

Other information

I tried nvim nightly. I set the conceallevel explicitly. I have changed colorschemes.

Help

None

Implementation help

No response

@michaeyk michaeyk added the bug Issues related to bugs. Please attach a severity, a priority and category with this label. label May 8, 2024
@benlubas
Copy link
Contributor

@michaeyk does conceal work in other parts of neovim? For markdown/json for example?

This seems like a conceal problem rather than a concealer problem b/c headings are working (which are handled by the concealer).

I can't reproduce this at all btw.

@michaeyk
Copy link
Author

Conceal works fine on markdown files.

@michaeyk
Copy link
Author

bold text doesn't conceal. It seems like headings are the only things that work.

@benlubas
Copy link
Contributor

Headings and lists probably. They're the two that are done differently to the links/bold/italic/etc.

This is exactly what I would expect to happen if conceallevel isn't set properly, but that can't be the case if you've set it manually (I'd just quadruple check to be sure :set conceallevel? or :lua print(vim.opt.conceallevel:get()) in the norg buffer to see its value).

If you could provide a minimal nvim config for reproducing that would be great. If I can't reproduce the issue I unfortunately can't offer much more help.

@benlubas
Copy link
Contributor

Wait.

Do you have treesitter highlighting enabled?

@benlubas
Copy link
Contributor

no you don't. That's the issue. Add this to your configuration (you already load this plugin, you just never configure it).

{
  "nvim-treesitter/nvim-treesitter",
  lazy = false,
  config = function()
    ---@diagnostic disable-next-line: missing-fields
    require("nvim-treesitter.configs").setup({
      highlight = {
        enable = true,
        additional_vim_regex_highlighing = { "typst" },
      },
      indent = {
        enable = true,
      },
    })
  end,
}

@michaeyk
Copy link
Author

Thank you! That was it.

@vhyrro
Copy link
Member

vhyrro commented May 17, 2024

Closing as fixed, this will become even less of an issue once we stop relying on nvim-treesitter :)

@vhyrro vhyrro closed this as completed May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues related to bugs. Please attach a severity, a priority and category with this label.
Projects
None yet
Development

No branches or pull requests

3 participants