summaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2021-04-01 00:24:41 +1100
committerJesse Duffield <jessedduffield@gmail.com>2021-04-02 11:00:15 +1100
commitaf09223dd5cd50c5b2a2fe846632a7a0a6e02e1e (patch)
treed898ef987c4c553dce211deaa6ae9200c7a0f428 /pkg
parent7d62f103e4a1b39b7e8fbd0e1f39815c525cd588 (diff)
refactor
Diffstat (limited to 'pkg')
-rw-r--r--pkg/gui/gui.go7
-rw-r--r--pkg/gui/list_context.go5
2 files changed, 7 insertions, 5 deletions
diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go
index 671321d54..9fe5e4259 100644
--- a/pkg/gui/gui.go
+++ b/pkg/gui/gui.go
@@ -102,11 +102,6 @@ func (h *listPanelState) GetSelectedLineIdx() int {
return h.SelectedLineIdx
}
-type IListPanelState interface {
- SetSelectedLineIdx(int)
- GetSelectedLineIdx() int
-}
-
// for now the staging panel state, unlike the other panel states, is going to be
// non-mutative, so that we don't accidentally end up
// with mismatches of data. We might change this in the future
@@ -271,6 +266,8 @@ type guiStateMutexes struct {
}
type guiState struct {
+ // the file panels (files and commit files) can render as a tree, so we have
+ // managers for them which handle rendering a flat list of files in tree form
FileManager *filetree.FileManager
CommitFileManager *filetree.CommitFileManager
Submodules []*models.SubmoduleConfig
diff --git a/pkg/gui/list_context.go b/pkg/gui/list_context.go
index 39fa8f6bf..ac345dd97 100644
--- a/pkg/gui/list_context.go
+++ b/pkg/gui/list_context.go
@@ -30,6 +30,11 @@ type ListContext struct {
WindowName string
}
+type IListPanelState interface {
+ SetSelectedLineIdx(int)
+ GetSelectedLineIdx() int
+}
+
type ListItem interface {
// ID is a SHA when the item is a commit, a filename when the item is a file, 'stash@{4}' when it's a stash entry, 'my_branch' when it's a branch
ID() string