mirror of
https://codeberg.org/scip/tablizer.git
synced 2025-12-17 04:30:56 +01:00
fixed alternating highlighting, now looks reasonable
This commit is contained in:
@@ -20,15 +20,16 @@ package lib
|
||||
import (
|
||||
"encoding/csv"
|
||||
"fmt"
|
||||
"github.com/gookit/color"
|
||||
"github.com/olekukonko/tablewriter"
|
||||
"github.com/tlinden/tablizer/cfg"
|
||||
"gopkg.in/yaml.v3"
|
||||
"io"
|
||||
"log"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/gookit/color"
|
||||
"github.com/olekukonko/tablewriter"
|
||||
"github.com/tlinden/tablizer/cfg"
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
||||
func printData(w io.Writer, c cfg.Config, data *Tabdata) {
|
||||
@@ -148,9 +149,15 @@ func printAsciiData(w io.Writer, c cfg.Config, data *Tabdata) {
|
||||
table.SetRowSeparator("")
|
||||
table.SetHeaderLine(false)
|
||||
table.SetBorder(false)
|
||||
table.SetTablePadding("\t") // pad with tabs
|
||||
table.SetNoWhiteSpace(true)
|
||||
|
||||
if !c.UseHighlight {
|
||||
// the tabs destroy the highlighting
|
||||
table.SetTablePadding("\t") // pad with tabs
|
||||
} else {
|
||||
table.SetTablePadding(" ")
|
||||
}
|
||||
|
||||
table.Render()
|
||||
output(w, color.Sprint(colorizeData(c, tableString.String())))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user