A file-based task manager
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix tsk list: pad id with spaces instead of tab

The tab separator between id and title rendered as zero spaces on
terminals where the tab stop happened to land on the column right after
the id (e.g. width=6 tab stops with `tsk-15`). Replace with fixed-width
space padding so the title column lines up regardless of tab stops.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

+24 -7
+7 -3
src/main.rs
··· 465 465 { 466 466 if ids_only { 467 467 println!("{}", stack_item.id); 468 - } else if let Some(parsed) = task::parse(&stack_item.title) { 469 - println!("{}\t{}", stack_item.id, parsed.content.trim()); 470 468 } else { 471 - println!("{stack_item}"); 469 + // Pad the id to a fixed width with spaces so the title column lines 470 + // up regardless of the user's tab stops. Width fits up to tsk-9999. 471 + let id = stack_item.id.to_string(); 472 + let title = task::parse(&stack_item.title) 473 + .map(|p| p.content.trim().to_string()) 474 + .unwrap_or_else(|| stack_item.title.trim().to_string()); 475 + println!("{id:<8} {title}"); 472 476 } 473 477 } 474 478 Ok(())
+17 -4
src/workspace.rs
··· 1209 1209 .output() 1210 1210 .unwrap(); 1211 1211 let names = String::from_utf8_lossy(&out.stdout); 1212 - assert!(names.contains(&format!("refs/tsk/tasks/{}", id.0)), "{names}"); 1212 + assert!( 1213 + names.contains(&format!("refs/tsk/tasks/{}", id.0)), 1214 + "{names}" 1215 + ); 1213 1216 assert!(names.contains("refs/tsk/index")); 1214 1217 1215 1218 // Now configure refspecs on the working repo and confirm `git push origin` ··· 1221 1224 .output() 1222 1225 .unwrap(); 1223 1226 let push_cfg = String::from_utf8_lossy(&cfg.stdout); 1224 - assert!(push_cfg.lines().any(|l| l.trim() == "refs/tsk/*:refs/tsk/*")); 1227 + assert!( 1228 + push_cfg 1229 + .lines() 1230 + .any(|l| l.trim() == "refs/tsk/*:refs/tsk/*") 1231 + ); 1225 1232 // Idempotent: running again does not duplicate. 1226 1233 ws.configure_git_remote_refspecs("origin").unwrap(); 1227 1234 let cfg2 = std::process::Command::new("git") ··· 1231 1238 .unwrap(); 1232 1239 let push_cfg2 = String::from_utf8_lossy(&cfg2.stdout); 1233 1240 assert_eq!( 1234 - push_cfg.lines().filter(|l| l.trim() == "refs/tsk/*:refs/tsk/*").count(), 1235 - push_cfg2.lines().filter(|l| l.trim() == "refs/tsk/*:refs/tsk/*").count() 1241 + push_cfg 1242 + .lines() 1243 + .filter(|l| l.trim() == "refs/tsk/*:refs/tsk/*") 1244 + .count(), 1245 + push_cfg2 1246 + .lines() 1247 + .filter(|l| l.trim() == "refs/tsk/*:refs/tsk/*") 1248 + .count() 1236 1249 ); 1237 1250 1238 1251 // Pull side: a fresh repo set up to fetch from the same remote, then