From c7a330a914b485af438a0d7c38c88f4368eaef43 Mon Sep 17 00:00:00 2001 From: Anton Medvedev Date: Sun, 10 Mar 2024 22:42:53 +0100 Subject: [PATCH] Wrap preview correctly --- main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index dd11fe1..b008a14 100644 --- a/main.go +++ b/main.go @@ -580,7 +580,8 @@ func (m *model) handleKey(msg tea.KeyMsg) (tea.Model, tea.Cmd) { case key.Matches(msg, keyMap.Preview): m.showPreview = true - m.preview.SetContent(m.cursorValue()) + content := lipgloss.NewStyle().Width(m.termWidth).Render(m.cursorValue()) + m.preview.SetContent(content) m.preview.GotoTop() case key.Matches(msg, keyMap.Print):