From 0b059c9a72ddd4cce8a8ff896a2e7cd3bdcf2aaa Mon Sep 17 00:00:00 2001 From: sloum Date: Tue, 6 Apr 2021 13:59:20 -0700 Subject: [PATCH] Offsets cell data with a space char to prevent 'runtogether' --- cell.go | 6 +++--- main.go | 3 --- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/cell.go b/cell.go index 6763470..7988154 100644 --- a/cell.go +++ b/cell.go @@ -28,11 +28,11 @@ func (c cell) String(width int, selected bool) string { if selected { mods += "\033[7m" } - format := "%s%*.*s\033[0m" + format := "%s %*.*s \033[0m" if c.kind == Text { - format = "%s%-*.*s\033[0m" + format = "%s %-*.*s \033[0m" } - return fmt.Sprintf(format, mods, width, width, c.mask) + return fmt.Sprintf(format, mods, width-2, width-2, c.mask) } func (c cell) Mods() string { diff --git a/main.go b/main.go index 328857a..5b72697 100644 --- a/main.go +++ b/main.go @@ -90,9 +90,6 @@ func runCommand(elems []string) { fmt.Print("\033[2J") // Clear the screen case "recalculate", "r": wb.sheets[wb.sheet].Recalculate() - default: - // TODO report error - panic("Invalid command") } }