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.

String redirection highlighting problem #92

Open

Description

@hobti01

Prerequisites

I did not perform these steps because I do not see that they are applicable ;) I did look for similar issues and found nothing.

Description

Highlighting is incorrect when using string redirection <<< and subshell

Steps to Reproduce

Create this file in Atom with Shell Script highlighting:

#!/usr/bin/env bash

  echo "Case 1:"
  read one two <<< "hello world"
  echo "Correctly highlighted when string is used"

  echo "Case 2:"
  read one two <<< $(echo "hello world")
  echo "Everything after <<< incorrectly highlighted when $ is used"
  echo "until a match is found at the beginning of a line"
$(echo
  echo "highlighting reset"

  echo "Case 3:"
  read one two <<< $foo
  echo "Everything after <<< incorrectly highlighted when $ is used"
  echo "until a match is found at the beginning of a line"
$foo
  echo "highlighting reset"

  echo "Case 4:"
  read one two <<< $foo
  echo "Everything after <<< incorrectly highlighted when $ is used"
  echo "until a match is found at the beginning of a line"
  $foo
  echo "highlighting NOT reset"

Expected behavior: [What you expect to happen]

Correct highlighting after <<< $()

Actual behavior: [What actually happens]

Highlighting incorrect

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

100%

Versions

MacOS 10.13.1

$ atom --version
Atom    : 1.22.0
Electron: 1.6.15
Chrome  : 56.0.2924.87
Node    : 7.4.0
$ apm --version
apm  1.18.8
npm  3.10.10
node 6.9.5 x64
python 2.7.10
git 2.14.1

edit: clarified that it is not only for subshell and reset must be at beginning of line

Activity

  1. changed the title [-]String redirection from subshell highlighting problem[/-] [+]String redirection highlighting problem[/+] on Nov 23, 2017
  2. hobti01 commented on Nov 23, 2017

    @hobti01
    Author

    Simple workaround (solution?), enclose the right-hand-side in double-quotes, i.e. make it a string: read one two <<< "$foo"

  3. adamkdean commented on Dec 15, 2017

    @adamkdean

    I came here to report this too.

    A <<< A
    # this is now broken
    

    @hobti01 that won't work, that actually changes the functionality. These lines behave differently.

    read one two <<< "$foo"
    read one two <<< $foo
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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