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

:Neorg journal toc subcommands does not exist #597

Closed
Sammyalhashe opened this issue Sep 28, 2022 · 5 comments · Fixed by #996 or #956
Closed

:Neorg journal toc subcommands does not exist #597

Sammyalhashe opened this issue Sep 28, 2022 · 5 comments · Fixed by #996 or #956

Comments

@Sammyalhashe
Copy link

This might be the result of a messed up configuration file, but the jist of it includes:

        ["core.defaults"] = {},
        ["core.neorgcmd"] = {},
        ["core.keybinds"] = {},
        ["core.norg.concealer"] = {},
        ["core.norg.dirman"] = {
            config = {
                workspaces = {
                    work = "...",
                    personal = "...",
                }
            }
        },
        ["core.norg.completion"] = {
            config = {
                engine = "nvim-cmp",
            },
        },
        ["core.integrations.nvim-cmp"] = {},
        ["core.syntax"] = {},
        ["core.integrations.treesitter"] = {},
        ["core.gtd.base"] = {
            config = {
                workspace = "work"
            },
        },
        ["core.export"] = {},
        ["core.presenter"] = {
            config = {
                zen_mode = "zen-mode"
            },
        },
        ["core.norg.journal"] = {
            config = {
                workspace = "work",
                strategy = "nested",
                toc_format = function (t)
                    // my guess is that it might not be loading because I have not provided a valid configuration for this object?
                end
            },
        },

I am pretty sure this is the result of a messed up config, but I just can't seem to get this command to work.

@vhyrro
Copy link
Member

vhyrro commented Sep 28, 2022

Hi, do you want a custom toc_format? If you don't supply it the default formatting will be applied, which works well on my end :)

@Sammyalhashe
Copy link
Author

Not particularly, this is just an attempt to debug why the sub command wasn't showing for me. If I remove the custom toc_command it's still the same behaviour.

@vhyrro
Copy link
Member

vhyrro commented Sep 28, 2022

🤔 hmm. do you get any errors in :messages other than "the command doesn't exist"? Definitely shouldn't happen.

@Sammyalhashe
Copy link
Author

It's truncated, but this is all I can find:

[neorg] (11:56:47)                                                                                                                                                                                                                      
...r/start/neorg/lua/neorg/modules/core/neorgcmd/module.lua:309                                                                                                                                                                         
Unable to execute command :Neorg journal toc - such a command does not exist.   

Unfortunately, it's all I can work off of :(

@d-r-a-b d-r-a-b moved this to long-term in sorting neorg issue tracker Apr 30, 2023
@d-r-a-b d-r-a-b moved this from long-term to closeable? in sorting neorg issue tracker Apr 30, 2023
@szaffarano
Copy link

Hi @vhyrro I have a similar issue, but in my case I guess is the expected behavior: the toc subcommand only works when I'm in a neorg buffer, otherwise I get

Error when executing `:Neorg %s` - the command is currently disabled. Some commands will only become available under certain conditions!

But on the other hand, if I change the code to bypass this validation (file neorgcmd/module.lua) it works as expected, i.e., I can go to the journal toc from any buffer. Is there any particular reason to validate it? since I don't see any problem with going to the toc from anywhere? 🤔

Thanks because of the great job you are doing!!

sindrets added a commit to sindrets/neorg that referenced this issue Jul 24, 2023
…g#597)

Problem:    Cannot open the journal TOC from outside a norg file.
Solution:   Remove command condition from the 'toc' subcommand.
sindrets added a commit to sindrets/neorg that referenced this issue Jul 24, 2023
…g#597)

Problem:    Cannot open the journal TOC from outside a norg file.
Solution:   Remove command condition from the 'toc' subcommand.
@github-project-automation github-project-automation bot moved this from closeable? to done in sorting neorg issue tracker Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants