1
Fork 0
mirror of https://github.com/RGBCube/alejandra synced 2025-07-30 12:07:46 +00:00

continue lambda on the same line

This commit is contained in:
Kevin Amado 2022-02-18 16:54:05 -05:00
parent 5e20ba2efb
commit e7090a0494
No known key found for this signature in database
GPG key ID: FFF341057F503148
3 changed files with 50 additions and 33 deletions

View file

@ -65,23 +65,7 @@ pub fn rule(
let child = children.get_next().unwrap();
match layout {
crate::config::Layout::Tall => {
if is_pattern_type
|| comment
|| (matches!(
child.element.kind(),
rnix::SyntaxKind::NODE_LAMBDA
) && matches!(
child
.element
.clone()
.into_node()
.unwrap()
.children()
.next()
.unwrap()
.kind(),
rnix::SyntaxKind::NODE_PATTERN
))
if comment
|| !matches!(
child.element.kind(),
rnix::SyntaxKind::NODE_ATTR_SET

View file

@ -16,4 +16,21 @@
{ }:
a: b: c:
a)
({pkgs, ...}: {
# Stuff
})
({pkgs, ...}: let
in pkgs)
(a: {b,
...}: c: {
# Stuff
})
(a: {b, c,
...}: d: {
# Stuff
})
]

View file

@ -4,18 +4,16 @@
c
*/
d)
({}:
b:
/*
c
*/
d)
(a:
{}:
/*
c
*/
d)
({}: b:
/*
c
*/
d)
(a: {}:
/*
c
*/
d)
(a: d)
(a:
/*
@ -48,8 +46,26 @@
locationsXml,
}:
null)
(a: b: c:
{}:
a: b: c:
a)
(a: b: c: {}: a: b: c:
a)
({pkgs, ...}: {
# Stuff
})
({pkgs, ...}: let
in
pkgs)
(a: {b, ...}: c: {
# Stuff
})
(a: {
b,
c,
...
}: d: {
# Stuff
})
]