diff options
author | Dawid Dziurla <dawidd0811@gmail.com> | 2018-09-09 10:39:08 +0200 |
---|---|---|
committer | Dawid Dziurla <dawidd0811@gmail.com> | 2018-09-09 10:41:01 +0200 |
commit | 6f7de83bcee20ab14556b95041695b959dfb407b (patch) | |
tree | ebedfd0baaa505965bba3efba91e561c679a90b3 /vendor/github.com | |
parent | e80371fc6f1dbbf826fcf97626eaa4bc445736f9 (diff) | |
parent | 5af03b68206fcfe1a22a9a4c74d730d2b1b13603 (diff) |
Merge branch 'master' into feature/help
conflicts resolved
Diffstat (limited to 'vendor/github.com')
-rw-r--r-- | vendor/github.com/jesseduffield/gocui/edit.go | 2 | ||||
-rw-r--r-- | vendor/github.com/jesseduffield/gocui/gui.go | 24 | ||||
-rw-r--r-- | vendor/github.com/jesseduffield/gocui/view.go | 3 |
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 |