Fix redrawing for splits

This commit is contained in:
Zachary Yedidia
2016-06-26 16:18:33 -04:00
parent 9b9ae89e59
commit 7e0286b621
3 changed files with 8 additions and 7 deletions

View File

@@ -174,11 +174,11 @@ func InitScreen() {
// RedrawAll redraws everything -- all the views and the messenger
func RedrawAll() {
messenger.Clear()
DisplayTabs()
messenger.Display()
for _, v := range tabs[curTab].views {
v.Display()
}
DisplayTabs()
messenger.Display()
screen.Show()
}

View File

@@ -48,13 +48,14 @@ func (sline *Statusline) Display() {
// Maybe there is a unicode filename?
fileRunes := []rune(file)
viewX := sline.view.x
for x := 0; x < sline.view.width; x++ {
if x < len(fileRunes) {
screen.SetContent(x, y, fileRunes[x], nil, statusLineStyle)
screen.SetContent(viewX+x, y, fileRunes[x], nil, statusLineStyle)
} else if x >= sline.view.width-len(rightText) && x < len(rightText)+sline.view.width-len(rightText) {
screen.SetContent(x, y, []rune(rightText)[x-sline.view.width+len(rightText)], nil, statusLineStyle)
screen.SetContent(viewX+x, y, []rune(rightText)[x-sline.view.width+len(rightText)], nil, statusLineStyle)
} else {
screen.SetContent(x, y, ' ', nil, statusLineStyle)
screen.SetContent(viewX+x, y, ' ', nil, statusLineStyle)
}
}
}

View File

@@ -502,7 +502,7 @@ func (v *View) DisplayView() {
// If the buffer is smaller than the view height
if lineN+v.Topline >= v.Buf.NumLines {
// We have to clear all this space
for i := 0; i < v.width; i++ {
for i := v.x; i < v.width; i++ {
screen.SetContent(i, lineN+v.y, ' ', nil, defStyle)
}
@@ -677,7 +677,7 @@ func (v *View) DisplayView() {
charNum = charNum.Move(1, v.Buf)
for i := 0; i < v.width-(x-v.leftCol); i++ {
for i := 0; i < v.width-((x-v.x)-v.leftCol); i++ {
lineStyle := defStyle
if settings["cursorline"].(bool) && !v.Cursor.HasSelection() && v.Cursor.Y == lineN+v.Topline {
if style, ok := colorscheme["cursor-line"]; ok {