Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unwanted white space inserted in code #88

Closed
nylander opened this issue Feb 22, 2021 · 1 comment
Closed

Unwanted white space inserted in code #88

nylander opened this issue Feb 22, 2021 · 1 comment

Comments

@nylander
Copy link


By filing an issue to this repo, I promise that

  • [X ] I have fully read the issue guide at https://yihui.org/issue/.
  • [X ] I have provided the necessary information about my issue.
    • If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.
    • If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included xfun::session_info('formatR').
    • If I have posted the same issue elsewhere, I have also mentioned it in this issue.
  • [ x] I have learned the Github Markdown syntax, and formatted my issue correctly.

I understand that my issue may be closed if I don't fulfill my promises.

Description

Unwanted white-space characters are inserted while running tidy_file().

Example:

Input:

idMatches <- function(tree1, tree2, least.inclusive=TRUE)
{
  #set the results table up
  results <- tableSetup(tree1, tree2)

  #define tree1 nodes here
  nodes1 <- getNode()
}

Output

Note: Line no. 4 has four white-space characters inserted (should be none).

idMatches <- function(tree1, tree2, least.inclusive = TRUE) {
    # set the results table up
    results <- tableSetup(tree1, tree2)
    
    # define tree1 nodes here
    nodes1 <- getNode()
}

Session info:

R version 4.0.4 (2021-02-15)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.2 LTS

Locale:
  LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
  LC_TIME=sv_SE.UTF-8        LC_COLLATE=en_US.UTF-8    
  LC_MONETARY=sv_SE.UTF-8    LC_MESSAGES=en_US.UTF-8   
  LC_PAPER=sv_SE.UTF-8       LC_NAME=C                 
  LC_ADDRESS=C               LC_TELEPHONE=C            
  LC_MEASUREMENT=sv_SE.UTF-8 LC_IDENTIFICATION=C       

Package version:
  formatR_1.7

@yihui yihui closed this as completed in 3c9fa69 Feb 26, 2021
@yihui
Copy link
Owner

yihui commented Feb 26, 2021

Should be fixed now. Thanks for the report!

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

No branches or pull requests

2 participants