Commit Graph

17 Commits (8e8367eea6ff146c7e1097af153398832691e078)

Author SHA1 Message Date
Danilo Spinella 6b80cb8a77
Fix toggle_comments command on multiple selections (#1882) 3 years ago
Blaž Hrastnik f979bdc442 Specify capacity on toggle_line_comments 3 years ago
Kirawi 92c2d5d3bf
Document more of helix-core (#904) 3 years ago
Nathan Vegdahl 3fda350494 Fixes for new clippy lints in Rust 1.54. 3 years ago
Nathan Vegdahl f62ec6e51e Merge branch 'master' into great_line_ending_and_cursor_range_cleanup 3 years ago
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`
3 years ago
Nathan Vegdahl c9300ec35f Fix comment toggle command also sometimes toggling the next line. 3 years ago
Cor Peters cd65a48635
Made toggle_comments language dependent (#463)
* Made toggle_comments language dependent

* Fixed Test Cases

* Added clippy suggestion

* Small Fixes

* Clippy Suggestion

Co-authored-by: Cor <prive@corpeters.nl>
3 years ago
Blaž Hrastnik 7f6265ecf3 fix: crash with ctrl-c on empty file 3 years ago
Wojciech Kępka c978d811d9 Cleanup find_first_non_whitespace_char funcs 3 years ago
Blaž Hrastnik 9eaef6e333 Fully drop State references. 4 years ago
Blaž Hrastnik 06aca7691c clippy lint 4 years ago
Blaž Hrastnik f29f01858d Implement iter() and len() directly on Selection. 4 years ago
Blaž Hrastnik 59e6024186 Remove State from a few more signatures. 4 years ago
Blaž Hrastnik 8eaf9a432d Make Transaction::change only rely on the rope. 4 years ago
Blaž Hrastnik 7a1ff5e45f commands: Wire up toggle comments as ctrl-c 4 years ago
Blaž Hrastnik d0791e0f98 core: Implement comment toggling module. 4 years ago