Use StartCol in colorcolumn calculation

Fixes #1615
This commit is contained in:
Zachary Yedidia
2020-04-10 17:27:11 -04:00
parent d92deacf99
commit 8f5888e7bf

View File

@@ -559,7 +559,7 @@ func (w *BufWindow) displayBuffer() {
} }
if s, ok := config.Colorscheme["color-column"]; ok { if s, ok := config.Colorscheme["color-column"]; ok {
if colorcolumn != 0 && vloc.X-w.gutterOffset == colorcolumn { if colorcolumn != 0 && vloc.X-w.gutterOffset+w.StartCol == colorcolumn {
fg, _, _ := s.Decompose() fg, _, _ := s.Decompose()
style = style.Background(fg) style = style.Background(fg)
} }
@@ -653,7 +653,7 @@ func (w *BufWindow) displayBuffer() {
for i := vloc.X; i < bufWidth; i++ { for i := vloc.X; i < bufWidth; i++ {
curStyle := style curStyle := style
if s, ok := config.Colorscheme["color-column"]; ok { if s, ok := config.Colorscheme["color-column"]; ok {
if colorcolumn != 0 && i-w.gutterOffset == colorcolumn { if colorcolumn != 0 && i-w.gutterOffset+w.StartCol == colorcolumn {
fg, _, _ := s.Decompose() fg, _, _ := s.Decompose()
curStyle = style.Background(fg) curStyle = style.Background(fg)
} }