Some fixes to longstrings.

This commit is contained in:
Bruce Hill 2017-09-14 03:22:28 -07:00
parent 041ebceae5
commit 875b009e41

View File

@ -21,7 +21,7 @@ hi def link nomsuOneLineComment Comment
syn region nomsuComment start=/#\.\.[^\n]*$\n\(\s*\n\)*\z(\s\+\)\S/ skip=/^\%(\z1\S\|^\s*$\)/ end=/^\z1\@!.*/me=s-1
hi def link nomsuComment Comment
syn region nomsuString1 start=/"/ skip=/\\\\\|\\"/ end=/"/
syn region nomsuString1 start=/"\(\.\."\)\@!/ skip=/\\\\\|\\"/ end=/"/
hi def link nomsuString1 String
syn match nomsuStringLineStart /\(^[ \t]*\|"\.\."\s*\)\@<=|/ contained
@ -30,11 +30,8 @@ syn match nomsuStringTrailingSpace /[ \t]*$/ contained
hi nomsuStringTrailingSpace ctermbg=Magenta
syn region nomsuLongString2 start=/"\.\."\s*|/ end=/$/
\ contains=nomsuInterp,nomsuStringLineStart,nomsuStringTrailingSpace
hi def link nomsuLongString2 String
syn region nomsuLongString start=/"\.\.".*$\n\(\s*\n\)*\z(\s\+\)\S/ skip=/^\%(\z1\S\|^\s*$\)/ end=/^\z1\@!.*/me=s-1
\ contains=nomsuInterp,nomsuStringLineStart,nomsuStringTrailingSpace
syn region nomsuLongString start=/\(^\z(\s*\)\S.*\)\@<="\.\."/ skip=/^\(\z1\s\|\s*$\)/ end=/\n\(\z1\s\)\@!/me=s-1
\ contains=nomsuInterp,nomsuStringLineStart,nomsuStringTrailingSpace,nomsuOneLineComment,nomsuComment
hi def link nomsuLongString String
syn match nomsuVar /\v\%[a-zA-Z0-9_'+*/^&$@#-]*/
@ -62,7 +59,7 @@ hi def link nomsuThunk Structure
syn match nomsuToken /\v(\%)@<!\%[a-zA-Z_'+*/^&$@#-][a-zA-Z0-9_'+*/^&$@#-]*/
hi def link nomsuToken Function
syn cluster nomsuAll contains=nomsuString1,nomsuLongString,nomsuLongString2,nomsuComment,
syn cluster nomsuAll contains=nomsuString1,nomsuLongString,nomsuComment,
\ nomsuVar,nomsuNumber,nomsuComma,nomsuThunk,nomsuIndentor,nomsuToken
if !exists('b:current_syntax')