Docker syntax highlighting - Comments break up `RUN` highlighting in multi-line mode · Issue #8364 · vim/vim · GitHub
Skip to content

Docker syntax highlighting - Comments break up RUN highlighting in multi-line mode #8364

@ElvenSpellmaker

Description

@ElvenSpellmaker

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 matters 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions