zed/crates/language
Marshall Bowers 759646e0a3
editor: Improve rewrapping when working with comments at different indentation levels (#18146)
This PR improves the `editor::Rewrap` command when working with comments
that were not all at the same indentation level.

We now use a heuristic of finding the most common indentation level for
each line, using the deepest indent in the event of a tie.

It also removes an `.unwrap()` that would previously lead to a panic in
this case. Instead of unwrapping we now log an error to the logs and
skip rewrapping for that selection.

Release Notes:

- Improved the behavior of `editor: rewrap` when working with a
selection that contained comments at different indentation levels.
2024-09-20 11:45:03 -04:00
..
src editor: Improve rewrapping when working with comments at different indentation levels (#18146) 2024-09-20 11:45:03 -04:00
build.rs
Cargo.toml Replace lazy_static with std::sync::LazyLock (#16066) 2024-08-20 14:27:33 -04:00
LICENSE-GPL chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00