diff options
author | Nomeji <nomeji@saucisseroyale.cc> | 2022-06-23 12:05:32 +0200 |
---|---|---|
committer | delthas <delthas@dille.cc> | 2022-07-22 17:50:50 +0200 |
commit | b75cb83397e32fc3bc8ead40f34efadafda6fb70 (patch) | |
tree | df3a9aedc19dab333fd054d40576ee47ca4c250a /app.go | |
parent | Fix dropping words in /msg, /query, /part (diff) |
Scroll to the channel when changing the horizontal channel
Previously, when running CTRL+N or CTRL+P to go to the next or previous
channel, with the horizontal channel mode, the selected channel could
appear offscreen.
This patch ensures that we scroll just enough to make the newly selected
chan visible.
Thanks to Nomeji for his hard work on this. Adapted slightly to
refactor existing code to use the newly created width computation
routine.
Diffstat (limited to 'app.go')
-rw-r--r-- | app.go | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -514,8 +514,10 @@ func (app *App) handleKeyEvent(ev *tcell.EventKey) { app.win.ScrollDown() case tcell.KeyCtrlN: app.win.NextBuffer() + app.win.HorizontalBufferScrollTo() case tcell.KeyCtrlP: app.win.PreviousBuffer() + app.win.HorizontalBufferScrollTo() case tcell.KeyRight: if ev.Modifiers() == tcell.ModAlt { app.win.NextBuffer() |