summary refs log tree commit diff stats
path: root/lib/ui/context.go
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-06-11 20:04:21 -0400
committerDrew DeVault <sir@cmpwn.com>2018-06-11 20:04:21 -0400
commit6728a11fdf863f7a33eb14e84421b828ab28c09f (patch)
treec9e1dcb85e34273b3f166f50a84e608aafe4e502 /lib/ui/context.go
parentd67c8a60ef9a326ba7e2ff0b5755d8eba629d4eb (diff)
downloadaerc-6728a11fdf863f7a33eb14e84421b828ab28c09f.tar.gz
Apply gofmt
Diffstat (limited to 'lib/ui/context.go')
-rw-r--r--lib/ui/context.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/ui/context.go b/lib/ui/context.go
index 1665819..d7796bf 100644
--- a/lib/ui/context.go
+++ b/lib/ui/context.go
@@ -3,9 +3,9 @@ package ui
 import (
 	"fmt"
 
-	"github.com/mattn/go-runewidth"
 	"github.com/gdamore/tcell"
 	"github.com/gdamore/tcell/views"
+	"github.com/mattn/go-runewidth"
 )
 
 // A context allows you to draw in a sub-region of the terminal
@@ -40,10 +40,10 @@ func NewContext(width, height int, screen tcell.Screen) *Context {
 
 func (ctx *Context) Subcontext(x, y, width, height int) *Context {
 	vp_width, vp_height := ctx.viewport.Size()
-	if (x < 0 || y < 0) {
+	if x < 0 || y < 0 {
 		panic(fmt.Errorf("Attempted to create context with negative offset"))
 	}
-	if (x + width > vp_width || y + height > vp_height) {
+	if x+width > vp_width || y+height > vp_height {
 		panic(fmt.Errorf("Attempted to create context larger than parent"))
 	}
 	vp := views.NewViewPort(ctx.viewport, x, y, width, height)
@@ -88,7 +88,7 @@ func (ctx *Context) Printf(x, y int, style tcell.Style,
 			crunes := []rune{}
 			ctx.viewport.SetContent(x, y, ch, crunes, style)
 			x += runewidth.RuneWidth(ch)
-			if x == old_x + width {
+			if x == old_x+width {
 				if !newline() {
 					return runewidth.StringWidth(str)
 				}