neorg icon indicating copy to clipboard operation
neorg copied to clipboard

Conceal Module breaks Treesitter highlighting on Session Load

Open ziontee113 opened this issue 3 years ago • 0 comments

Prerequisites

  • [X] I have read contribution guidelines
  • [X] I am using the latest version of the plugin
  • [X] I am using either 0.6 stable or the latest compiled neovim version

Neovim Version

0.7

Neorg setup

require("neorg").setup({
	load = {
		["core.defaults"] = {},
		["core.norg.dirman"] = {
			config = {
				autochdir = true,
				autodetect = true,
				workspaces = {
					home = "~/notes/",
				},
			},
		},
		["core.norg.concealer"] = {},
		["core.norg.completion"] = {
			config = { engine = "nvim-cmp" },
		},
		["core.gtd.base"] = {
			config = {
				workspace = "home",
			},
		},
		["core.integrations.telescope"] = {},
	},
})

Actual behavior

Before, with foldlevel=2: Screenshot from 2022-08-03 04-51-36

After, with foldlevel set to 0: Screenshot from 2022-08-03 04-53-23

Expected behavior

Treesitter highlighting doesn't break when setting foldlevel=0

Screenshot from 2022-08-03 04-55-52

Steps to reproduce

  1. Have some custom Treesitter conceal rule in ~/.config/nvim/after/queries/lua/highlights.scm, something like:
(("local"    @keyword) (#set! conceal "~"))
((function_call name: (identifier) @TSNote (#eq? @TSNote "require")) (#set! conceal ""))
  1. Open a lua file on the left split, open a norg file, with concealer module turned on.
  2. Set foldlevel=2
  3. Save the session :makesession Session.vim
  4. Quit nvim
  5. Open nvim, :source Session.vim
  6. Set foldlevel=0

Potentially conflicting plugins

No response

Other information

No response

Help

No

Implementation help

No response

ziontee113 avatar Aug 02 '22 22:08 ziontee113