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

Merge pull request #125 from kamadorueda/kamadorueda

fix: position update
This commit is contained in:
Kevin Amado 2022-02-17 00:22:43 -05:00 committed by GitHub
commit 2baec5927e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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