possibility to show a log view

This commit is contained in:
boombuler
2016-09-26 19:08:37 +02:00
parent c1d08a6dc0
commit c1a3ee1706
5 changed files with 62 additions and 19 deletions

View File

@@ -11,6 +11,14 @@ import (
"github.com/zyedidia/tcell"
)
type ViewType int
const (
vtDefault ViewType = iota
vtHelp
vtLog
)
// The View struct stores information about a view into a buffer.
// It stores information about the cursor, and the viewport
// that the user sees the buffer from.
@@ -28,7 +36,7 @@ type View struct {
heightPercent int
// Specifies whether or not this view holds a help buffer
Help bool
Type ViewType
// Actual with and height
width int
@@ -536,11 +544,11 @@ func (v *View) openHelp(helpPage string) {
helpBuffer := NewBuffer(data, helpPage+".md")
helpBuffer.Name = "Help"
if v.Help {
if v.Type == vtHelp {
v.OpenBuffer(helpBuffer)
} else {
v.HSplit(helpBuffer)
CurView().Help = true
CurView().Type = vtHelp
}
}
}