mirror of
https://github.com/kdheepak/taskwarrior-tui.git
synced 2025-08-25 17:57:19 +02:00
Make ID right align
This commit is contained in:
parent
dac571f7e7
commit
7f2ea5ab78
1 changed files with 7 additions and 1 deletions
|
@ -305,6 +305,7 @@ where
|
|||
} else {
|
||||
0
|
||||
};
|
||||
let header_index = self.header.by_ref().into_iter().position(|r| r.to_string() == "ID").unwrap_or_else(|| 0);
|
||||
for (i, row) in self.rows.skip(state.offset).take(remaining).enumerate() {
|
||||
let (data, style, symbol) = match row {
|
||||
Row::Data(d) | Row::StyledData(d, _) if Some(i) == state.selected.map(|s| s - state.offset) => {
|
||||
|
@ -334,7 +335,12 @@ where
|
|||
);
|
||||
format!("{}", elt)
|
||||
};
|
||||
buf.set_stringn(x, y + i as u16, s, *w as usize, style);
|
||||
let cell = if c == header_index {
|
||||
format!("{symbol:>width$}", symbol = s, width = *w as usize)
|
||||
} else {
|
||||
format!("{symbol:<width$}", symbol = s, width = *w as usize)
|
||||
};
|
||||
buf.set_stringn(x, y + i as u16, cell, *w as usize, style);
|
||||
x += *w + self.column_spacing;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue