On Sat, 16 May 2020, Nicola wrote:

On 2020-05-14, Aditya Mahajan <adit...@umich.edu> wrote:
On Thu, 14 May 2020, Nicola wrote:

Quick question: Is \startcolorscheme... \stopcolorscheme (still)
supported by t-vim?

It is supposed to work. If it doesn't, then it is a bug. Could you
provide a complete MWE.

Please find a MWE at the bottom of this post.

The expected behaviour is that the keyword `function` in the JavaScript
snippet and `foobar` in the Ruby snippet should be colored and in
italics, as comments are. The respective Vim highlight groups are
`javaScriptFunction` and `rubyMethodName`, which both resolve to
`Function`.

The reason that there is no highlighting is because the generated `.vimout` 
does not contain any `\SYN[rubyMethodName]` or `\SYN[javaScriptFunction]` for 
the following reason:

Vim has the concept of a hierarchy of names for the syntax highlighting 
regions. For example, $VIMRUNTIME/syntax/ruby.rb contains the following lines:

    hi def link rubyMethodName  rubyFunction
    hi def link rubyFunction  Function

So, `rubyMethodName` maps to `rubyFunction`, which in turn maps to `Function`. 
Now, a vim colorscheme first checks if a highlighting style is available for 
`rubyMethodName`; if not it tries `rubyFunction`; and if not it tries 
`Function`.

Although something similar might have been possible in 2context.vim, I follow 
the `TOHtml` function of vim, and simply created a single tag for each syntax 
highlighting element, which in this case is `Function`. So, there is no tag 
generated for `rubyMethodName` and that is why changing the syntaxhighlight for 
that doesn't change anything.

Now, as I was looking into this, I noticed that `foobar` gets mapped to 
`Identifier` rather than `Function`. I am not sure why that is happening and I 
will look into that.

Aditya

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to