From 3d62a1baa0750e2f8e25b24e19799f8e63daada2 Mon Sep 17 00:00:00 2001 From: Zachary Yedidia Date: Thu, 2 Jun 2016 13:15:47 -0400 Subject: [PATCH] Don't display cursorline if there is a selection --- cmd/micro/view.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/micro/view.go b/cmd/micro/view.go index 1a73728a..26e6f879 100644 --- a/cmd/micro/view.go +++ b/cmd/micro/view.go @@ -562,7 +562,7 @@ func (v *View) DisplayView() { lineStyle = highlightStyle } - if settings["cursorline"].(bool) && v.Cursor.Y == lineN+v.Topline { + if settings["cursorline"].(bool) && !v.Cursor.HasSelection() && v.Cursor.Y == lineN+v.Topline { if style, ok := colorscheme["cursor-line"]; ok { fg, _, _ := style.Decompose() lineStyle = lineStyle.Background(fg) @@ -584,7 +584,7 @@ func (v *View) DisplayView() { lineIndentStyle = style } } - if settings["cursorline"].(bool) && v.Cursor.Y == lineN+v.Topline { + if settings["cursorline"].(bool) && !v.Cursor.HasSelection() && v.Cursor.Y == lineN+v.Topline { if style, ok := colorscheme["cursor-line"]; ok { fg, _, _ := style.Decompose() lineIndentStyle = lineIndentStyle.Background(fg) @@ -628,7 +628,7 @@ func (v *View) DisplayView() { for i := 0; i < v.width-x; i++ { lineStyle := tcell.StyleDefault - if settings["cursorline"].(bool) && v.Cursor.Y == lineN+v.Topline { + if settings["cursorline"].(bool) && !v.Cursor.HasSelection() && v.Cursor.Y == lineN+v.Topline { if style, ok := colorscheme["cursor-line"]; ok { fg, _, _ := style.Decompose() lineStyle = lineStyle.Background(fg)