Commit: runtime(dockerfile): Update syntax, fix RUN command highlighting

3 views
Skip to first unread message

Christian Brabandt

unread,
Apr 26, 2026, 10:30:16 AMApr 26
to vim...@googlegroups.com
runtime(dockerfile): Update syntax, fix RUN command highlighting

Commit: https://github.com/vim/vim/commit/1ce03d674a5a91f62769a6dcc2f9b8f249b90761
Author: Doug Kearns <dougk...@gmail.com>
Date: Sun Apr 26 14:26:19 2026 +0000

runtime(dockerfile): Update syntax, fix RUN command highlighting

Allow for docker comments to be interspersed in a multiline (continued)
RUN command argument.

fixes: #8364
closes: #19829

Signed-off-by: Doug Kearns <dougk...@gmail.com>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/runtime/syntax/dockerfile.vim b/runtime/syntax/dockerfile.vim
index f1d612f4a..17b32d294 100644
--- a/runtime/syntax/dockerfile.vim
+++ b/runtime/syntax/dockerfile.vim
@@ -1,6 +1,7 @@
" dockerfile.vim - Syntax highlighting for Dockerfiles
" Maintainer: Honza Pokorny <https://honza.ca>
" Last Change: 2024 Dec 20
+" 2026 Mar 26 by Vim Project: dockerfileShell comments (#19829)
" License: BSD

" https://docs.docker.com/engine/reference/builder/
@@ -31,7 +32,7 @@ syntax match dockerfileInstruction contained / <(SHELL|VOLUME)>/

syntax region dockerfileString contained start=/ "/ skip=/ \./ end=/ "/
syntax region dockerfileJSON contained keepend start=/ \[/ skip=/ \\_./ end=/ $/ contains=@JSON
-syntax region dockerfileShell contained keepend start=/ / skip=/ \\_./ end=/ $/ contains=@Shell
+syntax region dockerfileShell contained keepend start=/ / skip=/ \\_.|^\s*#.*/ end=/ $/ contains=@Shell
syntax region dockerfileValue contained keepend start=/ / skip=/ \\_./ end=/ $/ contains=dockerfileString

syntax region dockerfileComment start=/ ^\s*#/ end=/ $/ contains=@Spell
diff --git a/runtime/syntax/testdir/dumps/dockerfile_00.dump b/runtime/syntax/testdir/dumps/dockerfile_00.dump
new file mode 100644
index 000000000..6f55b91d7
--- /dev/null
+++ b/runtime/syntax/testdir/dumps/dockerfile_00.dump
@@ -0,0 +1,20 @@
+>#+0#0000e05#ffffff0| |I|s@1|u|e| |#|8|3|6|4| |(|D|o|c|k|e|r| |s|y|n|t|a|x| |h|i|g|h|l|i|g|h|t|i|n|g| |-| |C|o|m@1|e|n|t|s| |b|r|e|a|k| |u|p| |R|U|N| |h|i|g|h|l|i|g|h|t
+|i|n|g| +0#0000000&@71
+|#+0#0000e05&| |i|n| |m|u|l|t|i|-|l|i|n|e| |m|o|d|e|)| +0#0000000&@53
+@75
+|F+0#af5f00255&|R|O|M| +0#0000000&|d|e|b|i|a|n|:|1|0|.|3| @58
+@75
+|R+0#af5f00255&|U|N| +0#0000000&|a|p|t|-|g|e|t| |u|p|d|a|t|e| |-+0#e000e06&|y| +0#0000000&|\+0#af5f00255&| +0#0000000&@51
+@4|&+0#af5f00255&@1| +0#0000000&|a|p|t|-|g|e|t| |u|p|g|r|a|d|e| |-+0#e000e06&|y| +0#0000000&|\+0#af5f00255&| +0#0000000&@47
+@4|&+0#af5f00255&@1| +0#0000000&|a|p|t|-|g|e|t| |i|n|s|t|a|l@1| |-+0#e000e06&|y| +0#0000000&|c|u|r|l| |g+0#af5f00255&|r|e|p| +0#0000000&|s+0#af5f00255&|e|d| +0#0000000&|u|n|z|i|p| |g|i|t| |s|u|d|o| |j|q| |g|e|t@1|e|x|t| |\+0#af5f00255&| +0#0000000&@7
+@4|#+0#0000e05&| |A|z|u|r|e| |C|L|I| +0#0000000&@59
+@4|&+0#af5f00255&@1| +0#0000000&|c+0#af5f00255&|d| +0#0000000&|/|t|m|p| |\+0#af5f00255&| +0#0000000&@58
+@4|&+0#af5f00255&@1| +0#0000000&|c|u|r|l| |-+0#e000e06&|s|L| +0#0000000&|h|t@1|p|s|:|/@1|a|k|a|.|m|s|/|I|n|s|t|a|l@1|A|z|u|r|e|C|L|I|D|e|b| ||+0#af5f00255&| +0#0000000&|b|a|s|h| |\+0#af5f00255&| +0#0000000&@16
+@4|#+0#0000e05&| |C|l|e|a|n|-|u|p| |A|p|t| |C|a|c|h|e|s| +0#0000000&@49
+@4|&+0#af5f00255&@1| +0#0000000&|a|p|t|-|g|e|t| |c|l|e|a|n| |\+0#af5f00255&| +0#0000000&@52
+@4|&+0#af5f00255&@1| +0#0000000&|r+0#af5f00255&|m| +0#0000000&|-+0#e000e06&|r|f| +0#0000000&|/|v|a|r|/|l|i|b|/|a|p|t|/|l|i|s|t|s| @42
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+| +0#0000000&@56|1|,|1| @10|A|l@1|
diff --git a/runtime/syntax/testdir/input/dockerfile.dockerfile b/runtime/syntax/testdir/input/dockerfile.dockerfile
new file mode 100644
index 000000000..0126470e4
--- /dev/null
+++ b/runtime/syntax/testdir/input/dockerfile.dockerfile
@@ -0,0 +1,14 @@
+# Issue #8364 (Docker syntax highlighting - Comments break up RUN highlighting
+# in multi-line mode)
+
+FROM debian:10.3
+
+RUN apt-get update -y \
+ && apt-get upgrade -y \
+ && apt-get install -y curl grep sed unzip git sudo jq gettext \
+ # Azure CLI
+ && cd /tmp \
+ && curl -sL https://aka.ms/InstallAzureCLIDeb | bash \
+ # Clean-up Apt Caches
+ && apt-get clean \
+ && rm -rf /var/lib/apt/lists
Reply all
Reply to author
Forward
0 new messages