fix(syntax): colour keywords red/green like the HTML export
All keywords shared one `nuwikiKeyword` group linked to `Todo`, so the editor showed TODO, DONE and XXX in the same colour. Split into nuwikiKeywordAttn (TODO/FIXME/XXX, red) and nuwikiKeywordDone (DONE/FIXED/STARTED, green) with explicit colours so the distinction survives any colorscheme — matching the export's per-keyword classes. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
+9
-2
@@ -89,7 +89,10 @@ syntax match nuwikiCode /`[^`]\+`/ contains=nuwikiCodeDelim
|
|||||||
syntax match nuwikiCodeDelim /`/ contained conceal
|
syntax match nuwikiCodeDelim /`/ contained conceal
|
||||||
|
|
||||||
syntax match nuwikiMathInline /\$[^$]\+\$/
|
syntax match nuwikiMathInline /\$[^$]\+\$/
|
||||||
syntax match nuwikiKeyword /\<\(TODO\|DONE\|STARTED\|FIXME\|FIXED\|XXX\)\>/
|
" Two keyword groups so the editor can colour them like the HTML export:
|
||||||
|
" attention/pending (red) vs resolved/in-progress (green).
|
||||||
|
syntax match nuwikiKeywordAttn /\<\(TODO\|FIXME\|XXX\)\>/
|
||||||
|
syntax match nuwikiKeywordDone /\<\(DONE\|FIXED\|STARTED\)\>/
|
||||||
|
|
||||||
" Wikilink conceal: hide [[ / ]], and for [[target|desc]] hide target|.
|
" Wikilink conceal: hide [[ / ]], and for [[target|desc]] hide target|.
|
||||||
syntax region nuwikiWikilink start=/\[\[/ end=/\]\]/ keepend contains=nuwikiWikilinkBracket,nuwikiWikilinkTarget
|
syntax region nuwikiWikilink start=/\[\[/ end=/\]\]/ keepend contains=nuwikiWikilinkBracket,nuwikiWikilinkTarget
|
||||||
@@ -122,7 +125,11 @@ highlight default nuwikiBold gui=bold cterm=bold term=bold
|
|||||||
highlight default nuwikiItalic gui=italic cterm=italic term=italic
|
highlight default nuwikiItalic gui=italic cterm=italic term=italic
|
||||||
highlight default link nuwikiCode String
|
highlight default link nuwikiCode String
|
||||||
highlight default link nuwikiMathInline Number
|
highlight default link nuwikiMathInline Number
|
||||||
highlight default link nuwikiKeyword Todo
|
" Explicit colours (not a `Todo` link) so the red/green split is visible in any
|
||||||
|
" colorscheme. Matches the HTML export: TODO/FIXME/XXX red, DONE/FIXED/STARTED
|
||||||
|
" green.
|
||||||
|
highlight default nuwikiKeywordAttn gui=bold cterm=bold term=bold guifg=#F44747 ctermfg=203
|
||||||
|
highlight default nuwikiKeywordDone gui=bold cterm=bold term=bold guifg=#2EA043 ctermfg=35
|
||||||
highlight default link nuwikiWikilink Underlined
|
highlight default link nuwikiWikilink Underlined
|
||||||
highlight default link nuwikiTransclusion Identifier
|
highlight default link nuwikiTransclusion Identifier
|
||||||
highlight default link nuwikiUrl Underlined
|
highlight default link nuwikiUrl Underlined
|
||||||
|
|||||||
Reference in New Issue
Block a user