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

String redirection highlighting problem #92

Open
1 task
hobti01 opened this issue Nov 23, 2017 · 2 comments
Open
1 task

String redirection highlighting problem #92

hobti01 opened this issue Nov 23, 2017 · 2 comments
Labels

Comments

@hobti01
Copy link

hobti01 commented Nov 23, 2017

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

@hobti01 hobti01 changed the title String redirection from subshell highlighting problem String redirection highlighting problem Nov 23, 2017
@hobti01
Copy link
Author

hobti01 commented Nov 23, 2017

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

@50Wliu 50Wliu added the bug label Nov 23, 2017
@adamkdean
Copy link

adamkdean commented Dec 15, 2017

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants