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

Promo requires concealer #767

Closed
2 tasks done
FeiyouG opened this issue Feb 28, 2023 · 1 comment
Closed
2 tasks done

Promo requires concealer #767

FeiyouG opened this issue Feb 28, 2023 · 1 comment
Labels
bug Issues related to bugs. Please attach a severity, a priority and category with this label.

Comments

@FeiyouG
Copy link

FeiyouG commented Feb 28, 2023

Prerequisites

  • I am using either 0.7 stable with the 0.0.12 tag or the latest compiled Neovim version
  • I am using the latest version of the plugin

Neovim Version

0.8.2

Neorg setup

return {
	"nvim-neorg/neorg",
	dependencies = { { "nvim-lua/plenary.nvim" } },
	run = ":Neorg sync-parsers", -- This is the important bit!
	config = function()
		require("neorg").setup({
			load = {
				["core.defaults"] = {},
			},
		})
	end,
}

Actual behavior

When indent a list with >>, the following error is thrown:

Error executing Lua callback: ...youguo/.local/share/nvim/lazy/neorg/lua/neorg/events.lua:136: attempt to index local 'event' (a nil value)
stack traceback:
        ...youguo/.local/share/nvim/lazy/neorg/lua/neorg/events.lua:136: in function 'broadcast_event'
        .../nvim/lazy/neorg/lua/neorg/modules/core/promo/module.lua:185: in function 'promote_or_demote'
        .../nvim/lazy/neorg/lua/neorg/modules/core/promo/module.lua:203: in function 'on_event'
        ...youguo/.local/share/nvim/lazy/neorg/lua/neorg/events.lua:153: in function 'broadcast_event'
        ...im/lazy/neorg/lua/neorg/modules/core/keybinds/module.lua:445: in function <...im/lazy/neorg/lua/neorg/modules/core/keybinds/module.lua:430>
        ...im/lazy/neorg/lua/neorg/modules/core/keybinds/module.lua:429: in function 'on_event'
        ...youguo/.local/share/nvim/lazy/neorg/lua/neorg/events.lua:153: in function 'broadcast_event'
        ...im/lazy/neorg/lua/neorg/modules/core/neorgcmd/module.lua:289: in function <...im/lazy/neorg/lua/neorg/modules/core/neorgcmd/module.lua:196>

and the following warning is shown:

.../.local/share/nvim/lazy/neorg/lua/neorg/events.lua:105
Unable to create event of type core.norg.concealer.events.update_region . Returning nil...

Expected behavior

I expect>> to increase the indentation level for the current object correctly.

Steps to reproduce

  1. Reuqire only core.default modules
  2. Indent an object with >>

Potentially conflicting plugins

As I look through the implementation of core.promo, I found it actually requires core.norg.concealer to broadcast the event.
I might be wrong as I am very new to neorg (I literally started using it this morning).

Other information

No response

Help

Yes, but I don't know how to start. I would need guidance (check question below)

Implementation help

I think the best solution is to check whether the concealer module is loaded before creating and broadcasting a core.norg.concealer.events.update_region event with promo, but I am not 100% this is the preferred approach.

@FeiyouG FeiyouG added the bug Issues related to bugs. Please attach a severity, a priority and category with this label. label Feb 28, 2023
@vhyrro
Copy link
Member

vhyrro commented Mar 7, 2023

You're right, it shouldn't be like this :)

It should be fixed in the latest commit! If it still fails then feel free to reopen

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

2 participants