diff --git a/internal/discourse/tui.go b/internal/discourse/tui.go index 5b2cd46..57ba64b 100644 --- a/internal/discourse/tui.go +++ b/internal/discourse/tui.go @@ -3,6 +3,7 @@ package discourse import ( "github.com/azimut/cli-view/internal/tui" tea "github.com/charmbracelet/bubbletea" + "github.com/fatih/color" ) const rightPadding = 10 @@ -29,11 +30,14 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { var cmd tea.Cmd // Initialize data to be used for links scrapping if m.render.RawContent == "" { + oldColor := color.NoColor oldCommentWidth := m.CommentWidth - m.LineWidth = 400 + color.NoColor = true m.CommentWidth = 300 + m.LineWidth = 400 m.render.RawContent = m.String() m.CommentWidth = oldCommentWidth + color.NoColor = oldColor } m.render, cmd = m.render.Update(msg) switch msg := msg.(type) { diff --git a/internal/fourchan/tui.go b/internal/fourchan/tui.go index c37542f..bdf25b7 100644 --- a/internal/fourchan/tui.go +++ b/internal/fourchan/tui.go @@ -3,6 +3,7 @@ package fourchan import ( "github.com/azimut/cli-view/internal/tui" tea "github.com/charmbracelet/bubbletea" + "github.com/fatih/color" ) type Model struct { @@ -27,11 +28,14 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { var cmd tea.Cmd // Initialize data to be used for links scrapping if m.render.RawContent == "" { + oldColor := color.NoColor oldCommentWidth := m.CommentWidth - m.LineWidth = 400 + color.NoColor = true m.CommentWidth = 300 + m.LineWidth = 400 m.render.RawContent = m.String() m.CommentWidth = oldCommentWidth + color.NoColor = oldColor } m.render, cmd = m.render.Update(msg) switch msg := msg.(type) { diff --git a/internal/hackernews/tui.go b/internal/hackernews/tui.go index 8a090ee..7741e17 100644 --- a/internal/hackernews/tui.go +++ b/internal/hackernews/tui.go @@ -3,6 +3,7 @@ package hackernews import ( "github.com/azimut/cli-view/internal/tui" tea "github.com/charmbracelet/bubbletea" + "github.com/fatih/color" ) const rightPadding = 10 @@ -29,11 +30,14 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { var cmd tea.Cmd // Initialize data to be used for links scrapping if m.render.RawContent == "" { + oldColor := color.NoColor oldCommentWidth := m.CommentWidth - m.LineWidth = 400 + color.NoColor = true m.CommentWidth = 300 + m.LineWidth = 400 m.render.RawContent = m.String() m.CommentWidth = oldCommentWidth + color.NoColor = oldColor } m.render, cmd = m.render.Update(msg) switch msg := msg.(type) { diff --git a/internal/reddit/tui.go b/internal/reddit/tui.go index b746f00..890388b 100644 --- a/internal/reddit/tui.go +++ b/internal/reddit/tui.go @@ -3,6 +3,7 @@ package reddit import ( "github.com/azimut/cli-view/internal/tui" tea "github.com/charmbracelet/bubbletea" + "github.com/fatih/color" ) const rightPadding = 10 @@ -29,11 +30,14 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { var cmd tea.Cmd // Initialize data to be used for links scrapping if m.render.RawContent == "" { + oldColor := color.NoColor oldCommentWidth := m.CommentWidth - m.LineWidth = 400 + color.NoColor = true m.CommentWidth = 300 + m.LineWidth = 400 m.render.RawContent = m.String() m.CommentWidth = oldCommentWidth + color.NoColor = oldColor } m.render, cmd = m.render.Update(msg) // initializes the structs it needed switch msg := msg.(type) { diff --git a/internal/vichan/tui.go b/internal/vichan/tui.go index 3384bda..ef4e95a 100644 --- a/internal/vichan/tui.go +++ b/internal/vichan/tui.go @@ -5,6 +5,7 @@ import ( "github.com/azimut/cli-view/internal/tui" tea "github.com/charmbracelet/bubbletea" + "github.com/fatih/color" ) const rightPadding = 10 @@ -31,11 +32,14 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { var cmd tea.Cmd // Initialize data to be used for links scrapping if m.render.RawContent == "" { + oldColor := color.NoColor oldCommentWidth := m.CommentWidth - m.LineWidth = 400 + color.NoColor = true m.CommentWidth = 300 - m.render.RawContent = fmt.Sprint(m) + m.LineWidth = 400 + m.render.RawContent = m.String() m.CommentWidth = oldCommentWidth + color.NoColor = oldColor } m.render, cmd = m.render.Update(msg) switch msg := msg.(type) {