Ticket #3981: 0001-sh.syntax-Allow-for-indented-function-highlighting.patch

File 0001-sh.syntax-Allow-for-indented-function-highlighting.patch, 1.2 KB (added by TerraNova, 5 years ago)
  • misc/syntax/sh.syntax

    From f0122eaf4e552ff18c9187cf23d4782a5c96e7b3 Mon Sep 17 00:00:00 2001
    From: TerraTech <1118433+TerraTech@users.noreply.github.com>
    Date: Wed, 24 Apr 2019 21:58:31 -0400
    Subject: [PATCH] sh.syntax: Allow for indented 'function' highlighting
    
      This will allow for the following:
    
      if want_foo; then
          function foobar() {
              echo "foo"
          }
      else
          function foobar() {
              echo "bar"
          }
      fi
      foobar
    
    Signed-off-by: TerraTech <1118433+TerraTech@users.noreply.github.com>
    ---
     misc/syntax/sh.syntax | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/misc/syntax/sh.syntax b/misc/syntax/sh.syntax
    index 032433ee8..051d996a9 100644
    a b context default 
    4040 
    4141    keyword $ brightgreen 
    4242 
    43     keyword wholeleft linestart function*() brightmagenta 
    44     keyword wholeleft linestart function\[\s\]+ brightmagenta 
     43    keyword wholeleft linestart \[\s\]*function*() brightmagenta 
     44    keyword wholeleft linestart \[\s\]*function\[\s\]+ brightmagenta 
    4545    keyword wholeright +() brightmagenta 
    4646 
    4747wholechars abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._