nvim-orgmode / orgmode

Orgmode clone written in Lua for Neovim 0.9+.
https://nvim-orgmode.github.io/
MIT License
3.03k stars 134 forks source link

Treesitter error #170

Closed yigothu closed 2 years ago

yigothu commented 2 years ago

Describe the bug

Running Neovim nightly.

Only plugins are Orgmode and Treesitter.

I get the following error (visible through :messages) when entering any .org file with a code block:

Error detected while processing nvim_exec() called at /path/to/plugins/orgmode/syntax/org.vim:70:
W18: Invalid character in group name

Steps to reproduce

Following error (visible through :messages) when entering any .org file with a code block:

Error detected while processing nvim_exec() called at /path/to/plugins/orgmode/syntax/org.vim:70:
W18: Invalid character in group name

Expected behavior

No error.

Emacs functionality

No response

Minimal init.lua

set nocompatible
filetype plugin on

call plug#begin('~/.path/to/plugins')
Plug 'nvim-orgmode/orgmode'
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}  
call plug#end()

lua << EOF
local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
parser_config.org = {
  install_info = {
    url = 'https://github.com/milisims/tree-sitter-org',
    revision = 'main',
    files = {'src/parser.c', 'src/scanner.cc'},
  },
  filetype = 'org',
}

require'nvim-treesitter.configs'.setup {
  -- If TS highlights are not enabled at all, or disabled via `disable` prop, highlighting will fallback to default Vim syntax highlighting
  highlight = {
    enable = true,
    disable = {'org'}, -- Remove this to use TS highlighter for some of the highlights (Experimental)
    additional_vim_regex_highlighting = {'org'}, -- Required since TS highlighter doesn't support all syntax features (conceal)
  },
  ensure_installed = {'org'}, -- Or run :TSUpdate org
}

require('orgmode').setup({
  org_agenda_files = {'~/path/org/*', '~/my-orgs/**/*'},
  org_default_notes_file = '~/path/org/refile.org',
})
EOF

Screenshots and recordings

No response

OS / Distro

macOS

Neovim version/commit

Nightly

Additional context

Same error message as this issue.

Commenting out the offending line:

lua require("orgmode.org.syntax").load_code_blocks()

removes the error (but also the code block functionality, obviously).

kristijanhusak commented 2 years ago

Please provide the code block content so I can test.

kristijanhusak commented 2 years ago

Pull latest master and give it a try. Should be working now, even though I wasn't able to reproduce it.

yigothu commented 2 years ago

Sorry GitHub decided it didn't want to give me notifications. I confirm it's fixed now.