Resize all open popup panels in layout, not just the topmost one

Probably not the most import feature in the world, but when resizing the
terminal window while multiple popup panels were open at the same time, we would
only resize the topmost one.

The main reason for changing this is because it makes the next commit easier to
implement.
This commit is contained in:
Stefan Haller 2024-06-25 19:25:46 +02:00
parent 1d502d3245
commit 1ab1fb3599
5 changed files with 25 additions and 11 deletions

View file

@ -315,16 +315,16 @@ func (self *ConfirmationHelper) getSelectedSuggestionValue() string {
return ""
}
func (self *ConfirmationHelper) ResizeCurrentPopupPanel() {
c := self.c.CurrentContext()
switch c {
case self.c.Contexts().Menu:
self.resizeMenu()
case self.c.Contexts().Confirmation, self.c.Contexts().Suggestions:
self.resizeConfirmationPanel()
case self.c.Contexts().CommitMessage, self.c.Contexts().CommitDescription:
self.ResizeCommitMessagePanels()
func (self *ConfirmationHelper) ResizeCurrentPopupPanels() {
for _, c := range self.c.CurrentPopupContexts() {
switch c {
case self.c.Contexts().Menu:
self.resizeMenu()
case self.c.Contexts().Confirmation, self.c.Contexts().Suggestions:
self.resizeConfirmationPanel()
case self.c.Contexts().CommitMessage, self.c.Contexts().CommitDescription:
self.ResizeCommitMessagePanels()
}
}
}