editor: Add align selections action (#44769)

Closes #17090

Hello! This is a feature that I really wanted, so I've created an
implementation of it. Hope u guys like it.
It was alto mentioned at [this
discussion](https://github.com/zed-industries/zed/discussions/30473)

The use cases were based on the [vscode
extension](https://marketplace.visualstudio.com/items?itemName=yo1dog.cursor-align)
(only spaces case was implemented)
- The algorithm is O(n + m × 2k), where:
- n = total cursors (for initial analysis, to understand how many
alignments will be performed)
  - m = number of alignment columns  
- k = number of alignment rows (first time to get the most-right
occurrence, the next one to create the `Vec` of edits)


Release Notes:

- Added `editor: align selections` command


![ezgif-524b631d71833ba1](https://github.com/user-attachments/assets/28c3435a-2e01-496f-81c4-721ecfb5b22d)

<br>

Thank you for creating zed!

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
c7870cb93dTiago Lobão committed on 3/18/2026, 12:55:04 PM· committed by GitHubparentbe3a5e2
4 files changedLine totals unavailable