A few various changes

- Fixed the '-local' flag to accept host and port
- Added a '-debug' flag to accept a file to write debug log messages
- Added some logic which will force the dark background flag on if MacOS is in dark mode
This commit is contained in:
Leon Mika 2022-06-16 22:00:25 +10:00
parent 47e404aff7
commit 41af399215
18 changed files with 191 additions and 68 deletions

View file

@ -128,9 +128,7 @@ func (m *Model) setLeftmostDisplayedColumn(newCol int) {
} else {
m.colOffset = newCol
}
// TEMP
m.table.GoDown()
m.table.GoUp()
m.table.UpdateView()
}
func (m *Model) View() string {
@ -172,15 +170,6 @@ func (m *Model) rebuildTable() {
m.rows = newRows
newTbl.SetRows(newRows)
/*
for newTbl.Cursor() != m.table.Cursor() {
if newTbl.Cursor() < m.table.Cursor() {
newTbl.GoDown()
} else if newTbl.Cursor() > m.table.Cursor() {
newTbl.GoUp()
}
}
*/
m.table = newTbl
}

View file

@ -12,7 +12,7 @@ import (
var (
markedRowStyle = lipgloss.NewStyle().
Background(lipgloss.AdaptiveColor{Dark: "#e1e1e1", Light: "#414141"})
Background(lipgloss.AdaptiveColor{Light: "#e1e1e1", Dark: "#414141"})
dirtyRowStyle = lipgloss.NewStyle().
Foreground(lipgloss.Color("#e13131"))
newRowStyle = lipgloss.NewStyle().
@ -60,6 +60,8 @@ func (mtr itemTableRow) Render(w io.Writer, model table.Model, index int) {
if mi := r.MetaInfo(); mi != "" {
sb.WriteString(metaInfoStyle.Render(mi))
}
} else {
sb.WriteString(metaInfoStyle.Render("~"))
}
}