helix/helix-core
Omnikar 112ae5cffe
Determine whether to use a margin of 0 or 1 when uncommenting (#476)
* Implement `margin` calculation for uncommenting

* Move `margin` calculation to `find_line_comment`

* Fix comment bug with multiple selections on a line

* Fix `find_line_comment` test for new return type

* Generate a single vec of lines for comment toggle

`toggle_line_comments` collects the lines covered by all selections into
a `Vec`, skipping duplicates. `find_line_comment` now returns the lines
to operate on, instead of returning the lines to skip.

* Fix test for `find_line_comment`

* Reserve length of `to_change` instead of `lines`

The length of `lines` includes blank lines which will be skipped, and as
such do not need space for a change reserved for them. `to_change`
includes only the lines which will be changed.

* Use `token.chars().count()` for token char length

* Create `changes` with capacity instead of reserving

* Remove unnecessary clones in `test_find_line_comment`

* Add test case for 0 margin comments

* Add comments explaining `find_line_comment`
2021-07-26 11:00:58 +09:00
..
src Determine whether to use a margin of 0 or 1 when uncommenting (#476) 2021-07-26 11:00:58 +09:00
.gitignore Initial import. 2020-05-20 18:14:51 +09:00
Cargo.toml Bump unicode-segmentation from 1.7.1 to 1.8.0 2021-07-06 09:52:33 +09:00