Ticket #3487: 0002-mcedit-fixed-syntax-highlighting-bug-in-.c-and-.cxx-.patch

File 0002-mcedit-fixed-syntax-highlighting-bug-in-.c-and-.cxx-.patch, 1.7 KB (added by andrew_b, 5 years ago)

https://midnight-commander.org/attachment/ticket/3969/0002-mcedit-fixed-syntax-highlighting-bug-in-.c-and-.cxx-.patch

  • misc/syntax/c.syntax

    From 60cf3dfd2a9b083f2748859b11227cae7d7255c5 Mon Sep 17 00:00:00 2001
    From: Sergii Pylypenko <x.pelya.x@gmail.com>
    Date: Thu, 7 Feb 2019 20:34:46 +0200
    Subject: [PATCH 2/2] mcedit: fixed syntax highlighting bug in .c and .cxx
     syntax scripts
    
    To reproduce, open this .c file in mcedit (remove backslashes):
    
    /* this preprocessor macro is not colorized,
       when there is whitespace before '#' and the next line is not empty */
    \  #if not_colorized
    int code;
    
    /* this preprocessor macro is colorized properly, the next line is empty */
    \  #if colorized
    
    int code2;
    ---
     misc/syntax/c.syntax   | 2 +-
     misc/syntax/cxx.syntax | 2 +-
     2 files changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/misc/syntax/c.syntax b/misc/syntax/c.syntax
    index 91f070c88..e6fabe997 100644
    a b context default 
    3636    keyword whole inline yellow 
    3737    keyword whole wchar_t yellow 
    3838    keyword whole ... yellow 
    39     keyword whole linestart \{\s\t\}\[\s\t\]#*\n brightmagenta 
     39    keyword linestart \{\s\t\}\[\s\t\]#*\n brightmagenta 
    4040    keyword whole \[\s\t\]default yellow 
    4141    keyword whole linestart \[\s\t\]\{ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz\}\[0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz\]: cyan 
    4242 
  • misc/syntax/cxx.syntax

    diff --git a/misc/syntax/cxx.syntax b/misc/syntax/cxx.syntax
    index 3ac9f1fca..08cd444be 100644
    a b context default 
    6262    keyword whole using yellow 
    6363    keyword whole wchar_t yellow 
    6464    keyword whole ... yellow 
    65     keyword whole linestart \{\s\t\}\[\s\t\]#*\n brightmagenta 
     65    keyword linestart \{\s\t\}\[\s\t\]#*\n brightmagenta 
    6666 
    6767    keyword /\* brown 
    6868    keyword \*/ brown