Fix bug with view.Center

Fixes #215
This commit is contained in:
Zachary Yedidia
2016-08-29 09:16:12 -04:00
parent 6ce8fe3ce1
commit f8071af717
2 changed files with 3 additions and 3 deletions

View File

@@ -51,10 +51,11 @@ func (v *View) Center(usePlugin bool) bool {
}
v.Topline = v.Cursor.Y - v.height/2
if v.Topline+v.height > v.Buf.NumLines {
v.Topline = v.Buf.NumLines - v.height
}
if v.Topline < 0 {
v.Topline = 0
} else if v.Topline+v.height > v.Buf.NumLines {
v.Topline = v.Buf.NumLines - v.height
}
if usePlugin {

View File

@@ -482,7 +482,6 @@ func Match(v *View) SyntaxMatches {
for _, value := range indicies {
start := runePos(value[0], line)
end := runePos(value[1], line)
// messenger.Message(start, " ", end)
for i := start; i < end; i++ {
matches[lineN][i] = rule.style
}