Fix a typo in join_selections (#12452)

Co-authored-by: Rose Hogenson <rosehogenson@posteo.net>
This commit is contained in:
rhogenson 2025-01-08 06:42:41 -08:00 committed by GitHub
parent 917174e546
commit 931dd9c1dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View file

@ -4780,7 +4780,7 @@ fn join_selections_impl(cx: &mut Context, select_space: bool) {
changes.reserve(lines.len());
let first_line_idx = slice.line_to_char(start);
let first_line_idx = skip_while(slice, first_line_idx, |ch| matches!(ch, ' ' | 't'))
let first_line_idx = skip_while(slice, first_line_idx, |ch| matches!(ch, ' ' | '\t'))
.unwrap_or(first_line_idx);
let first_line = slice.slice(first_line_idx..);
let mut current_comment_token = comment_tokens

View file

@ -665,6 +665,14 @@ async fn test_join_selections_comment() -> anyhow::Result<()> {
))
.await?;
test((
"#[|\t// Join comments
\t// with indent]#",
":lang go<ret>J",
"#[|\t// Join comments with indent]#",
))
.await?;
Ok(())
}