1
Fork 0
mirror of https://github.com/RGBCube/alejandra synced 2025-07-31 12:37:45 +00:00

fix: position update

This commit is contained in:
Kevin Amado 2022-02-17 00:18:32 -05:00
parent 042bf5f959
commit 8fa591ae3d
No known key found for this signature in database
GPG key ID: FFF341057F503148
4 changed files with 4 additions and 4 deletions

View file

@ -225,7 +225,7 @@ fn dedent_comment(pos: &crate::position::Position, text: &str) -> String {
lines[0] = "".to_string();
} else {
lines.insert(0, format!("{0:<1$}", "", pos.column + 1));
lines[1] = format!("{0:<1$}{2}", "", pos.column + 1, lines[1]);
lines[1] = format!("{0:<1$}{2}", "", pos.column + 2, lines[1]);
}
// println!("{:?}", lines);

View file

@ -1,4 +1,4 @@
#[derive(Clone)]
#[derive(Clone, Debug)]
pub enum Layout {
Tall,
Wide,

View file

@ -17,7 +17,7 @@ impl Position {
self.column = 0
}
self.column += match chars.iter().rposition(|c| *c == '\n') {
Some(pos) => chars.len() - pos,
Some(pos) => chars.len() - pos - 1,
None => chars.len(),
};
}

View file

@ -1,6 +1,6 @@
/*
Some functions f
name attribute.
name attribute.
*/
/*
Add to or over