summaryrefslogtreecommitdiffstats
path: root/vendor/github.com
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com')
-rw-r--r--vendor/github.com/jesseduffield/gocui/edit.go2
-rw-r--r--vendor/github.com/jesseduffield/gocui/gui.go24
-rw-r--r--vendor/github.com/jesseduffield/gocui/view.go3
3 files changed, 28 insertions, 1 deletions
diff --git a/vendor/github.com/jesseduffield/gocui/edit.go b/vendor/github.com/jesseduffield/gocui/edit.go
index a5e6f690b..c339d75fb 100644
--- a/vendor/github.com/jesseduffield/gocui/edit.go
+++ b/vendor/github.com/jesseduffield/gocui/edit.go
@@ -114,8 +114,8 @@ func (v *View) EditDelete(back bool) {
func (v *View) EditNewLine() {
v.breakLine(v.cx, v.cy)
v.ox = 0
+ v.cy = v.cy + 1
v.cx = 0
- v.MoveCursor(0, 1, true)
}
// MoveCursor moves the cursor taking into account the width of the line/view,
diff --git a/vendor/github.com/jesseduffield/gocui/gui.go b/vendor/github.com/jesseduffield/gocui/gui.go
index 26ba79bd6..4393c06c4 100644
--- a/vendor/github.com/jesseduffield/gocui/gui.go
+++ b/vendor/github.com/jesseduffield/gocui/gui.go
@@ -476,6 +476,11 @@ func (g *Gui) flush() error {
return err
}
}
+ if v.Subtitle != "" {
+ if err := g.drawSubtitle(v, fgColor, bgColor); err != nil {
+ return err
+ }
+ }
}
if err := g.draw(v); err != nil {
return err
@@ -582,6 +587,25 @@ func (g *Gui) drawTitle(v *View, fgColor, bgColor Attribute) error {
return nil
}
+// drawSubtitle draws the subtitle of the view.
+func (g *Gui) drawSubtitle(v *View, fgColor, bgColor Attribute) error {
+ if v.y0 < 0 || v.y0 >= g.maxY {
+ return nil
+ }
+
+ start := v.x1 - 5 - len(v.Subtitle)
+ for i, ch := range v.Subtitle {
+ x := start + i
+ if x >= v.x1 {
+ break
+ }
+ if err := g.SetRune(x, v.y0, ch, fgColor, bgColor); err != nil {
+ return err
+ }
+ }
+ return nil
+}
+
// draw manages the cursor and calls the draw function of a view.
func (g *Gui) draw(v *View) error {
if g.Cursor {
diff --git a/vendor/github.com/jesseduffield/gocui/view.go b/vendor/github.com/jesseduffield/gocui/view.go
index 0dd897aa4..53ab06f8c 100644
--- a/vendor/github.com/jesseduffield/gocui/view.go
+++ b/vendor/github.com/jesseduffield/gocui/view.go
@@ -77,6 +77,9 @@ type View struct {
// If Frame is true, Title allows to configure a title for the view.
Title string
+ // If Frame is true, Subtitle allows to configure a subtitle for the view.
+ Subtitle string
+
// If Mask is true, the View will display the mask instead of the real
// content
Mask rune