codesnap.nvim
codesnap.nvim copied to clipboard
Crashing when run on not popular languages (e.g. gleam)
- Create
main.gleamfile - Fill it with:
pub fn main() {
}
- Save file
- Select all lines and do
:CodeSnap - Crashes with:
thread '<unnamed>' panicked at library/core/src/panicking.rs:221:5:
panic in a function that cannot unwind
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
unwinding panic. aborting.
- Works for other languages: C++, Python
- Using packer
- Compiled from source
- Arch-linux
I came here specifically to also ask for Gleam support. It's a pretty language to share!
I'll take a closer look asap, but for now, here's what I found:
- Gleam is not yet handled by
syntect(and adding support for new langs seems to be tricky): https://github.com/trishume/syntect/issues/168 - the way the syntax detection is done, might lead to a panic: https://github.com/mistricky/codesnap.nvim/blob/6400480aa6cc366cbd931146c429aaa64680dab9/generator/src/highlight.rs#L44-L66
Have the same issue with GDscript
Same issue with python, not working here.
@wczyz Codesnap.nvim v2.0.0-beta.17 has been released. Could you test whether everything works correctly on beta 17? This version introduces some breaking changes, so it's best to completely uninstall your previous Codesnap.nvim installation and follow the v2 README