From 9ab9f8bc1cd74b0be82450785ecb3bfa9e02f3f7 Mon Sep 17 00:00:00 2001 From: Dmytro Maluka Date: Thu, 21 Mar 2024 21:40:22 +0100 Subject: [PATCH] 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. --- cmd/micro/micro.go | 5 ++++- internal/action/infopane.go | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/micro/micro.go b/cmd/micro/micro.go index 8be2bfbd..818c7027 100644 --- a/cmd/micro/micro.go +++ b/cmd/micro/micro.go @@ -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) diff --git a/internal/action/infopane.go b/internal/action/infopane.go index e1342ad9..a9baf431 100644 --- a/internal/action/infopane.go +++ b/internal/action/infopane.go @@ -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(),