Skip to content

Commit

Permalink
fix(preview): don't reload when focused if it was already open
Browse files Browse the repository at this point in the history
  • Loading branch information
idursun committed Feb 28, 2025
1 parent 428fe43 commit 8ce311a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/ui/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,11 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
cmds = append(cmds, common.SelectionChanged)
return m, tea.Batch(cmds...)
case key.Matches(msg, PreviewFocus):
if !m.previewVisible {
cmds = append(cmds, common.SelectionChanged)
}
m.previewVisible = true
cmds = append(cmds, preview.Focus, common.SelectionChanged)
cmds = append(cmds, preview.Focus)
return m, tea.Batch(cmds...)
}
case common.ToggleHelpMsg:
Expand Down

0 comments on commit 8ce311a

Please sign in to comment.