1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

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

@ -132,20 +132,6 @@ func (gui *Gui) layout(g *gocui.Gui) error {
}
view.SelBgColor = theme.GocuiSelectedLineBgColor
// I doubt this is expensive though it's admittedly redundant after the first render
view.SetOnSelectItem(gui.onSelectItemWrapper(listContext.OnSearchSelect))
}
for _, context := range gui.c.Context().AllPatchExplorer() {
context := context
context.GetView().SetOnSelectItem(gui.onSelectItemWrapper(
func(selectedLineIdx int) error {
context.GetMutex().Lock()
defer context.GetMutex().Unlock()
return context.NavigateTo(gui.c.IsCurrentContext(context), selectedLineIdx)
}),
)
}
mainViewWidth, mainViewHeight := gui.Views.Main.Size()