summaryrefslogtreecommitdiffstats
path: root/pkg/gui
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-09-29 18:45:00 +1000
committerJesse Duffield <jessedduffield@gmail.com>2020-09-29 20:48:49 +1000
commit8d2af5cc61c8bc94da6f608598ff27aead491c6a (patch)
tree7764922b2e44960788df83ecfa3bd69b491caebf /pkg/gui
parenteda4619a4f05b6720d091b31e60515f7289b9a47 (diff)
move file and submodule
Diffstat (limited to 'pkg/gui')
-rw-r--r--pkg/gui/custom_commands.go2
-rw-r--r--pkg/gui/discard_changes_menu_panel.go4
-rw-r--r--pkg/gui/file_watching.go4
-rw-r--r--pkg/gui/files_panel.go11
-rw-r--r--pkg/gui/gui.go6
-rw-r--r--pkg/gui/presentation/files.go6
6 files changed, 17 insertions, 16 deletions
diff --git a/pkg/gui/custom_commands.go b/pkg/gui/custom_commands.go
index c28528cac..67f90b36c 100644
--- a/pkg/gui/custom_commands.go
+++ b/pkg/gui/custom_commands.go
@@ -17,7 +17,7 @@ type CustomCommandObjects struct {
SelectedLocalCommit *models.Commit
SelectedReflogCommit *models.Commit
SelectedSubCommit *models.Commit
- SelectedFile *commands.File
+ SelectedFile *models.File
SelectedLocalBranch *models.Branch
SelectedRemoteBranch *models.RemoteBranch
SelectedRemote *models.Remote
diff --git a/pkg/gui/discard_changes_menu_panel.go b/pkg/gui/discard_changes_menu_panel.go
index 2c4e8f759..277f03062 100644
--- a/pkg/gui/discard_changes_menu_panel.go
+++ b/pkg/gui/discard_changes_menu_panel.go
@@ -2,10 +2,10 @@ package gui
import (
"github.com/jesseduffield/gocui"
- "github.com/jesseduffield/lazygit/pkg/commands"
+ "github.com/jesseduffield/lazygit/pkg/models"
)
-func (gui *Gui) submoduleFromFile(file *commands.File) *commands.SubmoduleConfig {
+func (gui *Gui) submoduleFromFile(file *models.File) *models.SubmoduleConfig {
for _, config := range gui.State.SubmoduleConfigs {
if config.Name == file.Name {
return config
diff --git a/pkg/gui/file_watching.go b/pkg/gui/file_watching.go
index 81a0c97fc..e503316b4 100644
--- a/pkg/gui/file_watching.go
+++ b/pkg/gui/file_watching.go
@@ -5,7 +5,7 @@ import (
"path/filepath"
"github.com/fsnotify/fsnotify"
- "github.com/jesseduffield/lazygit/pkg/commands"
+ "github.com/jesseduffield/lazygit/pkg/models"
"github.com/sirupsen/logrus"
)
@@ -73,7 +73,7 @@ func (w *fileWatcher) watchFilename(filename string) {
w.WatchedFilenames = append(w.WatchedFilenames, filename)
}
-func (w *fileWatcher) addFilesToFileWatcher(files []*commands.File) error {
+func (w *fileWatcher) addFilesToFileWatcher(files []*models.File) error {
if w.Disabled {
return nil
}
diff --git a/pkg/gui/files_panel.go b/pkg/gui/files_panel.go
index 26ec38bc5..4d4007a7b 100644
--- a/pkg/gui/files_panel.go
+++ b/pkg/gui/files_panel.go
@@ -14,13 +14,14 @@ import (
"github.com/jesseduffield/gocui"
"github.com/jesseduffield/lazygit/pkg/commands"
+ "github.com/jesseduffield/lazygit/pkg/models"
"github.com/jesseduffield/lazygit/pkg/utils"
"github.com/mgutz/str"
)
// list panel functions
-func (gui *Gui) getSelectedFile() *commands.File {
+func (gui *Gui) getSelectedFile() *models.File {
selectedLine := gui.State.Panels.Files.SelectedLineIdx
if selectedLine == -1 {
return nil
@@ -119,9 +120,9 @@ func (gui *Gui) refreshFiles() error {
// specific functions
-func (gui *Gui) stagedFiles() []*commands.File {
+func (gui *Gui) stagedFiles() []*models.File {
files := gui.State.Files
- result := make([]*commands.File, 0)
+ result := make([]*models.File, 0)
for _, file := range files {
if file.HasStagedChanges {
result = append(result, file)
@@ -130,9 +131,9 @@ func (gui *Gui) stagedFiles() []*commands.File {
return result
}
-func (gui *Gui) trackedFiles() []*commands.File {
+func (gui *Gui) trackedFiles() []*models.File {
files := gui.State.Files
- result := make([]*commands.File, 0, len(files))
+ result := make([]*models.File, 0, len(files))
for _, file := range files {
if file.Tracked {
result = append(result, file)
diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go
index 8d68612de..cdfa5d8b6 100644
--- a/pkg/gui/gui.go
+++ b/pkg/gui/gui.go
@@ -272,8 +272,8 @@ type Modes struct {
}
type guiState struct {
- Files []*commands.File
- SubmoduleConfigs []*commands.SubmoduleConfig
+ Files []*models.File
+ SubmoduleConfigs []*models.SubmoduleConfig
Branches []*models.Branch
Commits []*models.Commit
StashEntries []*commands.StashEntry
@@ -349,7 +349,7 @@ func (gui *Gui) resetState() {
}
gui.State = &guiState{
- Files: make([]*commands.File, 0),
+ Files: make([]*models.File, 0),
Commits: make([]*models.Commit, 0),
FilteredReflogCommits: make([]*models.Commit, 0),
ReflogCommits: make([]*models.Commit, 0),
diff --git a/pkg/gui/presentation/files.go b/pkg/gui/presentation/files.go
index f02aee91f..648b621b8 100644
--- a/pkg/gui/presentation/files.go
+++ b/pkg/gui/presentation/files.go
@@ -2,12 +2,12 @@ package presentation
import (
"github.com/fatih/color"
- "github.com/jesseduffield/lazygit/pkg/commands"
+ "github.com/jesseduffield/lazygit/pkg/models"
"github.com/jesseduffield/lazygit/pkg/theme"
"github.com/jesseduffield/lazygit/pkg/utils"
)
-func GetFileListDisplayStrings(files []*commands.File, diffName string, submoduleConfigs []*commands.SubmoduleConfig) [][]string {
+func GetFileListDisplayStrings(files []*models.File, diffName string, submoduleConfigs []*models.SubmoduleConfig) [][]string {
lines := make([][]string, len(files))
for i := range files {
@@ -19,7 +19,7 @@ func GetFileListDisplayStrings(files []*commands.File, diffName string, submodul
}
// getFileDisplayStrings returns the display string of branch
-func getFileDisplayStrings(f *commands.File, diffed bool, submoduleConfigs []*commands.SubmoduleConfig) []string {
+func getFileDisplayStrings(f *models.File, diffed bool, submoduleConfigs []*models.SubmoduleConfig) []string {
// potentially inefficient to be instantiating these color
// objects with each render
red := color.New(color.FgRed)