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

Why does rufo replace the \n string escape with actual newline? Can we not? #308

Closed
Nitrodist opened this issue May 24, 2023 · 3 comments
Closed

Comments

@Nitrodist
Copy link

Nitrodist commented May 24, 2023

I have code that is like this:

def abc
  print "Hello\nWorld"
end

After formatting with Rufo, it changes the code to this:

  print "Hello
World"

Often I have additional code in a string I'm interpolating - for example "#{a}\n#{b}\n#{c}\n". I can understand this usecase, sure. But, simple calls like.join("\n") result in a needless newline.

It's much more readable if I was able to write .join("\n") IMO!

@Nitrodist
Copy link
Author

Actually, this appears to be a rufo-vim issue 😢 ruby-formatter/rufo-vim#28

@kzkn
Copy link
Member

kzkn commented May 31, 2023

Does it reproduce using rufo standalone, or only with rufo-vim?
When run standalone, it worked correctly on my environment.

$ rufo --version
rufo 0.16.1
$ rufo <<EOF
def abc
  print "Hello\nWorld"
end
EOF
def abc
  print "Hello\nWorld"
end

@kzkn
Copy link
Member

kzkn commented Jul 29, 2023

This is not a rufo's issue but rufo-vim's one ( And it has already opened as ruby-formatter/rufo-vim#28 ). So close this issue.

@kzkn kzkn closed this as completed Jul 29, 2023
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