Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Continue line comments #10996

Merged
merged 65 commits into from
Oct 19, 2024
Merged
Changes from 1 commit
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
3844eb7
Add `continue_comment` function
seanchen1991 Oct 20, 2023
3d31e66
Add test for `get_comment_token` fn
seanchen1991 Oct 20, 2023
129ecae
Fix incorrect assertion
seanchen1991 Oct 20, 2023
2449622
Wire up continue comment functionality
seanchen1991 Oct 20, 2023
036e2bf
Add `comment-tokens` field to languages.toml
seanchen1991 Oct 20, 2023
adda266
Add additional comment tokens for Rust
seanchen1991 Oct 20, 2023
be9224e
Match all comment-tokens fields with comment-token fields
seanchen1991 Oct 20, 2023
e77d15d
Refactor continue comment function to also return position of comment…
seanchen1991 Oct 20, 2023
751d15d
Update calls to find_first_non_whitespace_char
seanchen1991 Oct 22, 2023
4315906
Continue single comments with indentation
seanchen1991 Oct 22, 2023
0d224e5
Implement `count_whitespace_after` fn
seanchen1991 Oct 24, 2023
ee9c015
Get tests for continue comment logic passing
seanchen1991 Oct 24, 2023
e44d55a
Don't count newlines when counting whitespace
seanchen1991 Oct 24, 2023
d816982
Rename a variable
seanchen1991 Oct 24, 2023
e6a492b
Add `continue-comment` config parameter
seanchen1991 Oct 25, 2023
c3a6190
Contiue comments in insert mode based on config
seanchen1991 Oct 25, 2023
d25c959
Merge branch 'helix-editor:master' into feature/continue-comment
seanchen1991 Oct 26, 2023
cbd05dc
Use pre-existing indentation functions to indent comment lines
seanchen1991 Oct 26, 2023
d73cd87
Merge branch 'feature/continue-comment' of https://github.com/seanche…
seanchen1991 Oct 26, 2023
e170d40
Clean up for PR submission
seanchen1991 Oct 30, 2023
d52dae9
Fix merge conflict in languages.toml
seanchen1991 Oct 30, 2023
b03f870
Remove changes in indent.rs
seanchen1991 Oct 30, 2023
57261e5
Remove incorrect unit test
seanchen1991 Nov 1, 2023
e51c288
Merge branch 'feature/continue-comment' of github.com:seanchen1991/he…
TornaxO7 Jun 19, 2024
8fa3cc9
add `has_line_comment` method and fix `starts_with` for RopeSlice
TornaxO7 Jun 20, 2024
c70acf7
make clippy happy
TornaxO7 Jun 20, 2024
345ee7c
Merge branch 'master' of github.com:helix-editor/helix into continue-…
TornaxO7 Jul 15, 2024
38bc94b
continue-line-comment: add explanation
TornaxO7 Jul 20, 2024
fa50e51
single-line-comment: improve performance
TornaxO7 Jul 20, 2024
e318a30
comment: Add invariant to comment-tokens in config
TornaxO7 Aug 6, 2024
76a42d9
continue-comment: improve continue comment when opening new lines wit…
TornaxO7 Aug 6, 2024
b5f3dd4
continue-comment: improve continue comment when writing new line
TornaxO7 Aug 6, 2024
22734da
continue-comment: add hepler function to reduce LOC and improve reada…
TornaxO7 Aug 6, 2024
de5ebe6
comment.rs: revamp tests
TornaxO7 Aug 7, 2024
dc6411d
comments: remove some if-guards
TornaxO7 Aug 7, 2024
ca6ee48
comments: add special case if the text is empty it won't be considere…
TornaxO7 Aug 7, 2024
1a95d40
continue-comment: fix token finding
TornaxO7 Aug 7, 2024
dc92500
make clippy happy
TornaxO7 Aug 7, 2024
1e18f1b
config: fix tests
TornaxO7 Aug 7, 2024
f68cf64
continue-comments: add some docs
TornaxO7 Aug 7, 2024
4cc5148
continue-comment: remove unwraps
TornaxO7 Aug 7, 2024
830f148
Merge branch 'master' of github.com:helix-editor/helix into continue-…
TornaxO7 Aug 9, 2024
da2a444
continue-comment: removing indent_heuristic function
TornaxO7 Aug 9, 2024
1eb963d
Revert "continue-comment: removing indent_heuristic function"
TornaxO7 Aug 9, 2024
9c09141
Reapply "continue-comment: removing indent_heuristic function"
TornaxO7 Aug 9, 2024
d4b1dfb
Revert "continue-comment: removing indent_heuristic function"
TornaxO7 Aug 9, 2024
f53ec12
continue-comment: set default value for continue comments to false
TornaxO7 Aug 9, 2024
372550d
continue-comment: enable by default and use hybrid indentation
TornaxO7 Aug 9, 2024
83093f8
continue-comments: fix indent-logic if continue-comments wants to pla…
TornaxO7 Aug 10, 2024
b842fdb
continue-comment: improve code readability
TornaxO7 Aug 10, 2024
b5003e9
continue-comment: add some comments and remove unused code
TornaxO7 Aug 10, 2024
835b4ba
revert unecessary variable renaming
TornaxO7 Oct 5, 2024
310b6dd
remove config option for continue-comments
TornaxO7 Oct 5, 2024
45f230e
continue-comments: update parameter types of `get_comment_token`
TornaxO7 Oct 6, 2024
ce5d174
continue-comments: restructure `get_comment_token`
TornaxO7 Oct 6, 2024
170c8c2
continue-comments: simplify code
TornaxO7 Oct 6, 2024
843b9b4
style-nit: reduce nested blocks
TornaxO7 Oct 6, 2024
a5d7f52
continue-comments: improve jumping behaviour
TornaxO7 Oct 6, 2024
d7ca450
continue-comments: improve local_offs variable calculation
TornaxO7 Oct 6, 2024
e9ef838
fix warnings
TornaxO7 Oct 6, 2024
aca48e8
improve code format
TornaxO7 Oct 7, 2024
b7f9780
continue-comments: Fix panic case and add test
TornaxO7 Oct 7, 2024
5b9613c
continue-comments: adding test
TornaxO7 Oct 7, 2024
898f231
improve code structure
TornaxO7 Oct 7, 2024
12a8b3e
comment: reverting small bug fix
TornaxO7 Oct 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
continue-line-comment: add explanation
  • Loading branch information
TornaxO7 committed Jul 20, 2024
commit 38bc94b9ac8404ec03b713c66372bb1452081fcb
2 changes: 2 additions & 0 deletions helix-term/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1670,6 +1670,8 @@ fn has_line_comment(config: &Config, doc: &Document, line_num: usize) -> Option<
.language_config()
.and_then(|lc| lc.comment_tokens.as_ref())?
.clone();
// Use case (example): Rust supports `//` and `///`. We're reverse-sorting them to priorize `///` before `//`
// because otherwise a doc comment `/// like this` would get `//` as the next comment-token
line_tokens.sort_by(|a, b| a.len().partial_cmp(&b.len()).unwrap().reverse());
line_tokens
};
Expand Down
Loading