Offsets cell data with a space char to prevent 'runtogether'

This commit is contained in:
sloum 2021-04-06 13:59:20 -07:00
parent 5e5b8c4591
commit 0b059c9a72
2 changed files with 3 additions and 6 deletions

View File

@ -28,11 +28,11 @@ func (c cell) String(width int, selected bool) string {
if selected { if selected {
mods += "\033[7m" mods += "\033[7m"
} }
format := "%s%*.*s\033[0m" format := "%s %*.*s \033[0m"
if c.kind == Text { 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 { func (c cell) Mods() string {

View File

@ -90,9 +90,6 @@ func runCommand(elems []string) {
fmt.Print("\033[2J") // Clear the screen fmt.Print("\033[2J") // Clear the screen
case "recalculate", "r": case "recalculate", "r":
wb.sheets[wb.sheet].Recalculate() wb.sheets[wb.sheet].Recalculate()
default:
// TODO report error
panic("Invalid command")
} }
} }