adityam / filter

ConTeXt module to process contents of a start-stop environment through an external program
45 stars 10 forks source link

Alternative colorscheme per vimtyping env #37

Closed lorenzncode closed 4 years ago

lorenzncode commented 4 years ago

Thanks for the module! I found one limitation/bug in that I cannot apply a unique colorscheme per vimtyping environment. Example where both comments are in blue in the pdf.

\usemodule[vim]

\definevimtyping [pythontest]
    [
        syntax=python,
        alternative=pythoncolor,
        directory=.,
    ]

\startcolorscheme [pythoncolor]
    \definesyntaxgroup
        [Comment]
        [color=red]
\stopcolorscheme

\definevimtyping [contexttest]
    [
        syntax=context,
        alternative=contextcolor,
        directory=.,
    ]

\startcolorscheme [contextcolor]
    \definesyntaxgroup
        [Comment]
        [color=blue]
\stopcolorscheme

\starttext

This is Python:
\startpythontest
# a comment
\stoppythontest

This is ConTeXt:
\startcontexttest
% a comment
\stopcontexttest

\stoptext

version info from log: system > ConTeXt ver: 2020.01.30 14:13 MKIV beta fmt: 2020.6.9 int: english/english loading > Vim syntax highlighting (ver: 2020.05.17)

adityam commented 4 years ago

I can confirm this and it is a bug. Let me check how to fix it.

adityam commented 4 years ago

I pushed a patch (3ea3bef926937cdca45847dbadfbdf859562b650) that fixed this issue. Thanks for the precise bug-report.

I will release a new version soon with the bugfix.