summaryrefslogtreecommitdiffstats
path: root/pkg/gui/gui.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-10-02 07:56:14 +1000
committerJesse Duffield <jessedduffield@gmail.com>2020-10-10 00:23:01 +1100
commit2e05ac0c90848c71ab23728859a7bd4b67c39114 (patch)
tree936571f345de7b87ebbcc2025d29c04fc1e9d129 /pkg/gui/gui.go
parent40c5cd4b4b3436da2616e848d40e7760ec99167f (diff)
paging keybindings for line by line panel
support searching in line by line panel move mutexes into their own struct add line by line panel mutex apply LBL panel mutex bump gocui to prevent crashing when search item count decreases
Diffstat (limited to 'pkg/gui/gui.go')
-rw-r--r--pkg/gui/gui.go53
1 files changed, 29 insertions, 24 deletions
diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go
index c1df0ee93..ce3546c74 100644
--- a/pkg/gui/gui.go
+++ b/pkg/gui/gui.go
@@ -285,6 +285,14 @@ type Modes struct {
Diffing Diffing
}
+type guiStateMutexes struct {
+ RefreshingFilesMutex sync.Mutex
+ RefreshingStatusMutex sync.Mutex
+ FetchMutex sync.Mutex
+ BranchCommitsMutex sync.Mutex
+ LineByLinePanelMutex sync.Mutex
+}
+
type guiState struct {
Files []*models.File
Submodules []*models.SubmoduleConfig
@@ -298,30 +306,27 @@ type guiState struct {
// ReflogCommits are the ones used by the branches panel to obtain recency values
// if we're not in filtering mode, CommitFiles and FilteredReflogCommits will be
// one and the same
- ReflogCommits []*models.Commit
- SubCommits []*models.Commit
- Remotes []*models.Remote
- RemoteBranches []*models.RemoteBranch
- Tags []*models.Tag
- MenuItems []*menuItem
- Updating bool
- Panels *panelStates
- MainContext string // used to keep the main and secondary views' contexts in sync
- SplitMainPanel bool
- RetainOriginalDir bool
- IsRefreshingFiles bool
- RefreshingFilesMutex sync.Mutex
- RefreshingStatusMutex sync.Mutex
- FetchMutex sync.Mutex
- BranchCommitsMutex sync.Mutex
- Searching searchingState
- ScreenMode int
- SideView *gocui.View
- Ptmx *os.File
- PrevMainWidth int
- PrevMainHeight int
- OldInformation string
- StartupStage int // one of INITIAL and COMPLETE. Allows us to not load everything at once
+ ReflogCommits []*models.Commit
+ SubCommits []*models.Commit
+ Remotes []*models.Remote
+ RemoteBranches []*models.RemoteBranch
+ Tags []*models.Tag
+ MenuItems []*menuItem
+ Updating bool
+ Panels *panelStates
+ MainContext string // used to keep the main and secondary views' contexts in sync
+ SplitMainPanel bool
+ RetainOriginalDir bool
+ IsRefreshingFiles bool
+ Mutexes guiStateMutexes
+ Searching searchingState
+ ScreenMode int
+ SideView *gocui.View
+ Ptmx *os.File
+ PrevMainWidth int
+ PrevMainHeight int
+ OldInformation string
+ StartupStage int // one of INITIAL and COMPLETE. Allows us to not load everything at once
Modes Modes