Sublime Forum

Reindent Lines Bug?

#1

Hello All,
I just noticed that the Indentation: Reindent Lines seems to break on all lines that end with a commments

If I take:
fn main(){
----match “string” {
--------None => {},
--------Some(“string”) => println!(“string”),
--------Some(“str”) => println!(“str”), // Comment Test
--------Some(“foo”) => println!(“foo”),
--------Some(&_) => {},
----}
}

I can do anything I want, and reindent will fix it, unless the Some("str") line is indented incorrectly. Take this exact correctly indented file, delete the leading whitespace in front of Some("str")
, reindent and you get.
fn main(){
----match “string” {
--------None => {},
--------Some(“string”) => println!(“string”),
Some(“str”) => println!(“str”), // Comment Test
Some(“foo”) => println!(“foo”),
Some(&_) => {},
}
}

Is their some fix to this? It looks like in general, lines containing comments are never moved and are given super preference when determining the current indentation level. It does not matter what is before them, indentation after a line with a comment is determined solely by the indentation of that previous comment line and anything that has happened afterwards.

Edit: OK whitespace does not work on this forum at all I guess. will try other characters. Wow, you really dont what to be able to display code here. Maybe ‘-’ will work?

0 Likes

#2
1 Like