diff --git a/cmd/micro/actions.go b/cmd/micro/actions.go index 5eafcc08..2c37695b 100644 --- a/cmd/micro/actions.go +++ b/cmd/micro/actions.go @@ -1557,7 +1557,7 @@ func (v *View) Unsplit(usePlugin bool) bool { return false } - curView := tabs[curTab].curView + curView := tabs[curTab].CurView for i := len(tabs[curTab].views) - 1; i >= 0; i-- { view := tabs[curTab].views[i] if view != nil && view.Num != curView { @@ -1579,10 +1579,10 @@ func (v *View) NextSplit(usePlugin bool) bool { } tab := tabs[curTab] - if tab.curView < len(tab.views)-1 { - tab.curView++ + if tab.CurView < len(tab.views)-1 { + tab.CurView++ } else { - tab.curView = 0 + tab.CurView = 0 } if usePlugin { @@ -1598,10 +1598,10 @@ func (v *View) PreviousSplit(usePlugin bool) bool { } tab := tabs[curTab] - if tab.curView > 0 { - tab.curView-- + if tab.CurView > 0 { + tab.CurView-- } else { - tab.curView = len(tab.views) - 1 + tab.CurView = len(tab.views) - 1 } if usePlugin { diff --git a/cmd/micro/micro.go b/cmd/micro/micro.go index e9b4b757..27b16bf9 100644 --- a/cmd/micro/micro.go +++ b/cmd/micro/micro.go @@ -440,7 +440,7 @@ func main() { // is the one being clicked in for _, v := range tabs[curTab].views { if x >= v.x && x < v.x+v.Width && y >= v.y && y < v.y+v.Height { - tabs[curTab].curView = v.Num + tabs[curTab].CurView = v.Num } } } diff --git a/cmd/micro/split_tree.go b/cmd/micro/split_tree.go index 37a1a17b..60a431b4 100644 --- a/cmd/micro/split_tree.go +++ b/cmd/micro/split_tree.go @@ -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-- } } diff --git a/cmd/micro/tab.go b/cmd/micro/tab.go index 82e49a06..b9940707 100644 --- a/cmd/micro/tab.go +++ b/cmd/micro/tab.go @@ -12,7 +12,7 @@ type Tab struct { // multiple views with splits views []*View // This is the current view for this tab - curView int + CurView int // Generally this is the name of the current view's buffer name string @@ -73,7 +73,7 @@ func (t *Tab) Resize() { // CurView returns the current view func CurView() *View { curTab := tabs[curTab] - return curTab.views[curTab.curView] + return curTab.views[curTab.CurView] } // TabbarString returns the string that should be displayed in the tabbar @@ -89,7 +89,7 @@ func TabbarString() (string, map[int]int) { } else { str += " " } - str += t.views[t.curView].Buf.GetName() + str += t.views[t.CurView].Buf.GetName() if i == curTab { str += "]" } else { diff --git a/cmd/micro/view.go b/cmd/micro/view.go index 564c1dc2..f10cc8ff 100644 --- a/cmd/micro/view.go +++ b/cmd/micro/view.go @@ -778,7 +778,7 @@ func (v *View) DisplayView() { lineNumStyle = style } if style, ok := colorscheme["current-line-number"]; ok { - if curLineN == v.Cursor.Y && tabs[curTab].curView == v.Num && !v.Cursor.HasSelection() { + if curLineN == v.Cursor.Y && tabs[curTab].CurView == v.Num && !v.Cursor.HasSelection() { lineNumStyle = style } } @@ -816,7 +816,7 @@ func (v *View) DisplayView() { } } - if tabs[curTab].curView == v.Num && !v.Cursor.HasSelection() && v.Cursor.Y == curLineN && colN == v.Cursor.X { + if tabs[curTab].CurView == v.Num && !v.Cursor.HasSelection() && v.Cursor.Y == curLineN && colN == v.Cursor.X { v.DisplayCursor(screenX-v.leftCol, screenY) } @@ -842,7 +842,7 @@ func (v *View) DisplayView() { // We need to display the background of the linestyle with the correct color if cursorline is enabled // and this is the current view and there is no selection on this line and the cursor is on this line - if v.Buf.Settings["cursorline"].(bool) && tabs[curTab].curView == v.Num && !v.Cursor.HasSelection() && v.Cursor.Y == curLineN { + if v.Buf.Settings["cursorline"].(bool) && tabs[curTab].CurView == v.Num && !v.Cursor.HasSelection() && v.Cursor.Y == curLineN { if style, ok := colorscheme["cursor-line"]; ok { fg, _, _ := style.Decompose() lineStyle = lineStyle.Background(fg) @@ -868,7 +868,7 @@ func (v *View) DisplayView() { lineIndentStyle = style } } - if v.Buf.Settings["cursorline"].(bool) && tabs[curTab].curView == v.Num && !v.Cursor.HasSelection() && v.Cursor.Y == curLineN { + if v.Buf.Settings["cursorline"].(bool) && tabs[curTab].CurView == v.Num && !v.Cursor.HasSelection() && v.Cursor.Y == curLineN { if style, ok := colorscheme["cursor-line"]; ok { fg, _, _ := style.Decompose() lineIndentStyle = lineIndentStyle.Background(fg) @@ -910,7 +910,7 @@ func (v *View) DisplayView() { } // Here we are at a newline - if tabs[curTab].curView == v.Num && !v.Cursor.HasSelection() && v.Cursor.Y == curLineN && colN == v.Cursor.X { + if tabs[curTab].CurView == v.Num && !v.Cursor.HasSelection() && v.Cursor.Y == curLineN && colN == v.Cursor.X { v.DisplayCursor(screenX-v.leftCol, screenY) } @@ -933,7 +933,7 @@ func (v *View) DisplayView() { for i := 0; i < v.Width; i++ { lineStyle := defStyle - if v.Buf.Settings["cursorline"].(bool) && tabs[curTab].curView == v.Num && !v.Cursor.HasSelection() && v.Cursor.Y == curLineN { + if v.Buf.Settings["cursorline"].(bool) && tabs[curTab].CurView == v.Num && !v.Cursor.HasSelection() && v.Cursor.Y == curLineN { if style, ok := colorscheme["cursor-line"]; ok { fg, _, _ := style.Decompose() lineStyle = lineStyle.Background(fg)