From 59a5e320dac55f17aa77b1a2d2d25ecdba6c38c6 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 23 Jun 2026 06:51:45 +0800 Subject: [PATCH] vim-patch:4ed61e0: runtime(dtrace): handle DTrace probe highlighting before action blocks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Recognize DTrace probe descriptions that are followed immediately by an action block, such as: BEGIN{ trace(1); } syscall::open:entry{ trace(1); } The fourth probe field now consumes the remaining non-whitespace text, and the lookahead allows zero or more whitespace before the following token. closes: vim/vim#20560 https://github.com/vim/vim/commit/4ed61e0a199d635c6cdaaff6c0657db3a8d3d445 Co-authored-by: VladimĂ­r Marek --- runtime/syntax/dtrace.vim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/runtime/syntax/dtrace.vim b/runtime/syntax/dtrace.vim index 7ed9766e77..5a9860187b 100644 --- a/runtime/syntax/dtrace.vim +++ b/runtime/syntax/dtrace.vim @@ -4,6 +4,7 @@ " http://docs.sun.com/app/docs/doc/817-6223 " Version: 1.5 " Last Change: 2008/04/05 +" 2026 Jun 22 by Vim project: handle DTrace probe descriptions that are followed immediately by an action block " Maintainer: Nicolas Weber " dtrace lexer and parser are at @@ -35,8 +36,8 @@ syn match dtraceComment "\%^#!.*-s.*" " XXX: This allows a probe description to end with ',', even if it's not " followed by another probe. " XXX: This doesn't work if followed by a comment. -let s:oneProbe = '\%(BEGIN\|END\|ERROR\|\S\{-}:\S\{-}:\S\{-}:\S\{-}\)\_s*' -exec 'syn match dtraceProbe "'.s:oneProbe.'\%(,\_s*'.s:oneProbe.'\)*\ze\_s\%({\|\/[^*]\|\%$\)"' +let s:oneProbe = '\%(BEGIN\|END\|ERROR\|\S\{-}:\S\{-}:\S\{-}:\S*\)\_s*' +exec 'syn match dtraceProbe "'.s:oneProbe.'\%(,\_s*'.s:oneProbe.'\)*\ze\_s*\%({\|\/[^*]\|\_s*\S\|\%$\)"' " Note: We have to be careful to not make this match /* */ comments. " Also be careful not to eat `c = a / b; b = a / 2;`. We use the same