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

anchor definition not concealed when conceallevel=2 #838

Closed
2 tasks done
champignoom opened this issue May 4, 2023 · 4 comments · Fixed by #834
Closed
2 tasks done

anchor definition not concealed when conceallevel=2 #838

champignoom opened this issue May 4, 2023 · 4 comments · Fixed by #834
Labels
bug Issues related to bugs. Please attach a severity, a priority and category with this label.

Comments

@champignoom
Copy link
Contributor

Prerequisites

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

Neovim Version

v0.9.0

Neorg setup

require('neorg').setup {
	load = {
		["core.defaults"] = {}, -- Loads default behaviour
		["core.norg.concealer"] = {}, -- Adds pretty icons to your documents
		["core.norg.dirman"] = { -- Manages Neorg workspaces
			config = {
				workspaces = {
					notes = "~/notes",
				},
			},
		},
	},
}

Actual behavior

It becomes:

{* heading}

Expected behavior

It should remain:

{◉ heading}

Steps to reproduce

test.norg:

{* heading}

By entering normal mode, it's concealed to

{◉ heading}

Now :set conceallevel=2

Potentially conflicting plugins

No response

Other information

No response

Help

Yes

Implementation help

No response

@champignoom champignoom added the bug Issues related to bugs. Please attach a severity, a priority and category with this label. label May 4, 2023
@champignoom
Copy link
Contributor Author

Ok I just found out that "no-conceal" might be intended for link targets:

query = "[ (heading1_prefix) (link_target_heading1) @no-conceal ] @icon",

But then the problem becomes that it does get concealed when conceallevel != 2. The and has_conceal part below looks suspicious.

if capture == "no-conceal" and has_conceal then
nodes_to_omit[node:id()] = true
end
if capture == "icon" and not nodes_to_omit[node:id()] then

@vhyrro
Copy link
Member

vhyrro commented May 5, 2023

This is intended, when vim's concealing is enabled then there's no way to place the extmark, otherwise the icon overlays the concealed text, which looks like this: ◉eading. There's no way we can implement "reconcealing" on every cursor move, otherwise the entire Neovim instance would very quickly slow down to a crawl.

When you don't hide the text, the concealer will display the icon, as it knows it will never break anything. Otherwise, it just doesn't bother rendering at all.

Closing since this is intended behaviour :)

@champignoom
Copy link
Contributor Author

This is now fixable with #834.

@champignoom
Copy link
Contributor Author

champignoom commented May 21, 2023

but the fix might trigger a neovim bug neovim/neovim#23706
EDIT: that bug has been fixed

vhyrro pushed a commit that referenced this issue May 30, 2023
Co-authored-by: Vhyrro <vhyrro@gmail.com>
- fixes #821
- fixes #831
- fixes #833
- fixes #838 (reopening wanted)
- fixes #839
- fixes #844
- fixes #846
- fixes #848
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

Successfully merging a pull request may close this issue.

2 participants