[vim/vim] Docker syntax highlighting - Comments break up `RUN` highlighting in multi-line mode (#8364)

105 views
Skip to first unread message

Jack Blower

unread,
Jun 11, 2021, 7:13:23 AM6/11/21
to vim/vim, Subscribed

Describe the bug
Dockerfile syntax highlighting is incorrect for continuations including comments.

To Reproduce
vim Dockerfile

Example Dockerfile:

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

Expected behavior
The comments shouldn't count towards the highlight behaviour of continuation lines in RUN as Docker ignores comments for the purposes of continuing lines.

The above script works when using docker build . and so the highlighting should also show this.

Screenshots
image

Environment (please complete the following information):
I'm not sure the environment matter with this but here it is:

  • Vim version [e.g. 8.1.1234] (Or paste the result of vim --version.)
  • OS: Windows 10
  • Terminal: mintty


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Luka Markušić

unread,
Jun 11, 2021, 7:16:25 AM6/11/21
to vim/vim, Subscribed

@ElvenSpellmaker just out of curiosity - what happens if you escape the line break, i.e. add a \ at the end of the comment line? That might be a temporary workaround.

Jack Blower

unread,
Jun 11, 2021, 7:17:56 AM6/11/21
to vim/vim, Subscribed

@ElvenSpellmaker just out of curiosity - what happens if you escape the line break, i.e. add a \ at the end of the comment line? That might be a temporary workaround.

@mark2185 That does work as a temporary workaround it seems. 🙂
image

Christian Brabandt

unread,
Jun 11, 2021, 7:52:47 AM6/11/21
to vim/vim, Subscribed

Runtime files are maintainer by their maintainers (see the top at the file). In this case, I believe it is @honza

Reply all
Reply to author
Forward
0 new messages