diff options
| author | Kyren223 <Kyren223@proton.me> | 2024-12-24 17:41:07 +0200 |
|---|---|---|
| committer | Kyren223 <Kyren223@proton.me> | 2024-12-24 17:41:07 +0200 |
| commit | 0746f3de04c81e39f5602e6822e2dbb45e1fa89b (patch) | |
| tree | 0b577db5bb7f790382bff8582e6d13fce448567f | |
| parent | 534ef0df87f0f26c6211ada1ea8bd53c65acc1e8 (diff) | |
Selected message resets when focus is lost
| -rw-r--r-- | internal/client/ui/core/chat/chat.go | 1 | ||||
| -rw-r--r-- | internal/client/ui/core/core.go | 9 |
2 files changed, 7 insertions, 3 deletions
diff --git a/internal/client/ui/core/chat/chat.go b/internal/client/ui/core/chat/chat.go index f2b0362..90e8d0d 100644 --- a/internal/client/ui/core/chat/chat.go +++ b/internal/client/ui/core/chat/chat.go @@ -194,6 +194,7 @@ func (m *Model) Focus() { func (m *Model) Blur() { m.focus = false + m.index = -1 m.vi.Blur() } diff --git a/internal/client/ui/core/core.go b/internal/client/ui/core/core.go index b1ed7e3..46eaca5 100644 --- a/internal/client/ui/core/core.go +++ b/internal/client/ui/core/core.go @@ -339,15 +339,18 @@ func (m *Model) move(direction int) { focus := m.focus + direction m.focus = max(0, min(FocusMax-1, focus)) - m.networkList.Blur() - m.frequencyList.Blur() - m.chat.Blur() switch m.focus { case FocusNetworkList: + m.frequencyList.Blur() + m.chat.Blur() m.networkList.Focus() case FocusFrequencyList: + m.networkList.Blur() + m.chat.Blur() m.frequencyList.Focus() case FocusChat: + m.networkList.Blur() + m.frequencyList.Blur() m.chat.Focus() default: assert.Never("missing switch statement field in move", "focus", m.focus) |
