Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Shellscript Syntax Highlighting never recognizes the end of a <<-EOF delimiter #72

@nathan-thomas

Description

@nathan-thomas

Prerequisites

Description

As I'm sure you know, you can throw a bunch of text into a file by using something like:

cat > $1 << End-of-File
text here
more text
End-of-File

I'm presently doing just this in a script, inside a function and have indented whitespace:

cat > $1 << End-of-File
    text here
    more text
End-of-File

If you do this, you'll end up with the whitespace in your output file. However, you can ignore that whitespace by putting a dash (-) before your End-of-File delimiter. Example: cat > $1 <<-End-of-File

The issue is that when I include this dash, syntax highlighting for this script breaks from then on, because the language-shellscript interprets everything after <<-End-of-File as text that is going into the file, which isn't correct.

Steps to Reproduce

  1. Copy this code into Atom and invoke the Shellscript Language package:
cat > $1 << End-of-File
    text here
    more text
End-of-File
  1. Insert a dash before End-of-File (or simply replace the first line with the following) and see the difference:
    cat > $1 <<-End-of-File

Expected behavior: [What you expect to happen]
At the end of the file, I expect the rest of the script to revert to regular syntax highlighting.

Actual behavior: [What actually happens]
The Language package interprets the rest of the script as being a part of the cat statement.

Reproduces how often: [What percentage of the time does it reproduce?]
100%

Versions

Atom : 1.15.0
Electron: 1.3.13
Chrome : 52.0.2743.82
Node : 6.5.0

apm 1.15.3
npm 3.10.5
node 4.4.5 x64
python
git 2.12.0.windows.1
visual studio

I am running Windows 10.
You can get this information from copy and pasting the output of atom --version and apm --version from the command line. Also, please include the OS and what version of the OS you're running.

Additional Information

I haven't checked whether this is happening in other operating systems.

Any additional information, configuration or data that might be necessary to reproduce the issue.

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