From 443a9c897bb268ecb647d1e8639ad0a675fd9978 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sun, 30 May 2021 13:36:30 +0300 Subject: [PATCH] Ticket #4252: change pattern for OpenRC scripts syntax highlighting. Use an empty patter (^$) that doesn't match any file name. In this case, only the shebang is used to detect syntax highlighting rules for OpenRC scripts. Signed-off-by: Andrew Borodin --- misc/syntax/Syntax.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/misc/syntax/Syntax.in b/misc/syntax/Syntax.in index f2be70720..53d8c6a46 100644 --- a/misc/syntax/Syntax.in +++ b/misc/syntax/Syntax.in @@ -40,7 +40,10 @@ include lsm.syntax file .\*(bash(_completion|rc)|profile|\\.(sh|bash(rc|_(completion|profile|log(in|out)|aliases|exports|history))|profile|zlog(in|out)|zprofile|zsh(env|rc)))$ Shell\sScript ^#!\s\*/(.\*/|usr/bin/env\s)([a-z]?|ba|pdk)sh include sh.syntax -file .\* OpenRC\sRunscript\sFile ^#!\s\*/sbin/openrc-run +# Since openrc scripts have no extension "by definition", use an empty pattern +# that doesn't match any file name, and therefore only the shebang is used to detect +# syntax highlighting rules (see tickets #4246 and #4252 for details). +file ^$ OpenRC\sRunscript\sFile ^#!\s\*/sbin/openrc-run include sh.syntax file ..\*\\.((?i:ini)|desktop|busname|(auto)?mount|net(dev|work)|link|path|service|slice|socket|swap|target|timer)$ INI-based\sFile