Start working on splits

This commit is contained in:
Zachary Yedidia
2019-01-04 17:40:56 -05:00
parent d4c410f3dc
commit 541daf212e
9 changed files with 465 additions and 3 deletions

View File

@@ -48,6 +48,10 @@ func NewInfoWindow(b *info.InfoBuf) *InfoWindow {
return iw
}
func (i *InfoWindow) Resize(w, h int) {
i.width = w
}
// func (i *InfoWindow) YesNoPrompt() (bool, bool) {
// for {
// i.Clear()

View File

@@ -1,6 +1,7 @@
package display
import (
"log"
"strconv"
"unicode/utf8"
@@ -29,6 +30,7 @@ type Window interface {
GetView() *View
SetView(v *View)
GetMouseLoc(vloc buffer.Loc) buffer.Loc
Resize(w, h int)
}
// The BufWindow provides a way of displaying a certain section
@@ -65,6 +67,11 @@ func (v *View) SetView(view *View) {
v = view
}
func (w *BufWindow) Resize(width, height int) {
w.Width, w.Height = width, height
w.lineHeight = make([]int, height)
}
func (w *BufWindow) getStartInfo(n, lineN int) ([]byte, int, int, *tcell.Style) {
tabsize := util.IntOpt(w.Buf.Settings["tabsize"])
width := 0
@@ -431,6 +438,7 @@ func (w *BufWindow) displayBuffer() {
nColsBeforeStart--
}
log.Println(len(w.lineHeight), vloc.Y)
w.lineHeight[vloc.Y] = bloc.Y
totalwidth := w.StartCol - nColsBeforeStart