This commit is contained in:
Aleksey Kladov 2021-01-20 01:56:11 +03:00
parent 63f509f492
commit 46b4f89c92
28 changed files with 69 additions and 67 deletions

View file

@ -59,7 +59,7 @@ fn remove_newline(edit: &mut TextEditBuilder, token: &SyntaxToken, offset: TextS
// The node is either the first or the last in the file
let suff = &token.text()[TextRange::new(
offset - token.text_range().start() + TextSize::of('\n'),
TextSize::of(token.text().as_str()),
TextSize::of(token.text()),
)];
let spaces = suff.bytes().take_while(|&b| b == b' ').count();