Skip to content

Run Selection/Line fails when some lines end in commas #437

@andycraig

Description

@andycraig

Describe the bug

Lines ending in commas seem to cause R: Run Selection/Line to send the wrong lines to the console.

To Reproduce

  1. Create a file temp.R with the following content:
list(
    1,
    2
)
  1. Place cursor on second or third line
  2. Use command R: Run Selection/Line

Expected: All four lines are sent to console (if cursor was on second line), or only '2' is sent to console (if cursor was on third line)

Actual: Middle two lines are sent to console:

> 1,
Error: unexpected ',' in "1,"
>     2
[1] 2

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