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

Add support to update indentation #12801

Open
ronisbr opened this issue Feb 6, 2025 · 2 comments
Open

Add support to update indentation #12801

ronisbr opened this issue Feb 6, 2025 · 2 comments
Labels
C-enhancement Category: Improvements

Comments

@ronisbr
Copy link

ronisbr commented Feb 6, 2025

Hi!

In Neovim, I can type == to fix the current line indentation. This feature is useful in many cases where you want to update the indentation of the current line due to some modification or new code. Currently, Helix update correctly the indentation (using treesitter I guess) when a new line is created. But there is no way to update the indentation based on treesitter on an existing line.

For example, if I have:

double coefs[4] = {
    1.0,
    2.0,
    3.0,
           4.0|
};

I want to convert to:

double coefs[4] = {
    1.0,
    2.0,
    3.0,
    4.0|
};

Ref: #12787

@ronisbr ronisbr added the C-enhancement Category: Improvements label Feb 6, 2025
@Daniel-Ros
Copy link

You can use the anchor action (&) to align them.

@ronisbr
Copy link
Author

ronisbr commented Feb 16, 2025

Hi @Daniel-Ros!

You can use the anchor action (&) to align them.

It can of course be used as a work around. However, it is not a good solution specially if you have many lines together and multiple indentation levels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Improvements
Projects
None yet
Development

No branches or pull requests

2 participants