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

@@ -90,6 +90,8 @@ type BufHandler struct {
// Last search stores the last successful search for FindNext and FindPrev
lastSearch string
splitID uint64
}
func NewBufHandler(buf *buffer.Buffer, win display.Window) *BufHandler {
@@ -212,6 +214,19 @@ func (h *BufHandler) DoRuneInsert(r rune) {
}
}
func (h *BufHandler) vsplit(buf *buffer.Buffer) {
e := NewBufEditPane(0, 0, 0, 0, buf)
e.splitID = MainTab.GetNode(h.splitID).VSplit(h.Buf.Settings["splitright"].(bool))
MainTab.Panes = append(MainTab.Panes, e)
MainTab.Resize()
}
func (h *BufHandler) hsplit(buf *buffer.Buffer) {
e := NewBufEditPane(0, 0, 0, 0, buf)
e.splitID = MainTab.GetNode(h.splitID).HSplit(h.Buf.Settings["splitbottom"].(bool))
MainTab.Panes = append(MainTab.Panes, e)
MainTab.Resize()
}
// BufKeyActions contains the list of all possible key actions the bufhandler could execute
var BufKeyActions = map[string]BufKeyAction{
"CursorUp": (*BufHandler).CursorUp,