如何在狮身人面像的重组文本中突出显示差异输出文本?

问题描述 投票:0回答:1

我试图找到但失败了。

我认为以'+'开头的行的颜色为红色

...以及以'-'开头的行的颜色为蓝色

...就足够了。

hello.c::

    +#else                                 <<<<< want this line in red
     ISR_RESULT ISRs(U32 Interrupt, U32 Vector)
    +#endif                                <<<<< want this line in red
     {
    -//     printf ("Get IRQs \r\n");      <<<<< want this line in blue
    -       switch (Interrupt)             <<<<< want this line in blue
    -       {                              <<<<< want this line in blue
    -         case ISR_MBOX0:              <<<<< want this line in blue
diff highlight restructuredtext
1个回答
0
投票

您可能应该使用code-block directive并使用code-block。您的Pygment's diff lexer文件应该看起来像这样:

diff
© www.soinside.com 2019 - 2024. All rights reserved.