Add colorcolumn option

Fixes #333

For example: `> set colorcolumn 80`.
This commit is contained in:
Zachary Yedidia
2016-09-07 17:17:51 -04:00
parent dc8207149b
commit 8f06e51170
13 changed files with 37 additions and 11 deletions

View File

@@ -806,7 +806,16 @@ func (v *View) DisplayView() {
}
}
if screenX-v.x-v.leftCol+i >= v.lineNumOffset {
v.drawCell(screenX-v.leftCol+i, screenY, ' ', nil, lineStyle)
colorcolumn := int(v.Buf.Settings["colorcolumn"].(float64))
if colorcolumn != 0 && screenX-v.leftCol+i == colorcolumn-1 {
if style, ok := colorscheme["color-column"]; ok {
fg, _, _ := style.Decompose()
lineStyle = lineStyle.Background(fg)
}
v.drawCell(screenX-v.leftCol+i, screenY, ' ', nil, lineStyle)
} else {
v.drawCell(screenX-v.leftCol+i, screenY, ' ', nil, lineStyle)
}
}
}
}