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

Feature request: preserve more blank lines in function body #1047

Closed
iwinux opened this issue Oct 4, 2019 · 0 comments · Fixed by #1077
Closed

Feature request: preserve more blank lines in function body #1047

iwinux opened this issue Oct 4, 2019 · 0 comments · Fixed by #1077

Comments

@iwinux
Copy link

iwinux commented Oct 4, 2019

With option sequence-blank-line = preserve-one (added by #814), blank lines in sequences are preserved as expected, but other blank lines in function body are still "eaten".

For example (code adapted from Cohttp example):

let async_main =
  let* resp, raw_body = Client.get (Uri.of_string "https://api.github.com/") in

  let* body = Body.to_string raw_body in
  let code = resp |> Response.status |> Code.code_of_status in

  Printf.printf "Status: %d\n" code;
  Printf.printf "Body: %s\n" body;
  Lwt.return ()

becomes

let async_main =
  let* resp, raw_body = Client.get (Uri.of_string "https://api.github.com/") in
  let* body = Body.to_string raw_body in
  let code = resp |> Response.status |> Code.code_of_status in
  Printf.printf "Status: %d\n" code;
  Printf.printf "Body: %s\n" body;
  Lwt.return ()

It would be great if such blank lines are left intact, so that some blocks of logic can "stand out" by keeping "distance" from other blocks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant