Introduce filtered list view model

We're going to start supporting filtering of list views
This commit is contained in:
Jesse Duffield 2023-05-27 14:14:43 +10:00
parent fd861826bc
commit a9e2c8129f
43 changed files with 798 additions and 232 deletions

View file

@ -292,7 +292,9 @@ func (self *ConfirmationHelper) ResizePopupPanel(v *gocui.View, content string)
}
func (self *ConfirmationHelper) resizeMenu() {
itemCount := self.c.Contexts().Menu.GetList().Len()
// we want the unfiltered length here so that if we're filtering we don't
// resize the window
itemCount := self.c.Contexts().Menu.UnfilteredLen()
offset := 3
panelWidth := self.getPopupPanelWidth()
x0, y0, x1, y1 := self.getPopupPanelDimensionsForContentHeight(panelWidth, itemCount+offset)