diff options
| author | Kyren223 <Kyren223@proton.me> | 2024-12-16 18:19:18 +0200 |
|---|---|---|
| committer | Kyren223 <Kyren223@proton.me> | 2024-12-16 18:19:18 +0200 |
| commit | 2b0812ae7e2b2bd57b2c0d2d873f728da7a78437 (patch) | |
| tree | c425988ab21d0e641e22b521dc1039fd9081830e /internal/client/ui/core/core.go | |
| parent | 91992de3c09c2bd88a995bac6822e3c3678b08dc (diff) | |
Added capability for chat to be "locked" into viminput, which solves the
issue of H/L, they can now be typed normally, pressing "i" to go into
locked mode and "q" (in normal mode) to leave it
Diffstat (limited to 'internal/client/ui/core/core.go')
| -rw-r--r-- | internal/client/ui/core/core.go | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/internal/client/ui/core/core.go b/internal/client/ui/core/core.go index dd29106..5d87294 100644 --- a/internal/client/ui/core/core.go +++ b/internal/client/ui/core/core.go @@ -265,15 +265,17 @@ func (m *Model) updateConnected(msg tea.Msg) tea.Cmd { return cmd } - left := msg.String() == "H" - right := msg.String() == "L" - direction := 0 - if left { - direction = -1 - } else if right { - direction = 1 + if m.focus != FocusChat || !m.chat.Locked() { + left := msg.String() == "H" + right := msg.String() == "L" + direction := 0 + if left { + direction = -1 + } else if right { + direction = 1 + } + m.move(direction) } - m.move(direction) } } |
