clojureVSCode icon indicating copy to clipboard operation
clojureVSCode copied to clipboard

reformat document on windows puts in blank lines

Open timrobinson33 opened this issue 4 years ago • 3 comments

using reformat document on windows puts in a blank line after every line. Also every time you run the reformat, it doubles the number of blank lines at the end.

e.g. if you start off with 2 lines 1 and 2, after reformatting once you will get [1, blank line, 2, blank line], then after reformatting again you will get [1, blank, 2, blank, blank], and after another reformat you will get [1, blank, 2, blank, blank, blank, blank]

timrobinson33 avatar Nov 23 '20 18:11 timrobinson33

Seems it only happens with files with windows line endings (CRLF). However, this is the default line ending for files created by lein new app so it's likely to trip up most new users on windows

timrobinson33 avatar Nov 23 '20 18:11 timrobinson33

This happened for me too! Using the Clojure plugin v0.13.1.

It also added extra blank lines for commented out lines (starting with ;)

I tested directly installing the cljfmt version 0.7.0 as a plugin in Leiningen and running it on the same files and no extra lines were added, so I think it's definitely in this repo rather than the cljfmt one.

malcolm-s avatar Jan 22 '21 12:01 malcolm-s

I'm also encountering this issue in the newest version v0.13.1, I was wondering if there have been any updates on this?

eastrd avatar Nov 15 '21 12:11 eastrd