martineausimon/nvim-lilypond-suite

Ftdetect error

Closed this issue · 3 comments

kflak commented

Hi, and thanks for what looks like an absolutely awesome plugin!

Trying to run it on Arch Linux, and getting this error:

Error detected while processing /home/kf/.local/share/nvim/site/pack/packer/start/nvim-lilypond-suite/ftdetect/filetype.lua:
E5113: Error while calling lua chunk: ...k/packer/start/nvim-lilypond-suite/ftdetect/filetype.lua:9: 'group' must be a string or an integer.
stack traceback:
        [C]: in function 'nvim_create_autocmd'
        ...k/packer/start/nvim-lilypond-suite/ftdetect/filetype.lua:9: in main chunk

Checkhealth returns no relevant errors. Nvim version:

NVIM v0.7.2
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by builduser

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

EDIT:

OK, looking into it a bit more now, and the vim.api.nvim_create_autocmd is wrong.
This works:

	vim.api.nvim_create_autocmd(
		{ 'BufNewFile', 'BufRead' },
		{
			command = "set ft=lilypond",
			pattern = { '*.ly', '*.ily' },
            group =  vim.api.nvim_create_augroup("LilypondAutocmds", { clear = true})
		}
	)
kflak commented

Unfortunately no time to do a PR now, gotta run...

Thank you for the feedback ! It's fixed now

kflak commented

Fantastic! Extremely quick fix :-)