Closed rikhuijzer closed 4 months ago
Thanks for using it!
Hmm, are you sure? References should have highlighting. Could you provide a complete code snippet?
Hmm, are you sure? References should have highlighting. Could you provide a complete code snippet?
Hmm yes this is what I see
so @bloam2020mlj
is not highlighted. This is also after disabling all my plugins. Do you know anything I can do to debug this or provide more information?
Strange... I see that <label>
also has wrong highlighting (no color on the delimiters)
Are you on vim or neovim, and which version? Have you updated the plugin recently?
Strange... I see that
<label>
also has wrong highlighting (no color on the delimiters)Are you on vim or neovim, and which version? Have you updated the plugin recently?
Yes weird
Are you on vim or neovim, and which version?
$ nvim --version
NVIM v0.10.0-dev-091e374
Build type: Release
LuaJIT 2.1.1693350652
Have you updated the plugin recently?
I just did a PlugUpdate
while having set Plug 'kaarmu/typst.vim'
. It updated something (80 added lines), but I'm not sure what commit exactly. The highlighting looks the same after the update and a Nvim restart.
Hmm... I just checked with a nightly build of neovim and it worked fine for me. Would you mind checking the syntstack like this:
nnoremap <F10> :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<'
\ . synIDattr(synID(line("."),col("."),0),"name") . "> lo<"
\ . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">"<CR>
some text [@]author more text
have cursor on @
some text @a[u]thor more text
have cursor on any letter in the referenceAlso, it seems like labels highlighting is just broken when in code mode. Somehow I'd just missed implementing that until now :upside_down_face: Fixed in a4e7371.
Hmm... I just checked with a nightly build of neovim and it worked fine for me. Would you mind checking the syntstack like this:
Thanks for the clear instructions and your persistence in debugging this. Log outputs are shown below.
some text [@]author more text
have cursor on@
hi<typstMarkupReference> trans<typstMarkupReference> lo<Type>
some text @a[u]thor more text
have cursor on any letter in the reference
hi<typstMarkupReference> trans<typstMarkupReference> lo<Type>
I've moved the cursor around a bit and confirmed that both at the @
and at the text give indeed the same output.
Also, it seems like labels highlighting is just broken when in code mode. Somehow I'd just missed implementing that until now 🙃 Fixed in a4e7371.
Nice. Then we achieved at least something in this issue so far 😛
Can this perhaps be due to a colorscheme? If you check the Structure
group in :highlight
, does the xxx
have the same highlighting as your reference (i.e. plain normal text)? Here is mine with Vim's default colorscheme.
I'm not sure what the output of :highlight
means, but here it is:
So I guess this is the problem? xxx
are white for me (like the text)? I guess we can close this issue then if yes.
The issue persists after resetting :highlight
via :highlight clear
. I have also double checked my init.vim
but don't see obvious causes for the changed highlighting.
I have removed the plugs (especially vim-airline
) but the colors remain the same.
Yes, your problem originates from somewhere else, but we can try to debug it (I'll close the issue though).
I would start by checking if :highlight Structure
is still white when you're running barebones nvim -u NORC
. It's also good to confirm that you don't have other init scripts in ~/.vim
, ~/.config/nvim
, etc. that change highlighting.
Also, did you confirm that you were using default highlighting?
Just to mention this as well, if linking to Structure does not work then we can have a discussion about switching highlighting group we inherit from. However, then we should open a new issue for that specific topic.
but we can try to debug it (I'll close the issue though).
I'm impressed by your persistence!
I would start by checking if
:highlight Structure
is still white when you're running barebonesnvim -u NORC
. It's also good to confirm that you don't have other init scripts in~/.vim
,~/.config/nvim
, etc. that change highlighting.
I've checked it and nvim -u NORC
doesn't change anything. Still the same. Also, I had no other init scripts.
Also, did you confirm that you were using default highlighting?
I followed https://stackoverflow.com/questions/2419624, by running :echo g:colors_name
which returned a E121. According to that post, this means that I have the default color scheme set. Running :colorscheme default
did not change my colors meaning that I did not have a malformed color scheme.
As a test, I changed to the tokyonight color scheme, which is a popular one according to Reddit, with
colorscheme tokyonight
and now the highlighting indeed does work as expected! 🚀
Just to mention this as well, if linking to Structure does not work then we can have a discussion about switching highlighting group we inherit from. However, then we should open a new issue for that specific topic.
I guess whether that is required is best judged by you. The idea would make sense to me, since it looks like it could fix the issue for other people with default configs, but I'm not sure how "default" my config really is.
Great! If you are happy with non-default colorschemes then it is resolved. Since it doesn't seem like you get normal highlighting for Structure I'd say we hold on switching parent group. Though if it comes up again...
Sounds good! I now switched to another colorscheme and all is working well for me.
Thanks for the help @kaarmu! Much appreciated! I learned a lot about nvim throughout this conversation
Thanks for making
typst.vim
. It helps me a lot while editing documents.I would like to make a feature request and hope this is the right place. Would it be possible to also color citations of the form
@somelabel
? I currently have colors for function calls likecite(<somelabel>)
, but not for@somelabel
.