diff options
author | Liberatys <nick.flueckiger@renuo.ch> | 2021-08-03 22:44:43 +0200 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2021-08-25 20:13:50 +1000 |
commit | 6b68f4f25d3c717d8540ce7ac5b2ccf4b82e41e3 (patch) | |
tree | 30b6f2f4dc4a29177434ecad3ac0914269aa77cf /pkg/gui/files_panel.go | |
parent | 89ee0a1dee9101668cc4cb177aafc156faa5f35b (diff) |
Update as per review and add tests
Diffstat (limited to 'pkg/gui/files_panel.go')
-rw-r--r-- | pkg/gui/files_panel.go | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/pkg/gui/files_panel.go b/pkg/gui/files_panel.go index 59e0c6d88..ecaf52539 100644 --- a/pkg/gui/files_panel.go +++ b/pkg/gui/files_panel.go @@ -474,30 +474,28 @@ func (gui *Gui) handleCommitEditorPress() error { } func (gui *Gui) handleStatusFilterPressed() error { - menuItems := []*menuItem{} - - menuItems = append(menuItems, &menuItem{ - displayString: gui.Tr.FilterStagedFiles, - onPress: func() error { - return gui.setStatusFiltering(filetree.DisplayStaged) + menuItems := []*menuItem{ + { + displayString: gui.Tr.FilterStagedFiles, + onPress: func() error { + return gui.setStatusFiltering(filetree.DisplayStaged) + }, }, - }) - - menuItems = append(menuItems, &menuItem{ - displayString: gui.Tr.FilterUnstagedFiles, - onPress: func() error { - return gui.setStatusFiltering(filetree.DisplayUnstaged) + { + displayString: gui.Tr.FilterUnstagedFiles, + onPress: func() error { + return gui.setStatusFiltering(filetree.DisplayUnstaged) + }, }, - }) - - menuItems = append(menuItems, &menuItem{ - displayString: gui.Tr.ResetCommitFilterState, - onPress: func() error { - return gui.setStatusFiltering(filetree.DisplayAll) + { + displayString: gui.Tr.ResetCommitFilterState, + onPress: func() error { + return gui.setStatusFiltering(filetree.DisplayAll) + }, }, - }) + } - return gui.createMenu(gui.Tr.FilteringMenuTitle, menuItems, createMenuOptions{showCancel: false}) + return gui.createMenu(gui.Tr.FilteringMenuTitle, menuItems, createMenuOptions{showCancel: true }) } func (gui *Gui) setStatusFiltering(filter filetree.FileManagerDisplayFilter) error { |