Rename Gui.ShowCursor to Gui.Cursor for consistency

This commit is contained in:
Roi Martin 2016-01-26 09:55:08 +01:00
parent 260872b0f7
commit ea4d0466c4
4 changed files with 6 additions and 6 deletions

View File

@ -201,7 +201,7 @@ func main() {
}
g.SelBgColor = gocui.ColorGreen
g.SelFgColor = gocui.ColorBlack
g.ShowCursor = true
g.Cursor = true
err = g.MainLoop()
if err != nil && err != gocui.ErrQuit {

View File

@ -26,7 +26,7 @@ func main() {
}
g.SelBgColor = gocui.ColorGreen
g.SelFgColor = gocui.ColorBlack
g.ShowCursor = true
g.Cursor = true
g.Mouse = true
err = g.MainLoop()

View File

@ -25,7 +25,7 @@ func main() {
if err := initKeybindings(g); err != nil {
log.Fatalln(err)
}
g.ShowCursor = true
g.Cursor = true
err := g.MainLoop()
if err != nil && err != gocui.ErrQuit {

6
gui.go
View File

@ -45,8 +45,8 @@ type Gui struct {
// foreground colors of the selected line, when it is highlighted.
SelBgColor, SelFgColor Attribute
// If ShowCursor is true then the cursor is enabled.
ShowCursor bool
// If Cursor is true then the cursor is enabled.
Cursor bool
// If Mouse is true then mouse events will be enabled.
Mouse bool
@ -375,7 +375,7 @@ func (g *Gui) drawFrame(v *View) error {
// draw manages the cursor and calls the draw function of a view.
func (g *Gui) draw(v *View) error {
if g.ShowCursor {
if g.Cursor {
if v := g.currentView; v != nil {
maxX, maxY := v.Size()
cx, cy := v.cx, v.cy