From 591e5e31452328208cd0345d5678a11a3c8912d9 Mon Sep 17 00:00:00 2001 From: Zachary Yedidia Date: Tue, 18 Apr 2017 13:33:19 -0400 Subject: [PATCH] Fix colorcolumn being ignored Closes #627 --- cmd/micro/view.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/cmd/micro/view.go b/cmd/micro/view.go index 6cf2aaba..9e94578c 100644 --- a/cmd/micro/view.go +++ b/cmd/micro/view.go @@ -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]) ||