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

Unexpected handling of formatting of !view macro #112

Open
carlca opened this issue Mar 6, 2024 · 0 comments
Open

Unexpected handling of formatting of !view macro #112

carlca opened this issue Mar 6, 2024 · 0 comments

Comments

@carlca
Copy link

carlca commented Mar 6, 2024

  • cargo 1.78.0-nightly (f772ec022 2024-03-01)
  • leptos = { version = "0.6", features = ["csr", "nightly"] }
  • leptosfmt 0.1.18

Re:Discord msg: https://discord.com/channels/1031524867910148188/1087850268034617394/1214972259626778664

I have the following !view macro...

  view! {
      <button
          on:click=move |_| {
              set_count(3);
          }
      >
          "Click me: "
          {move || count()}
      </button>
  }

and I was hoping to have it reformatted thus...

  view! {
    <button on:click=move |_| { set_count(3); } >
      "Click me: " {count}
    </button>
  }

but. leptosfmt does this...

  view! {
    <button on:click=move |_| {
        set_count(3);
    }>"Click me: " {count}</button>
  }

it's not the end of the world, and it's easily corrected, but it would be good to have this, or at least an option to have this!

This is my leptosfmt.toml at the moment. The `max_width' setting was changed at the suggestion of @brad but it doesn't seem to have made any difference.

max_width = 1000
tab_spaces = 2
attr_value_brace_style = "WhenRequired" # "Always", "AlwaysUnlessLit", "WhenRequired" or "Preserve"
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

1 participant