Closed lostl1ght closed 2 months ago
This hack helps:
-- lua/noice/text/syntax.lua
lang = lang:gsub('[^%w_-]', '')
Upon further inspection, documentation indeed has {toml}
in code block section:
It's almost at the end there:
\n\n```{toml}\n[dependencies]\nconvert_case = { version = \"^0.3.0\", features = [\"random\"] }\n```
Did you check docs and existing issues?
Neovim version (nvim -v)
0.10.0
Operating system/version
Debian 12
Describe the bug
Error
``` Error detected while processing nvim_exec2(): Error executing vim.schedule lua callback: .../site/pack/deps/opt/noice.nvim/lua/noice/text/syntax.lua:9: Error executing lua: vim/_editor.lua:0: nvim_exec2(): Vim(syntax):E5248: Invalid character in group name stack traceback: [C]: in function 'nvim_exec2' vim/_editor.lua: in function 'cmd' .../site/pack/deps/opt/noice.nvim/lua/noice/text/syntax.lua:18: in function <.../site/pack/deps/opt/noice.nvim/lua/noice/text/syntax.lua:9> [C]: in function 'nvim_buf_call' .../site/pack/deps/opt/noice.nvim/lua/noice/text/syntax.lua:9: in function 'highlight' ...im/site/pack/deps/opt/noice.nvim/lua/noice/text/init.lua:70: in function 'highlight' ...e/nvim/site/pack/deps/opt/nui.nvim/lua/nui/line/init.lua:58: in function 'highlight' ...e/nvim/site/pack/deps/opt/nui.nvim/lua/nui/line/init.lua:73: in function 'render' ...m/site/pack/deps/opt/noice.nvim/lua/noice/text/block.lua:98: in function 'render' ...site/pack/deps/opt/noice.nvim/lua/noice/lsp/override.lua:52: in function 'stylize_markdown' ...m/site/pack/deps/opt/nvim-cmp/lua/cmp/view/docs_view.lua:64: in function 'open' .../share/nvim/site/pack/deps/opt/nvim-cmp/lua/cmp/view.lua:292: in function 'callback' ...nvim/site/pack/deps/opt/nvim-cmp/lua/cmp/utils/async.lua:138: in function '' vim/_editor.lua: in functionUnder certain circumstances completion produces the error above.
Apparently, the value of
lang
variable inM.highlight()
function becomes{toml}
for some reason.I'm able to reliably reproduce the error with these snippets of code:
Code
**Cargo.toml** ```toml [package] name = "tom" version = "0.1.0" edition = "2021" [dependencies] convert_case = "0.6.0" ``` **main.rs** ```rust use convert_case; fn main() { println!("Hello, world!"); } ```Steps To Reproduce
cargo new tom
Cargo.toml
as abovemain.rs
as aboveconvert_case
and pressK
Expected Behavior
No error
Repro