runtime(log): highlight Java Errors
Commit:
https://github.com/vim/vim/commit/6fd9dac9927caf390c97c61ca5143fb7a190dd15
Author: Christian Brabandt <
c...@256bit.org>
Date: Thu Sep 18 19:37:10 2025 +0000
runtime(log): highlight Java Errors
closes:
https://github.com/vim/vim/issues/18315
Signed-off-by: Christian Brabandt <
c...@256bit.org>
diff --git a/runtime/syntax/log.vim b/runtime/syntax/log.vim
index 336fc7dfd..d4a1a4018 100644
--- a/runtime/syntax/log.vim
+++ b/runtime/syntax/log.vim
@@ -2,7 +2,7 @@
" Language: Generic log file
" Maintainer: Mao-Yining <
https://github.com/mao-yining>
" Former Maintainer: MTDL9 <
https://github.com/MTDL9>
-" Latest Revision: 2025-09-13
+" Latest Revision: 2025-09-16
if exists('b:current_syntax')
finish
@@ -31,9 +31,9 @@ syn match logFloatNumber '\<\d.\d\+[eE]\?\>'
syn keyword logBoolean true false
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"
-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
@@ -68,6 +68,10 @@ syn match logMacAddress '\<\x\{2}\(:\x\{2}\)\{5}'
syn match logFilePath '\<\w:\\+'
syn match logFilePath '[^a-zA-Z0-9"']\@<=/\+'
+" Java Errors
+"---------------------------------------------------------------------------
+syn match logJavaError '\%(\%(Error\|Exception\):\s*\)\zs\w.\{-}\ze\(\n\|$\)' contained
+
" Syslog Columns
"---------------------------------------------------------------------------
@@ -128,6 +132,8 @@ hi def link logIPV6 ErrorMsg
hi def link logMacAddress Label
hi def link logFilePath Conditional
+hi def link logJavaError ErrorMsg
+
hi def link logSysColumns Conditional
hi def link logSysProcess Include