chouzz / vscode-better-align

Better vertical alignment with/without selection in any language.
https://marketplace.visualstudio.com/items?itemName=Chouzz.vscode-better-align&ssr=false#overview
Apache License 2.0
39 stars 4 forks source link

i think there is a bug in better align when it is used in C++. #116

Open dujinpeng0249 opened 9 months ago

dujinpeng0249 commented 9 months ago

before align:

constexpr auto NaN = std::numeric_limits<double>::quiet_NaN();
Eigen::VectorXd current_penalties = Eigen::VectorXd::Constant(constrain_number, NaN);

after align:

constexpr       auto NaN                = std::numeric_limits<double>::quiet_NaN();
Eigen::VectorXd current_penalties       = Eigen::VectorXd::Constant(constrain_number, NaN);

However, I think the proper alignment should be as follows:

constexpr auto   NaN                     = std::numeric_limits<double>::quiet_NaN();
Eigen::VectorXd  current_penalties       = Eigen::VectorXd::Constant(constrain_number, NaN);

Because constexpr auto is the complete type of NaN.

chouzz commented 1 month ago

It can't. For better align, it can't understand constexpr auto. Maybe it can align like

constexpr auto NaN                = std::numeric_limits<double>::quiet_NaN();
Eigen::VectorXd current_penalties = Eigen::VectorXd::Constant(constrain_number, NaN);