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

update-metadata doesn't work with code cells in buffer #1233

Closed
2 tasks done
benlubas opened this issue Dec 19, 2023 · 0 comments · Fixed by #1234
Closed
2 tasks done

update-metadata doesn't work with code cells in buffer #1233

benlubas opened this issue Dec 19, 2023 · 0 comments · Fixed by #1234
Labels
bug Issues related to bugs. Please attach a severity, a priority and category with this label.

Comments

@benlubas
Copy link
Contributor

benlubas commented Dec 19, 2023

Prerequisites

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

Neovim Version

NVIM v0.9.4 Build type: Release
LuaJIT 2.1.1693350652

system vimrc file: "$VIM/sysinit.vim"

fall-back for $VIM: " /nix/store/xnfdsm9dgfng2spl17m7b7wgfc0yyaa4-neovim-unwrapped-0.9.4/share/nvim "

Neorg setup

{
    load = {
      ["core.defaults"] = {},
    }
}

Actual behavior

:Neorg update-metadata doesn't work when there's a code cell in the file

Expected behavior

it should work

Steps to reproduce

Open a .norg file
:Neorg inject-metadata
add a code block:

@code python
print('hi') # need to load the python TS parser
@end

Potentially conflicting plugins

none

Other information

This is the issue:

if tree:lang() ~= "norg_meta" or meta_root then
return
end

We're early returning if the first lang isn't correct. But we should probably check all of them.

Help

Yes

Implementation help

I'm fairly sure I know what's going on here. But I'll update this issue if I get smacked by reality.

@benlubas benlubas added the bug Issues related to bugs. Please attach a severity, a priority and category with this label. label Dec 19, 2023
vhyrro pushed a commit that referenced this issue Dec 26, 2023
benlubas added a commit to benlubas/neorg that referenced this issue Jan 11, 2024
sahinf pushed a commit to sahinf/neorg that referenced this issue May 15, 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

Successfully merging a pull request may close this issue.

1 participant