fix(syntax): colour keywords red/green like the HTML export
CI / cargo fmt --check (push) Successful in 39s
CI / cargo clippy (push) Successful in 24s
CI / cargo test (push) Successful in 27s
CI / editor keymaps (push) Successful in 1m16s

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:
2026-05-28 21:49:36 -03:00
parent e0f97a5caf
commit d2475e136b
+9 -2
View File
@@ -89,7 +89,10 @@ syntax match nuwikiCode /`[^`]\+`/ contains=nuwikiCodeDelim
syntax match nuwikiCodeDelim /`/ contained conceal
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|.
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 link nuwikiCode String
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 nuwikiTransclusion Identifier
highlight default link nuwikiUrl Underlined