Open dlyongemallo opened 2 weeks ago
Hi @dlyongemallo,
Thanks for raising the issue, and sorry for the late reply.
I will push a commit for the fix soon.
For annotating the code blocks, rustc
seems not to have that as an output option, but I've implemented a workaround (from here):
Put this in a script:
#!/bin/bash
if [ "$1" = "--explain" ]
then
shift
fi
if [ "$1" = "" ]
then
echo "Usage: $0 <error code>"
exit 1
fi
rustc --explain "$1" | sed '/^```/{s//&rust/;:a;n;//!ba}'
Then set rustcexplain_rustc_bin
to point to this script.
In particular, this line adds a space before and after each line of the popup message.
The result is this (note that EOL whitespace is highlighted):![Screenshot from 2024-06-14 09-31-37](https://github.com/yining/vim-rustcexplain/assets/9248532/ed552d34-dfed-45a1-994f-a0ebfe23e9e4)
These added spaces break markdown syntax detection. Removing the above line results in:![Screenshot from 2024-06-14 09-32-14](https://github.com/yining/vim-rustcexplain/assets/9248532/48f12197-9890-4c26-af06-6d4c5e125574)
This is slightly better as at least the markdown syntax highlighting is being applied. This could be improved further by annotating the code blocks as Rust:
Finally, making the title into a markdown heading and setting the
conceallevel
to 2, we get this much nicer output: