www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ide - Dfmt line breaks

reply helxi <brucewayneshit gmail.com> writes:
Hi. I am curious if there is any way to prevent dfmt from 
formatting my lines from
///
     import std.stdio, std.conv, std.algorithm, std.range, 
std.string, std.bigint;

     void main()
     {
         auto arr =
         stdin
         .readln
         .strip
         .splitter
         .array
         .permutations
         .map!(join)
         .map!(to!BigInt)
         .array
         .dup
         .sort();

         writeln(arr[0], ' ', arr[$-1]);
     }
///
to
///
import std.stdio, std.conv, std.algorithm, std.range, std.string, 
std.bigint;

void main()
{
     auto arr = 
stdin.readln.strip.splitter.array.permutations.map!(join)
         .map!(to!BigInt).array.dup.sort();

     writeln(arr[0], ' ', arr[$ - 1]);
}
///


I am using VS Code with Code-d extension.
Jun 22 2017
parent Petar Kirov [ZombineDev] <petar.p.kirov gmail.com> writes:
On Thursday, 22 June 2017 at 21:58:52 UTC, helxi wrote:
 Hi. I am curious if there is any way to prevent dfmt from 
 formatting my lines from
 ///
     import std.stdio, std.conv, std.algorithm, std.range, 
 std.string, std.bigint;

     void main()
     {
         auto arr =
         stdin
         .readln
         .strip
         .splitter
         .array
         .permutations
         .map!(join)
         .map!(to!BigInt)
         .array
         .dup
         .sort();

         writeln(arr[0], ' ', arr[$-1]);
     }
 ///
 to
 ///
 import std.stdio, std.conv, std.algorithm, std.range, 
 std.string, std.bigint;

 void main()
 {
     auto arr = 
 stdin.readln.strip.splitter.array.permutations.map!(join)
         .map!(to!BigInt).array.dup.sort();

     writeln(arr[0], ' ', arr[$ - 1]);
 }
 ///


 I am using VS Code with Code-d extension.
Yes, have a look at this: https://github.com/dlang-community/dfmt#disabling-formatting
Jun 22 2017