]> git.lizzy.rs Git - micro.git/blobdiff - cmd/micro/split_tree.go
Fix: mouse clicking with softwrap
[micro.git] / cmd / micro / split_tree.go
index 5f2b3edb9f76d5a11a07a794a657b0694fcff518..60a431b4938b3a335fec872f479a7cb89693db0e 100644 (file)
@@ -74,7 +74,7 @@ func (l *LeafNode) VSplit(buf *Buffer, splitIndex int) {
                copy(tab.views[splitIndex+1:], tab.views[splitIndex:])
                tab.views[splitIndex] = newView
 
-               tab.curView = splitIndex
+               tab.CurView = splitIndex
        } else {
                if splitIndex > 1 {
                        splitIndex = 1
@@ -98,7 +98,7 @@ func (l *LeafNode) VSplit(buf *Buffer, splitIndex int) {
                copy(tab.views[splitIndex+1:], tab.views[splitIndex:])
                tab.views[splitIndex] = newView
 
-               tab.curView = splitIndex
+               tab.CurView = splitIndex
        }
 
        tab.Resize()
@@ -127,7 +127,7 @@ func (l *LeafNode) HSplit(buf *Buffer, splitIndex int) {
                copy(tab.views[splitIndex+1:], tab.views[splitIndex:])
                tab.views[splitIndex] = newView
 
-               tab.curView = splitIndex
+               tab.CurView = splitIndex
        } else {
                if splitIndex > 1 {
                        splitIndex = 1
@@ -152,7 +152,7 @@ func (l *LeafNode) HSplit(buf *Buffer, splitIndex int) {
                copy(tab.views[splitIndex+1:], tab.views[splitIndex:])
                tab.views[splitIndex] = newView
 
-               tab.curView = splitIndex
+               tab.CurView = splitIndex
        }
 
        tab.Resize()
@@ -175,8 +175,8 @@ func (l *LeafNode) Delete() {
        for i, v := range tab.views {
                v.Num = i
        }
-       if tab.curView > 0 {
-               tab.curView--
+       if tab.CurView > 0 {
+               tab.CurView--
        }
 }
 
@@ -204,13 +204,13 @@ func (s *SplitTree) ResizeSplits() {
        for _, node := range s.children {
                if n, ok := node.(*LeafNode); ok {
                        if s.kind == VerticalSplit {
-                               if n.view.lockWidth {
-                                       lockedWidth += n.view.width
+                               if n.view.LockWidth {
+                                       lockedWidth += n.view.Width
                                        lockedChildren++
                                }
                        } else {
-                               if n.view.lockHeight {
-                                       lockedHeight += n.view.height
+                               if n.view.LockHeight {
+                                       lockedHeight += n.view.Height
                                        lockedChildren++
                                }
                        }
@@ -232,26 +232,26 @@ func (s *SplitTree) ResizeSplits() {
        for _, node := range s.children {
                if n, ok := node.(*LeafNode); ok {
                        if s.kind == VerticalSplit {
-                               if !n.view.lockWidth {
-                                       n.view.width = (s.width - lockedWidth) / (len(s.children) - lockedChildren)
+                               if !n.view.LockWidth {
+                                       n.view.Width = (s.width - lockedWidth) / (len(s.children) - lockedChildren)
                                }
-                               n.view.height = s.height
+                               n.view.Height = s.height
 
                                n.view.x = s.x + x
                                n.view.y = s.y
-                               x += n.view.width
+                               x += n.view.Width
                        } else {
-                               if !n.view.lockHeight {
-                                       n.view.height = (s.height - lockedHeight) / (len(s.children) - lockedChildren)
+                               if !n.view.LockHeight {
+                                       n.view.Height = (s.height - lockedHeight) / (len(s.children) - lockedChildren)
                                }
-                               n.view.width = s.width
+                               n.view.Width = s.width
 
                                n.view.y = s.y + y
                                n.view.x = s.x
-                               y += n.view.height
+                               y += n.view.Height
                        }
                        if n.view.Buf.Settings["statusline"].(bool) {
-                               n.view.height--
+                               n.view.Height--
                        }
 
                        n.view.ToggleTabbar()