Quantcast

Different syntax behavior in vim 7.4

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Different syntax behavior in vim 7.4

Chandra
Hello,
    I see a syntax behavior change between vim 7.4 and earlier version. (We are yet to update VIM version to 8.0+ in our company.)

I use different syntax for lines that begin with "//" (Comments) and lines that begin with "//:" (embedded Perl Code). I was able to achieve this with earlier version of vim by specifying this in the syntax file,

         syn match embPerlCode "^\s*//:.*"

and this in .gvimrc,

         highlight embPerlCode gui=bold guifg=maroon

This works fine in version 7.2 (didn't check in 7.3). But in version 7.4 the behavior has changed. The embPerlCode lines are shown with syntax color of Comments.

Is there a way to get around this and get back the previous behavior?

thanks,
Chandra

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Different syntax behavior in vim 7.4

Dominique Pellé
Chandra <[hidden email]> wrote:

> Hello,
>     I see a syntax behavior change between vim 7.4 and earlier
> version. (We are yet to update VIM version to 8.0+ in our company.)
>
> I use different syntax for lines that begin with "//" (Comments) and
> lines that begin with "//:" (embedded Perl Code). I was able to
> achieve this with earlier version of vim by specifying this in the
> syntax file,
>
>          syn match embPerlCode "^\s*//:.*"
>
> and this in .gvimrc,
>
>          highlight embPerlCode gui=bold guifg=maroon
>
> This works fine in version 7.2 (didn't check in 7.3). But in version
> 7.4 the behavior has changed. The embPerlCode lines are
> shown with syntax color of Comments.
>
> Is there a way to get around this and get back the previous behavior?

Using vim-8.0.543 (gtk3 gui), it works as expected for me
i.e. I see different colors for comments if I do:

$ vim -f -g \
  -c 'syntax on' \
  -c 'setfiletype cpp' \
  -c 'syn match embPerlCode "^\s*//:.*"' \
  -c 'hi embPerlCode gui=bold guifg=maroon' \
  -c 'call setline(1, ["// a cpp comment", "//: an empPerlCode comment"])'

Can you double check?

If you use vim-7.2 or 7.3, you're missing a lot of
fixes and useful new features.

Dominique

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Different syntax behavior in vim 7.4

Chandra
Yes, I could get the expected syntax display with vim 8.0 .

Thanks.

On Wed, Apr 5, 2017 at 3:43 PM, Dominique Pellé <[hidden email]> wrote:
Chandra <[hidden email]> wrote:

> Hello,
>     I see a syntax behavior change between vim 7.4 and earlier
> version. (We are yet to update VIM version to 8.0+ in our company.)
>
> I use different syntax for lines that begin with "//" (Comments) and
> lines that begin with "//:" (embedded Perl Code). I was able to
> achieve this with earlier version of vim by specifying this in the
> syntax file,
>
>          syn match embPerlCode "^\s*//:.*"
>
> and this in .gvimrc,
>
>          highlight embPerlCode gui=bold guifg=maroon
>
> This works fine in version 7.2 (didn't check in 7.3). But in version
> 7.4 the behavior has changed. The embPerlCode lines are
> shown with syntax color of Comments.
>
> Is there a way to get around this and get back the previous behavior?

Using vim-8.0.543 (gtk3 gui), it works as expected for me
i.e. I see different colors for comments if I do:

$ vim -f -g \
  -c 'syntax on' \
  -c 'setfiletype cpp' \
  -c 'syn match embPerlCode "^\s*//:.*"' \
  -c 'hi embPerlCode gui=bold guifg=maroon' \
  -c 'call setline(1, ["// a cpp comment", "//: an empPerlCode comment"])'

Can you double check?

If you use vim-7.2 or 7.3, you're missing a lot of
fixes and useful new features.

Dominique

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to a topic in the Google Groups "vim_use" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_use/bO4pbg3nvoU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Loading...