Juan Pedro Bolívar Puente
2016-09-29 12:03:07 UTC
Hi!
I am using cc-mode from current `default` branch on the hg repository.
I am impressed with the progress on adding support for C++11, which was
my major pain point with this mode.
I love how lambda indentation has been improved when passed to
functions, however it is in my opinion still suboptimal when doing an
assignment. For example, this is how cc-mode is indenting a lambda I
just wrote today:
auto add_child = [this] (node_t* n) {
if (parent->slots() == branches<B>) {
if (result == parent)
result = make_inner_r(parent);
assert(result->slots() < branches<B>);
parent
= result->inner() [result->slots()++]
= make_inner_r();
}
parent->inner() [parent->slots()++] = n;
};
And this is how I'd rather expect it to be indented:
auto add_child = [this] (node_t* n) {
if (parent->slots() == branches<B>) {
if (result == parent)
result = make_inner_r(parent);
assert(result->slots() < branches<B>);
parent
= result->inner() [result->slots()++]
= make_inner_r();
}
parent->inner() [parent->slots()++] = n;
};
Notably, I would also like to be able to move the breaces down to after
the lambda declaration (I noticed this is not supported for lambda as
function argument neither). Here is an example:
auto add_child = [this] (node_t* n)
{
if (parent->slots() == branches<B>) {
if (result == parent)
result = make_inner_r(parent);
assert(result->slots() < branches<B>);
parent
= result->inner() [result->slots()++]
= make_inner_r();
}
parent->inner() [parent->slots()++] = n;
};
I hope you consider this suggestion appropriate. Thanks a lot for the
sustained improvements in this mode.
Cheers!
JP
I am using cc-mode from current `default` branch on the hg repository.
I am impressed with the progress on adding support for C++11, which was
my major pain point with this mode.
I love how lambda indentation has been improved when passed to
functions, however it is in my opinion still suboptimal when doing an
assignment. For example, this is how cc-mode is indenting a lambda I
just wrote today:
auto add_child = [this] (node_t* n) {
if (parent->slots() == branches<B>) {
if (result == parent)
result = make_inner_r(parent);
assert(result->slots() < branches<B>);
parent
= result->inner() [result->slots()++]
= make_inner_r();
}
parent->inner() [parent->slots()++] = n;
};
And this is how I'd rather expect it to be indented:
auto add_child = [this] (node_t* n) {
if (parent->slots() == branches<B>) {
if (result == parent)
result = make_inner_r(parent);
assert(result->slots() < branches<B>);
parent
= result->inner() [result->slots()++]
= make_inner_r();
}
parent->inner() [parent->slots()++] = n;
};
Notably, I would also like to be able to move the breaces down to after
the lambda declaration (I noticed this is not supported for lambda as
function argument neither). Here is an example:
auto add_child = [this] (node_t* n)
{
if (parent->slots() == branches<B>) {
if (result == parent)
result = make_inner_r(parent);
assert(result->slots() < branches<B>);
parent
= result->inner() [result->slots()++]
= make_inner_r();
}
parent->inner() [parent->slots()++] = n;
};
I hope you consider this suggestion appropriate. Thanks a lot for the
sustained improvements in this mode.
Cheers!
JP
--
â¿â¿â¿â¿
https://sinusoid.es
â¿â¿â¿â¿
â¿â¿â¿â¿
https://sinusoid.es
â¿â¿â¿â¿