HealsCodes / vim-gas

Advanced syntax highlighting for GNU As
BSD 3-Clause "New" or "Revised" License
143 stars 21 forks source link

gas comment not highlighted correctly #6

Closed walkerlala closed 8 years ago

walkerlala commented 8 years ago

Hi, I'm using your gas.vim. Everything works pretty well except the c++-style comment highlighting, that is, something like this:

//this is a comment

would not be highlighted correctly.

I try to add a line in your gas.vim like this:

syn region gasComment start=/\/\//   end=/$/

still not work.

Thanks.

HealsCodes commented 8 years ago

Hi, according to the documentation that's not a valid comment syntax for GNU AS. Only # and /* .. */ are specified for comments by default (single line and block comment).

If you want to add C++ style single line comments to your highlights you can use:

syn region gasCommentSingle start=/\/\// end=/$/

That should produce the desired highlighting in vim.

walkerlala commented 8 years ago

I did add

syn region gasCommentSingle  start=/\/\// end=/$/

but it does not work(weird) Is it possible that it 's because of my colorscheme? However, another single line comment(i.e. the # one), does work

HealsCodes commented 8 years ago

That's strange indeed. I placed my modified version which I used to test that line here - feel free to try it.

vim buffer showing the modified highlighting

walkerlala commented 8 years ago

yes, my fault. I put that gas.vim in .vim/syntax, but I only change the one in .vim/bundle/gas-vim/syntax. Work now. Thanks!

HealsCodes commented 8 years ago

You're welcome. Also there's now an updated version of the syntax file for everyone which supports the option g:gasCppComments to toggle the additional highlights.