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:
commit
2baec5927e
4 changed files with 4 additions and 4 deletions
|
@ -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);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#[derive(Clone)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub enum Layout {
|
||||
Tall,
|
||||
Wide,
|
||||
|
|
|
@ -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(),
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Some functions f
|
||||
name attribute.
|
||||
name attribute.
|
||||
*/
|
||||
/*
|
||||
Add to or over
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue