Forward resize event to both TabList and InfoBar (#3179)

InfoBar should really receive the resize event, to know the window width
in order to do horizontal scrolling of the command line when it doesn't
fit in the screen. Although currently it doesn't scroll the command line
at all (see issue #2527) and just ignores the resize event, but we
should fix that anyway, so let's forward the resize event to it.
This commit is contained in:
Dmytro Maluka
2024-03-21 21:40:22 +01:00
committed by GitHub
parent f15db6aa30
commit 9ab9f8bc1c
2 changed files with 6 additions and 1 deletions

View File

@@ -472,7 +472,10 @@ func DoEvent() {
}
_, resize := event.(*tcell.EventResize)
if action.InfoBar.HasPrompt && !resize {
if resize {
action.InfoBar.HandleEvent(event)
action.Tabs.HandleEvent(event)
} else if action.InfoBar.HasPrompt {
action.InfoBar.HandleEvent(event)
} else {
action.Tabs.HandleEvent(event)

View File

@@ -83,6 +83,8 @@ func (h *InfoPane) Close() {
func (h *InfoPane) HandleEvent(event tcell.Event) {
switch e := event.(type) {
case *tcell.EventResize:
// TODO
case *tcell.EventKey:
ke := KeyEvent{
code: e.Key(),