Closed nexxai closed 2 months ago
Seems like this issue is related to https://github.com/mistricky/codesnap.nvim/issues/67
The syntax highlighting is implements by syntect, I just figure it out, the syntect have two diffience language type names "PHP" & "PHP Source", if need to highlight PHP code snippet should use "PHP Source" instead of "PHP".
I'm already improve the strategy of highlight PHP filetype. I have test it on the latest version v1.1.12, it's works propertly for me.
Can you test this issue with the latest version of CodeSnap.nvim (v1.1.12)? if there still have any problem, please let me know. @nexxai Thx for this issue report
Looks perfect. Thanks!
I apologize for the less than descriptive title, but let me explain with screenshots.
Let's say I have this PHP class:
If I select this text:
the highlighting works perfectly:![faaa5d4c-b43f-4522-a984-0ed4652d1bcb](https://github.com/mistricky/codesnap.nvim/assets/4316564/9d0b6e58-1085-4e28-9162-700261e49973)
But if I simply miss including the
<?php
tag at the top of every PHP file in the selection:Everything stays dark:![71b59030-99bf-471a-bbab-91d0e5422e08](https://github.com/mistricky/codesnap.nvim/assets/4316564/2ab43787-3945-4d5d-a473-605bc6b48cc9)
Now, OK, at first glance it seems like it's using the opening tag to figure out the language, and since it isn't sure, it doesn't do anything, but it does highlight very common coding words but only ever in PHP DocBlock comments:![82062d6c-7ba9-492e-938e-570373f2f081](https://github.com/mistricky/codesnap.nvim/assets/4316564/9cecd10d-bc5e-4ca2-acca-452fe3b9bb92)
Is there anything I can do about this, or am I just kind of stuck?