From 3230826aa570f1b4eec40ebc31dd2901af638bba Mon Sep 17 00:00:00 2001 From: rhysd Date: Wed, 20 Mar 2024 14:06:10 +0900 Subject: [PATCH] Support C string literals highlight --- syntax/rust.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syntax/rust.vim b/syntax/rust.vim index 8407b56e..bccdc1f0 100644 --- a/syntax/rust.vim +++ b/syntax/rust.vim @@ -145,9 +145,9 @@ syn match rustEscapeError display contained /\\./ syn match rustEscape display contained /\\\([nrt0\\'"]\|x\x\{2}\)/ syn match rustEscapeUnicode display contained /\\u{\%(\x_*\)\{1,6}}/ syn match rustStringContinuation display contained /\\\n\s*/ -syn region rustString matchgroup=rustStringDelimiter start=+b"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEscape,rustEscapeError,rustStringContinuation +syn region rustString matchgroup=rustStringDelimiter start=+[bc]"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEscape,rustEscapeError,rustStringContinuation syn region rustString matchgroup=rustStringDelimiter start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustStringContinuation,@Spell -syn region rustString matchgroup=rustStringDelimiter start='b\?r\z(#*\)"' end='"\z1' contains=@Spell +syn region rustString matchgroup=rustStringDelimiter start='[bc]\?r\z(#*\)"' end='"\z1' contains=@Spell " Match attributes with either arbitrary syntax or special highlighting for " derives. We still highlight strings and comments inside of the attribute.