Apply gofmt
This commit is contained in:
parent
d67c8a60ef
commit
6728a11fdf
|
@ -3,9 +3,9 @@ package ui
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/mattn/go-runewidth"
|
|
||||||
"github.com/gdamore/tcell"
|
"github.com/gdamore/tcell"
|
||||||
"github.com/gdamore/tcell/views"
|
"github.com/gdamore/tcell/views"
|
||||||
|
"github.com/mattn/go-runewidth"
|
||||||
)
|
)
|
||||||
|
|
||||||
// A context allows you to draw in a sub-region of the terminal
|
// 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 {
|
func (ctx *Context) Subcontext(x, y, width, height int) *Context {
|
||||||
vp_width, vp_height := ctx.viewport.Size()
|
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"))
|
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"))
|
panic(fmt.Errorf("Attempted to create context larger than parent"))
|
||||||
}
|
}
|
||||||
vp := views.NewViewPort(ctx.viewport, x, y, width, height)
|
vp := views.NewViewPort(ctx.viewport, x, y, width, height)
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package ui
|
package ui
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/mattn/go-runewidth"
|
|
||||||
"github.com/gdamore/tcell"
|
"github.com/gdamore/tcell"
|
||||||
|
"github.com/mattn/go-runewidth"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package widgets
|
package widgets
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/mattn/go-runewidth"
|
|
||||||
"github.com/gdamore/tcell"
|
"github.com/gdamore/tcell"
|
||||||
|
"github.com/mattn/go-runewidth"
|
||||||
|
|
||||||
"git.sr.ht/~sircmpwn/aerc2/lib/ui"
|
"git.sr.ht/~sircmpwn/aerc2/lib/ui"
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue