vim-patch:6fd9dac: runtime(log): highlight Java Errors (#35836)

closes: vim/vim#18315

6fd9dac992

Co-authored-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
zeertzjq
2025-09-19 12:36:56 +08:00
committed by GitHub
parent 6152bcf42e
commit b756a6165a

View File

@@ -2,7 +2,7 @@
" Language: Generic log file " Language: Generic log file
" Maintainer: Mao-Yining <https://github.com/mao-yining> " Maintainer: Mao-Yining <https://github.com/mao-yining>
" Former Maintainer: MTDL9 <https://github.com/MTDL9> " Former Maintainer: MTDL9 <https://github.com/MTDL9>
" Latest Revision: 2025-09-13 " Latest Revision: 2025-09-16
if exists('b:current_syntax') if exists('b:current_syntax')
finish finish
@@ -31,9 +31,9 @@ syn match logFloatNumber '\<\d.\d\+[eE]\?\>'
syn keyword logBoolean true false syn keyword logBoolean true false
syn keyword logNull null nil nullptr none syn keyword logNull null nil nullptr none
syn region logString start=/"/ end=/"/ end=/$/ skip=/\\./ syn region logString start=/"/ end=/"/ end=/$/ skip=/\\./ contains=logJavaError
" Quoted strings, but no match on quotes like "don't", "plurals' elements" " Quoted strings, but no match on quotes like "don't", "plurals' elements"
syn region logString start=/'\(s \|t \| \w\)\@!/ end=/'/ end=/$/ end=/s / skip=/\\./ syn region logString start=/'\(s \|t \| \w\)\@!/ end=/'/ end=/$/ end=/s / skip=/\\./ contains=logJavaError
" Dates and Times " Dates and Times
@@ -68,6 +68,10 @@ syn match logMacAddress '\<\x\{2}\(:\x\{2}\)\{5}'
syn match logFilePath '\<\w:\\\f\+' syn match logFilePath '\<\w:\\\f\+'
syn match logFilePath '[^a-zA-Z0-9"']\@<=/\f\+' syn match logFilePath '[^a-zA-Z0-9"']\@<=/\f\+'
" Java Errors
"---------------------------------------------------------------------------
syn match logJavaError '\%(\%(Error\|Exception\):\s*\)\zs\w.\{-}\ze\(\\n\|$\)' contained
" Syslog Columns " Syslog Columns
"--------------------------------------------------------------------------- "---------------------------------------------------------------------------
@@ -128,6 +132,8 @@ hi def link logIPV6 ErrorMsg
hi def link logMacAddress Label hi def link logMacAddress Label
hi def link logFilePath Conditional hi def link logFilePath Conditional
hi def link logJavaError ErrorMsg
hi def link logSysColumns Conditional hi def link logSysColumns Conditional
hi def link logSysProcess Include hi def link logSysProcess Include