mirror of
https://github.com/kdheepak/taskwarrior-tui.git
synced 2025-08-26 03:07:18 +02:00
Make table not shift in multiple selection mode
This commit is contained in:
parent
18e9f15851
commit
34f6dcca34
2 changed files with 8 additions and 8 deletions
|
@ -694,9 +694,9 @@ impl TTApp {
|
|||
if header == "ID" || header == "Name" {
|
||||
// always give ID a couple of extra for indicator
|
||||
widths[i] += self.config.uda_selection_indicator.as_str().graphemes(true).count();
|
||||
if let TableMode::MultipleSelection = self.task_table_state.mode() {
|
||||
widths[i] += 2
|
||||
};
|
||||
// if let TableMode::MultipleSelection = self.task_table_state.mode() {
|
||||
// widths[i] += 2
|
||||
// };
|
||||
}
|
||||
}
|
||||
|
||||
|
|
10
src/table.rs
10
src/table.rs
|
@ -367,22 +367,22 @@ where
|
|||
|
||||
let highlight_symbol = match state.mode {
|
||||
TableMode::MultipleSelection => {
|
||||
let s = self.highlight_symbol.unwrap_or("• ").trim_end();
|
||||
format!("[{}] ", s)
|
||||
let s = self.highlight_symbol.unwrap_or("•").trim_end();
|
||||
format!("{} ", s)
|
||||
}
|
||||
TableMode::SingleSelection => self.highlight_symbol.unwrap_or("").to_string(),
|
||||
};
|
||||
|
||||
let mark_symbol = match state.mode {
|
||||
TableMode::MultipleSelection => {
|
||||
let s = self.mark_symbol.unwrap_or("✓ ").trim_end();
|
||||
format!("[{}] ", s)
|
||||
let s = self.mark_symbol.unwrap_or("☑").trim_end();
|
||||
format!("{} ", s)
|
||||
}
|
||||
TableMode::SingleSelection => self.highlight_symbol.unwrap_or("").to_string(),
|
||||
};
|
||||
|
||||
let blank_symbol = match state.mode {
|
||||
TableMode::MultipleSelection => "[ ] ".to_string(),
|
||||
TableMode::MultipleSelection => "☐ ".to_string(),
|
||||
TableMode::SingleSelection => iter::repeat(" ").take(highlight_symbol.width()).collect::<String>(),
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue