From 818b7aed7f93d3afba81b06109a316d680d6eeed Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 14 Sep 2017 04:23:04 -0700 Subject: [PATCH] Fix for longstrings. --- syntax/nomsu.vim | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/syntax/nomsu.vim b/syntax/nomsu.vim index 071aa10..068342a 100644 --- a/syntax/nomsu.vim +++ b/syntax/nomsu.vim @@ -21,16 +21,20 @@ 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=/"\(\(\.\."\)\@!\|\.\."\s*|.*$\)/ skip=/\\\\\|\\"/ end=/"/ hi def link nomsuString1 String +syn region nomsuStringLine start=/"\.\."/ end=/$/ +\ contains=nomsuInterp,nomsuStringLineStart,nomsuStringTrailingSpace,nomsuOneLineComment,nomsuComment +hi def link nomsuStringLine String + syn match nomsuStringLineStart /\(^[ \t]*\|"\.\."\s*\)\@<=|/ contained hi def link nomsuStringLineStart Delimiter syn match nomsuStringTrailingSpace /[ \t]*$/ contained hi nomsuStringTrailingSpace ctermbg=Magenta -syn region nomsuLongString start=/\(^\z(\s*\)\S.*\)\@<="\.\."/ skip=/^\(\z1\s\|\s*$\)/ end=/\n\(\z1\s\)\@!/me=s-1 +syn region nomsuLongString start=/"\.\."[^\n]*$\n\(\s*\n\)*\z(\s\+\)\S/ skip=/^\%(\z1\S\|^\s*$\)/ end=/^\z1\@!.*/me=s-1 \ contains=nomsuInterp,nomsuStringLineStart,nomsuStringTrailingSpace,nomsuOneLineComment,nomsuComment hi def link nomsuLongString String