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

Setting org_todo_keyword_faces results in error #416

Closed
bronzehedwick opened this issue Sep 24, 2022 · 6 comments · Fixed by #417
Closed

Setting org_todo_keyword_faces results in error #416

bronzehedwick opened this issue Sep 24, 2022 · 6 comments · Fixed by #417
Labels
bug Something isn't working

Comments

@bronzehedwick
Copy link

Describe the bug

When setting the org_todo_keyword_faces property to any value (tested with TODO and DONE keywords), opening a org file results in the following error.

Error detected while processing nvim_exec() called at /Users/chris/.local/share/nvim/site/pack/packer/start/orgmode/syntax/org.vim:7:
W18: Invalid character in group name

Steps to reproduce

  1. Add a color override to org_todo_keyword_faces.
  2. Edit an org file
  3. Notice the error in the message area

Note that the color override itself still takes effect.

Expected behavior

No error should occur.

Emacs functionality

n/a

Minimal init.lua

vim.cmd([[set runtimepath=$VIMRUNTIME]])
vim.cmd([[set packpath=/tmp/nvim/site]])

local package_root = '/tmp/nvim/site/pack'
local install_path = package_root .. '/packer/start/packer.nvim'

local function load_plugins()
  require('packer').startup({
    {
      'wbthomason/packer.nvim',
      { 'nvim-treesitter/nvim-treesitter' },
      { 'kristijanhusak/orgmode.nvim', branch = 'master' },
    },
    config = {
      package_root = package_root,
      compile_path = install_path .. '/plugin/packer_compiled.lua',
    },
  })
end

_G.load_config = function()
  require('orgmode').setup_ts_grammar()
  require('nvim-treesitter.configs').setup({
    highlight = {
      enable = true,
      additional_vim_regex_highlighting = { 'org' },
    },
  })

  vim.cmd([[packadd nvim-treesitter]])
  vim.cmd([[runtime plugin/nvim-treesitter.lua]])
  vim.cmd([[TSUpdateSync org]])

  -- Close packer after install
  if vim.bo.filetype == 'packer' then
    vim.api.nvim_win_close(0, true)
  end

  require('orgmode').setup({
    org_todo_keyword_faces = {
      DONE = ':foreground green'
    }
  })

  -- Reload current file if it's org file to reload tree-sitter
  if vim.bo.filetype == 'org' then
    vim.cmd([[edit!]])
  end
end

if vim.fn.isdirectory(install_path) == 0 then
  vim.fn.system({ 'git', 'clone', 'https://github.com/wbthomason/packer.nvim', install_path })
  load_plugins()
  require('packer').sync()
  vim.cmd([[autocmd User PackerCompileDone ++once lua load_config()]])
else
  load_plugins()
  load_config()
end

Screenshots and recordings

No response

OS / Distro

macOS 12.6

Neovim version/commit

v0.7.2

Additional context

No response

@bronzehedwick bronzehedwick added the bug Something isn't working label Sep 24, 2022
@jgollenz
Copy link
Contributor

I can confirm this. Does neither happen in 0.7.0 nor nightly for me, only on 0.7.2.

@bronzehedwick
Copy link
Author

Tried out nightly but I get a different error, so probably a rabbit hole.

@jgollenz
Copy link
Contributor

a different error

please post it regardless 🙂

@cands
Copy link

cands commented Sep 25, 2022

I can also confirm this issue on nvim 0.7.2.

@jgollenz
Copy link
Contributor

jgollenz commented Sep 25, 2022

It was introduced by 5b667f4

edit: The vim.fn.has('nvim-0.8') check also returns true in 0.7.2 apparently. However, :lua print(vim.fn.has('nvim-0.8')) returns 0.

@bronzehedwick
Copy link
Author

Thanks so much @jgollenz !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants