[WIP] table formatting

This commit is contained in:
Martin Pander
2024-05-24 17:17:58 +02:00
parent 1086b19765
commit f7b54b607b
6 changed files with 587 additions and 117 deletions

View File

@ -2,8 +2,12 @@ package common
import (
"context"
"log/slog"
"os"
"tasksquire/taskwarrior"
"golang.org/x/term"
)
type Common struct {
@ -31,6 +35,8 @@ func NewCommon(ctx context.Context, tw taskwarrior.TaskWarrior) *Common {
func (c *Common) SetSize(width, height int) {
c.width = width
c.height = height
physicalWidth, physicalHeight, _ := term.GetSize(int(os.Stdout.Fd()))
slog.Info("SetSize", "width", width, "height", height, "physicalWidth", physicalWidth, "physicalHeight", physicalHeight)
}
func (c *Common) Width() int {