diff options
author | Omnikar | 2021-07-26 02:00:58 +0000 |
---|---|---|
committer | GitHub | 2021-07-26 02:00:58 +0000 |
commit | 112ae5cffe8cc645623cd2cb04cbee2e69c37a09 (patch) | |
tree | 345a12602f5498aafbf3b0fb81c0514e93c95187 /helix-syntax/src | |
parent | e07e42dcfb24dae348c625822abf74fa87968bff (diff) |
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`
Diffstat (limited to 'helix-syntax/src')
0 files changed, 0 insertions, 0 deletions