summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md14
-rw-r--r--go.mod2
-rw-r--r--go.sum4
-rw-r--r--pkg/gui/presentation/files.go20
-rw-r--r--pkg/gui/presentation/files_test.go24
-rw-r--r--vendor/github.com/jesseduffield/gocui/view.go6
-rw-r--r--vendor/modules.txt2
7 files changed, 35 insertions, 37 deletions
diff --git a/README.md b/README.md
index f434cb4d1..69ca631e0 100644
--- a/README.md
+++ b/README.md
@@ -4,9 +4,9 @@
![CI](https://github.com/jesseduffield/lazygit/workflows/Continuous%20Integration/badge.svg) [![Go Report Card](https://goreportcard.com/badge/github.com/jesseduffield/lazygit)](https://goreportcard.com/report/github.com/jesseduffield/lazygit) [![GoDoc](https://godoc.org/github.com/jesseduffield/lazygit?status.svg)](https://godoc.org/github.com/jesseduffield/lazygit) [![GitHub tag](https://img.shields.io/github/tag/jesseduffield/lazygit.svg)](https://github.com/jesseduffield/lazygit/releases) [![TODOs](https://badgen.net/https/api.tickgit.com/badgen/github.com/jesseduffield/lazygit)](https://www.tickgit.com/browse?repo=github.com/jesseduffield/lazygit)
-A simple terminal UI for git commands, written in Go with the [gocui](https://github.com/jroimartin/gocui "gocui") library.
+A simple terminal UI for git commands, written in Go with the [gocui](https://github.com/jroimartin/gocui 'gocui') library.
-Rant time: You've heard it before, git is _powerful_, but what good is that power when everything is so damn hard to do? Interactive rebasing requires you to edit a goddamn TODO file in your editor? *Are you kidding me?* To stage part of a file you need to use a command line program to step through each hunk and if a hunk can't be split down any further but contains code you don't want to stage, you have to edit an arcane patch file _by hand_? *Are you KIDDING me?!* Sometimes you get asked to stash your changes when switching branches only to realise that after you switch and unstash that there weren't even any conflicts and it would have been fine to just checkout the branch directly? *YOU HAVE GOT TO BE KIDDING ME!*
+Rant time: You've heard it before, git is _powerful_, but what good is that power when everything is so damn hard to do? Interactive rebasing requires you to edit a goddamn TODO file in your editor? _Are you kidding me?_ To stage part of a file you need to use a command line program to step through each hunk and if a hunk can't be split down any further but contains code you don't want to stage, you have to edit an arcane patch file _by hand_? _Are you KIDDING me?!_ Sometimes you get asked to stash your changes when switching branches only to realise that after you switch and unstash that there weren't even any conflicts and it would have been fine to just checkout the branch directly? _YOU HAVE GOT TO BE KIDDING ME!_
If you're a mere mortal like me and you're tired of hearing how powerful git is when in your daily life it's a powerful pain in your ass, lazygit might be for you.
@@ -288,15 +288,11 @@ If you would like to support the development of lazygit, consider [sponsoring me
## FAQ
-### I'm struggling to see the selected line
-
-See [here](https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#struggling-to-see-selected-line)
-
### What do the commit colors represent?
-* Green: the commit is included in the master branch
-* Yellow: the commit is not included in the master branch
-* Red: the commit has not been pushed to the upstream branch
+- Green: the commit is included in the master branch
+- Yellow: the commit is not included in the master branch
+- Red: the commit has not been pushed to the upstream branch
## Shameless Plug
diff --git a/go.mod b/go.mod
index 5648ad1e7..f53f2645e 100644
--- a/go.mod
+++ b/go.mod
@@ -16,7 +16,7 @@ require (
github.com/integrii/flaggy v1.4.0
github.com/jesseduffield/generics v0.0.0-20220320043834-727e535cbe68
github.com/jesseduffield/go-git/v5 v5.1.2-0.20201006095850-341962be15a4
- github.com/jesseduffield/gocui v0.3.1-0.20220415000211-a826601ada29
+ github.com/jesseduffield/gocui v0.3.1-0.20220415005542-2eb424ce3d0a
github.com/jesseduffield/minimal/gitignore v0.3.3-0.20211018110810-9cde264e6b1e
github.com/jesseduffield/yaml v2.1.0+incompatible
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0
diff --git a/go.sum b/go.sum
index c37412de0..7dbd3f1b8 100644
--- a/go.sum
+++ b/go.sum
@@ -70,8 +70,8 @@ github.com/jesseduffield/generics v0.0.0-20220320043834-727e535cbe68 h1:EQP2Tv8T
github.com/jesseduffield/generics v0.0.0-20220320043834-727e535cbe68/go.mod h1:+LLj9/WUPAP8LqCchs7P+7X0R98HiFujVFANdNaxhGk=
github.com/jesseduffield/go-git/v5 v5.1.2-0.20201006095850-341962be15a4 h1:GOQrmaE8i+KEdB8NzAegKYd4tPn/inM0I1uo0NXFerg=
github.com/jesseduffield/go-git/v5 v5.1.2-0.20201006095850-341962be15a4/go.mod h1:nGNEErzf+NRznT+N2SWqmHnDnF9aLgANB1CUNEan09o=
-github.com/jesseduffield/gocui v0.3.1-0.20220415000211-a826601ada29 h1:2U/L4Z2gs0rRc6cSqT9UmHKME9rFaoHsOM3SWFE0uo4=
-github.com/jesseduffield/gocui v0.3.1-0.20220415000211-a826601ada29/go.mod h1:znJuCDnF2Ph40YZSlBwdX/4GEofnIoWLGdT4mK5zRAU=
+github.com/jesseduffield/gocui v0.3.1-0.20220415005542-2eb424ce3d0a h1:Fd8B7eZJfwK0cFzqz2gEFLEDiY0iwJTm6oBbPRHONxA=
+github.com/jesseduffield/gocui v0.3.1-0.20220415005542-2eb424ce3d0a/go.mod h1:znJuCDnF2Ph40YZSlBwdX/4GEofnIoWLGdT4mK5zRAU=
github.com/jesseduffield/minimal/gitignore v0.3.3-0.20211018110810-9cde264e6b1e h1:uw/oo+kg7t/oeMs6sqlAwr85ND/9cpO3up3VxphxY0U=
github.com/jesseduffield/minimal/gitignore v0.3.3-0.20211018110810-9cde264e6b1e/go.mod h1:u60qdFGXRd36jyEXxetz0vQceQIxzI13lIo3EFUDf4I=
github.com/jesseduffield/yaml v2.1.0+incompatible h1:HWQJ1gIv2zHKbDYNp0Jwjlj24K8aqpFHnMCynY1EpmE=
diff --git a/pkg/gui/presentation/files.go b/pkg/gui/presentation/files.go
index 3f4e34f14..b095975ad 100644
--- a/pkg/gui/presentation/files.go
+++ b/pkg/gui/presentation/files.go
@@ -1,7 +1,6 @@
package presentation
import (
- "fmt"
"strings"
"github.com/jesseduffield/lazygit/pkg/commands/models"
@@ -17,11 +16,12 @@ const (
COLLAPSED_ARROW = "►"
)
+// keeping these here as individual constants in case later on people want the old tree shape
const (
- INNER_ITEM = "├─ "
- LAST_ITEM = "└─ "
- NESTED = "│ "
- NOTHING = " "
+ INNER_ITEM = " "
+ LAST_ITEM = " "
+ NESTED = " "
+ NOTHING = " "
)
func RenderFileTree(
@@ -77,24 +77,20 @@ func renderAux(
isRoot := depth == -1
- renderLineWithPrefix := func() string {
- return prefix + renderLine(s, depth)
- }
-
if s.IsLeaf() {
if isRoot {
return []string{}
}
- return []string{renderLineWithPrefix()}
+ return []string{prefix + renderLine(s, depth)}
}
if collapsedPaths.IsCollapsed(s.GetPath()) {
- return []string{fmt.Sprintf("%s %s", renderLineWithPrefix(), COLLAPSED_ARROW)}
+ return []string{prefix + COLLAPSED_ARROW + " " + renderLine(s, depth)}
}
arr := []string{}
if !isRoot {
- arr = append(arr, fmt.Sprintf("%s %s", renderLineWithPrefix(), EXPANDED_ARROW))
+ arr = append(arr, prefix+EXPANDED_ARROW+" "+renderLine(s, depth))
}
newPrefix := prefix
diff --git a/pkg/gui/presentation/files_test.go b/pkg/gui/presentation/files_test.go
index 5f475b3fe..17e061012 100644
--- a/pkg/gui/presentation/files_test.go
+++ b/pkg/gui/presentation/files_test.go
@@ -53,12 +53,12 @@ func TestRenderFileTree(t *testing.T) {
},
expected: toStringSlice(
`
-dir1 ►
-dir2 ▼
-├─ dir2 ▼
-│ ├─ M file3
-│ └─ M file4
-└─ M file5
+► dir1
+▼ dir2
+ ▼ dir2
+ M file3
+ M file4
+ M file5
M file1
`,
),
@@ -112,12 +112,12 @@ func TestRenderCommitFileTree(t *testing.T) {
},
expected: toStringSlice(
`
-dir1 ►
-dir2 ▼
-├─ dir2 ▼
-│ ├─ D file3
-│ └─ M file4
-└─ M file5
+► dir1
+▼ dir2
+ ▼ dir2
+ D file3
+ M file4
+ M file5
M file1
`,
),
diff --git a/vendor/github.com/jesseduffield/gocui/view.go b/vendor/github.com/jesseduffield/gocui/view.go
index cb735bd73..d2c2b75f1 100644
--- a/vendor/github.com/jesseduffield/gocui/view.go
+++ b/vendor/github.com/jesseduffield/gocui/view.go
@@ -922,6 +922,7 @@ func (v *View) draw() error {
y := 0
emptyCell := cell{chr: ' ', fgColor: ColorDefault, bgColor: ColorDefault}
+ var prevFgColor Attribute
for _, vline := range v.viewLines[start:] {
if y >= maxY {
break
@@ -940,8 +941,13 @@ func (v *View) draw() error {
if j > len(vline.line)-1 {
c = emptyCell
+ c.fgColor = prevFgColor
} else {
c = vline.line[j]
+ // capturing previous foreground colour so that if we're using the reverse
+ // attribute we honour the final character's colour and don't awkwardly switch
+ // to a new background colour for the remainder of the line
+ prevFgColor = c.fgColor
}
fgColor := c.fgColor
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 56d9fc240..a7f378b45 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -169,7 +169,7 @@ github.com/jesseduffield/go-git/v5/utils/merkletrie/filesystem
github.com/jesseduffield/go-git/v5/utils/merkletrie/index
github.com/jesseduffield/go-git/v5/utils/merkletrie/internal/frame
github.com/jesseduffield/go-git/v5/utils/merkletrie/noder
-# github.com/jesseduffield/gocui v0.3.1-0.20220415000211-a826601ada29
+# github.com/jesseduffield/gocui v0.3.1-0.20220415005542-2eb424ce3d0a
## explicit; go 1.12
github.com/jesseduffield/gocui
# github.com/jesseduffield/minimal/gitignore v0.3.3-0.20211018110810-9cde264e6b1e