aboutsummaryrefslogtreecommitdiff
path: root/runtime/syntax/tcl.vim
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/syntax/tcl.vim')
-rw-r--r--runtime/syntax/tcl.vim20
1 files changed, 10 insertions, 10 deletions
diff --git a/runtime/syntax/tcl.vim b/runtime/syntax/tcl.vim
index 73b2b3fa11..59cb04f70f 100644
--- a/runtime/syntax/tcl.vim
+++ b/runtime/syntax/tcl.vim
@@ -6,8 +6,8 @@
" (previously Matt Neumann <mattneu@purpleturtle.com>)
" (previously Allan Kelly <allan@fruitloaf.co.uk>)
" Original: Robin Becker <robin@jessikat.demon.co.uk>
-" Last Change: 2021 Oct 03
-" Version: 1.14
+" Last Change: 2021 Nov 16
+" Version: 1.14 plus improvements from PR #8948
" URL: (removed, no longer worked)
" quit when a syntax file was already loaded
@@ -192,18 +192,18 @@ syn region tcltkCommand matchgroup=tcltkCommandColor start="\<lsort\>" matchgrou
syn keyword tclTodo contained TODO
" Sequences which are backslash-escaped: http://www.tcl.tk/man/tcl8.5/TclCmd/Tcl.htm#M16
-" Octal, hexadecimal, unicode codepoints, and the classics.
+" Octal, hexadecimal, Unicode codepoints, and the classics.
" Tcl takes as many valid characters in a row as it can, so \xAZ in a string is newline followed by 'Z'.
-syn match tclSpecial contained '\\\([0-7]\{1,3}\|x\x\{1,2}\|u\x\{1,4}\|[abfnrtv]\)'
+syn match tclSpecial contained '\\\(\o\{1,3}\|x\x\{1,2}\|u\x\{1,4}\|[abfnrtv]\)'
syn match tclSpecial contained '\\[\[\]\{\}\"\$]'
" Command appearing inside another command or inside a string.
syn region tclEmbeddedStatement start='\[' end='\]' contained contains=tclCommand,tclNumber,tclLineContinue,tclString,tclVarRef,tclEmbeddedStatement
" A string needs the skip argument as it may legitimately contain \".
" Match at start of line
-syn region tclString start=+^"+ end=+"+ contains=@tclSpecialC skip=+\\\\\|\\"+
+syn region tclString start=+^"+ end=+"+ contains=@tclSpecialC,@Spell skip=+\\\\\|\\"+
"Match all other legal strings.
-syn region tclString start=+[^\\]"+ms=s+1 end=+"+ contains=@tclSpecialC,@tclVarRefC,tclEmbeddedStatement skip=+\\\\\|\\"+
+syn region tclString start=+[^\\]"+ms=s+1 end=+"+ contains=@tclSpecialC,@tclVarRefC,tclEmbeddedStatement,@Spell skip=+\\\\\|\\"+
" Line continuation is backslash immediately followed by newline.
syn match tclLineContinue '\\$'
@@ -222,12 +222,12 @@ syn match tclNumber "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
"floating point number, without dot, with exponent
syn match tclNumber "\<\d\+e[-+]\=\d\+[fl]\=\>"
"hex number
-syn match tclNumber "0x[0-9a-f]\+\(u\=l\=\|lu\)\>"
-"syn match tclIdentifier "\<[a-z_][a-z0-9_]*\>"
+syn match tclNumber "0x\x\+\(u\=l\=\|lu\)\>"
+"syn match tclIdentifier "\<\h\w*\>"
syn case match
-syn region tclComment start="^\s*\#" skip="\\$" end="$" contains=tclTodo
-syn region tclComment start=/;\s*\#/hs=s+1 skip="\\$" end="$" contains=tclTodo
+syn region tclComment start="^\s*\#" skip="\\$" end="$" contains=tclTodo,@Spell
+syn region tclComment start=/;\s*\#/hs=s+1 skip="\\$" end="$" contains=tclTodo,@Spell
"syn match tclComment /^\s*\#.*$/
"syn match tclComment /;\s*\#.*$/hs=s+1