Allow lower case in option keys and dynamic block markers

For example previously only `#+TITLE: Foo` would have syntax highlighted
`Foo` correctly. Now all case variants will work (e.g. `#+title: Foo`
and `#+tItLE: Foo`).

The same has been done to dynamic block markers so now this will also
work:

    #+begin_src lisp
    (if (< 1 2)
      (print "True!")
      (print "False!))
    #+end_src
This commit is contained in:
Alex Vear
2020-02-15 20:01:31 +00:00
parent 6a29a2e961
commit a65f2b1d98

View File

@@ -37,7 +37,7 @@ highlight def link orgUnderlineDelimiter orgUnderline
" Options " Options
syntax match orgOption /^\s*#+\w\+.*$/ keepend syntax match orgOption /^\s*#+\w\+.*$/ keepend
syntax region orgTitle matchgroup=orgOption start="^\s*#+TITLE:\s*" end="$" keepend oneline syntax region orgTitle matchgroup=orgOption start="\c^\s*#+TITLE:\s*" end="$" keepend oneline
highlight def link orgBlockDelimiter SpecialComment highlight def link orgBlockDelimiter SpecialComment
highlight def link orgOption SpecialComment highlight def link orgOption SpecialComment
@@ -48,9 +48,9 @@ highlight def link orgTitle Title
syntax region orgCode matchgroup=orgCodeDelimiter start="[^ \t\k]\@<!\~\k\@=\~\@!" end="\k\@<=\~\@<!\~" keepend syntax region orgCode matchgroup=orgCodeDelimiter start="[^ \t\k]\@<!\~\k\@=\~\@!" end="\k\@<=\~\@<!\~" keepend
syntax region orgVerbatim matchgroup=orgVerbatimDelimiter start="[^ \t\k]\@<!=\k\@==\@!" end="\k\@<==\@<!=" keepend syntax region orgVerbatim matchgroup=orgVerbatimDelimiter start="[^ \t\k]\@<!=\k\@==\@!" end="\k\@<==\@<!=" keepend
syntax match orgVerbatim /^\s*: .*$/ keepend syntax match orgVerbatim /^\s*: .*$/ keepend
syntax region orgVerbatim matchgroup=orgBlockDelimiter start="^\s*#+BEGIN_.*" end="^\s*#+END_.*" keepend syntax region orgVerbatim matchgroup=orgBlockDelimiter start="\c^\s*#+BEGIN_.*" end="\c^\s*#+END_.*" keepend
syntax region orgCode matchgroup=orgBlockDelimiter start="^\s*#+BEGIN_SRC" end="^\s*#+END_SRC" keepend syntax region orgCode matchgroup=orgBlockDelimiter start="\c^\s*#+BEGIN_SRC" end="\c^\s*#+END_SRC" keepend
syntax region orgCode matchgroup=orgBlockDelimiter start="^\s*#+BEGIN_EXAMPLE" end="^\s*#+END_EXAMPLE" keepend syntax region orgCode matchgroup=orgBlockDelimiter start="\c^\s*#+BEGIN_EXAMPLE" end="\c^\s*#+END_EXAMPLE" keepend
highlight def link orgVerbatim Identifier highlight def link orgVerbatim Identifier
highlight def link orgVerbatimDelimiter orgVerbatim highlight def link orgVerbatimDelimiter orgVerbatim
@@ -60,7 +60,7 @@ highlight def link orgCodeDelimiter orgCode
" Comments " Comments
syntax match orgComment /^\s*#\s\+.*$/ keepend syntax match orgComment /^\s*#\s\+.*$/ keepend
syntax region orgComment matchgroup=orgBlockDelimiter start="^\s*#+BEGIN_COMMENT" end="^\s*#+END_COMMENT" keepend syntax region orgComment matchgroup=orgBlockDelimiter start="\c^\s*#+BEGIN_COMMENT" end="\c^\s*#+END_COMMENT" keepend
highlight def link orgComment Comment highlight def link orgComment Comment