Skip to content

Fix previewDataframe for 2+ letter variables#390

Merged
andycraig merged 1 commit intoREditorSupport:masterfrom
andycraig:issue-389-fix-dataframe
Aug 11, 2020
Merged

Fix previewDataframe for 2+ letter variables#390
andycraig merged 1 commit intoREditorSupport:masterfrom
andycraig:issue-389-fix-dataframe

Conversation

@andycraig
Copy link
Copy Markdown
Collaborator

Fixes #389

What problem did you solve?

Command R: Preview Dataframe does not work if data frame name is 2+ letters. E.g., R: Preview Dataframe works if data frame name is a, but not if data frame name is cars.

The reason is that getWordOrSelection() changed from returning an array of strings to returning a single string, but its use in this function was not updated.

How can I check this pull request?

Create a file called temp.R containing just the text cars. Place cursor on cars and use R: Preview Dataframe. Observe that preview appears as expected.

Change the text to cars cars. Select BOTH WORDS and use R: Preview Dataframe. Observer the message 'This does not appear to be a dataframe', as expected (because the selection contains a space).

@renkun-ken
Copy link
Copy Markdown
Member

LGTM. Feel free to merge.

@andycraig
Copy link
Copy Markdown
Collaborator Author

Thank you for the review!

@andycraig andycraig merged commit 2c7e754 into REditorSupport:master Aug 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

This does not appear to be a dataframe

2 participants