Fix colorcolumn being ignored

Closes #627
This commit is contained in:
Zachary Yedidia
2017-04-18 13:33:19 -04:00
parent 282e7b1828
commit 591e5e3145

View File

@@ -723,6 +723,14 @@ func (v *View) DisplayView() {
realLineN++
}
colorcolumn := int(v.Buf.Settings["colorcolumn"].(float64))
if colorcolumn != 0 {
style := GetColor("color-column")
fg, _, _ := style.Decompose()
st := defStyle.Background(fg)
screen.SetContent(xOffset+colorcolumn, yOffset+visualLineN, ' ', nil, st)
}
screenX = v.x
// If there are gutter messages we need to display the '>>' symbol here
@@ -816,6 +824,13 @@ func (v *View) DisplayView() {
if char != nil {
lineStyle := char.style
colorcolumn := int(v.Buf.Settings["colorcolumn"].(float64))
if colorcolumn != 0 && char.visualLoc.X == colorcolumn {
style := GetColor("color-column")
fg, _, _ := style.Decompose()
lineStyle = lineStyle.Background(fg)
}
charLoc := char.realLoc
if v.Cursor.HasSelection() &&
(charLoc.GreaterEqual(v.Cursor.CurSelection[0]) && charLoc.LessThan(v.Cursor.CurSelection[1]) ||