vfmt inconsistency between CRLF and LF end of line #23524
Labels
Bug
This tag is applied to issues which reports bugs.
Status: Confirmed
This bug has been confirmed to be valid by a contributor.
Unit: vfmt
Bugs/feature requests, that are related to the `vfmt`, the formatter for V.
Describe the bug
If u "disable" fmt with
// vfmt off
and after reenable it with// vfmt on
on a block on a file with CRLF as end of linev fmt
delete the line under// vfmt off
and add a new// vfmt on
after the already existing// vfmt on
breaking the code.On a file with LF as eol this problem doesn't subsist.
Reproduction Steps
Create a simple file like:
And set the eol as CRLF
Expected Behavior
Running
v fmt .
nothing change as all is already formatted and/or you want to keep the style as is.v fmt
should not act differently based of the eol.Current Behavior
With CRLF eol.
Running
v fmt .
(from ide or terminal) break the code returning this:Possible Solution
No response
Additional Information/Context
Setting the file to LF eol resolve the issue.
I dont think that the problem could be the terminal used (Win Terminal) because using
v fmt -w .
write the wrong output on the file.V version
V 0.4.9 2aa5651.fda0af4
Environment details (OS name and version, etc.)
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
The text was updated successfully, but these errors were encountered: