forked from sloum/bombadillo
Ran go fmt to clean up formating issues
This commit is contained in:
parent
63df316b96
commit
55d163ce5b
|
@ -21,7 +21,7 @@ type Window struct {
|
||||||
drawBox bool
|
drawBox bool
|
||||||
Active bool
|
Active bool
|
||||||
Show bool
|
Show bool
|
||||||
tempContentLen int
|
tempContentLen int
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *Window) DrawWindow() {
|
func (w *Window) DrawWindow() {
|
||||||
|
@ -66,10 +66,10 @@ func (w *Window) DrawContent() {
|
||||||
width := w.Box.Col2 - w.Box.Col1 + borderThickness
|
width := w.Box.Col2 - w.Box.Col1 + borderThickness
|
||||||
|
|
||||||
content := wrapLines(w.Content, width)
|
content := wrapLines(w.Content, width)
|
||||||
w.tempContentLen = len(content)
|
w.tempContentLen = len(content)
|
||||||
|
|
||||||
if w.Scrollposition > w.tempContentLen-height {
|
if w.Scrollposition > w.tempContentLen-height {
|
||||||
w.Scrollposition = w.tempContentLen-height
|
w.Scrollposition = w.tempContentLen - height
|
||||||
if w.Scrollposition < 0 {
|
if w.Scrollposition < 0 {
|
||||||
w.Scrollposition = 0
|
w.Scrollposition = 0
|
||||||
}
|
}
|
||||||
|
@ -134,7 +134,7 @@ func (w *Window) PageDown() {
|
||||||
if w.Scrollposition < w.tempContentLen-height {
|
if w.Scrollposition < w.tempContentLen-height {
|
||||||
w.Scrollposition += height
|
w.Scrollposition += height
|
||||||
if w.Scrollposition > w.tempContentLen-height {
|
if w.Scrollposition > w.tempContentLen-height {
|
||||||
w.Scrollposition = w.tempContentLen-height
|
w.Scrollposition = w.tempContentLen - height
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fmt.Print("\a")
|
fmt.Print("\a")
|
||||||
|
@ -180,7 +180,7 @@ func (w *Window) ScrollEnd() {
|
||||||
height := w.Box.Row2 - w.Box.Row1 + borderThickness
|
height := w.Box.Row2 - w.Box.Row1 + borderThickness
|
||||||
|
|
||||||
if w.Scrollposition < w.tempContentLen-height {
|
if w.Scrollposition < w.tempContentLen-height {
|
||||||
w.Scrollposition = w.tempContentLen-height
|
w.Scrollposition = w.tempContentLen - height
|
||||||
} else {
|
} else {
|
||||||
fmt.Print("\a")
|
fmt.Print("\a")
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,7 +83,6 @@ func MakeUrl(u string) (Url, error) {
|
||||||
out.IsBinary = true
|
out.IsBinary = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
out.Full = out.Scheme + "://" + out.Host + ":" + out.Port + "/" + out.Gophertype + out.Resource
|
out.Full = out.Scheme + "://" + out.Host + ":" + out.Port + "/" + out.Gophertype + out.Resource
|
||||||
|
|
||||||
return out, nil
|
return out, nil
|
||||||
|
|
8
main.go
8
main.go
|
@ -456,9 +456,9 @@ func initClient() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func handleResize() {
|
func handleResize() {
|
||||||
oldh, oldw := screen.Height, screen.Width
|
oldh, oldw := screen.Height, screen.Width
|
||||||
screen.GetSize()
|
screen.GetSize()
|
||||||
if screen.Height != oldh || screen.Width != oldw {
|
if screen.Height != oldh || screen.Width != oldw {
|
||||||
screen.Windows[0].Box.Row2 = screen.Height - 2
|
screen.Windows[0].Box.Row2 = screen.Height - 2
|
||||||
screen.Windows[0].Box.Col2 = screen.Width
|
screen.Windows[0].Box.Col2 = screen.Width
|
||||||
bookmarksWidth := 40
|
bookmarksWidth := 40
|
||||||
|
@ -471,7 +471,7 @@ func handleResize() {
|
||||||
|
|
||||||
screen.DrawAllWindows()
|
screen.DrawAllWindows()
|
||||||
screen.DrawMsgBars()
|
screen.DrawMsgBars()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
Loading…
Reference in New Issue