Fix glitch with bottomline when softwrap is disabled

This commit is contained in:
Zachary Yedidia
2016-10-12 16:30:32 -04:00
parent e30a4139e6
commit edd25c68ee

View File

@@ -615,6 +615,7 @@ func (v *View) DisplayView() {
screenX, screenY := v.x, v.y-1
highlightStyle := defStyle
curLineN := 0
// ViewLine is the current line from the top of the viewport
for viewLine := 0; viewLine < v.height; viewLine++ {
@@ -622,10 +623,9 @@ func (v *View) DisplayView() {
screenX = v.x
// This is the current line number of the buffer that we are drawing
curLineN := viewLine + v.Topline
curLineN = viewLine + v.Topline
if screenY >= v.height {
v.Bottomline = curLineN
break
}
@@ -872,6 +872,10 @@ func (v *View) DisplayView() {
}
}
}
v.Bottomline = curLineN
if !v.Buf.Settings["softwrap"].(bool) {
v.Bottomline++
}
}
// DisplayCursor draws the current buffer's cursor to the screen