Add colorscheme support for selection color

This commit is contained in:
Zachary Yedidia
2016-03-23 13:23:50 -04:00
parent b85edeebd6
commit e2f25947cc
2 changed files with 21 additions and 20 deletions

View File

@@ -402,8 +402,12 @@ func (v *View) Display() {
if v.cursor.HasSelection() &&
(charNum >= v.cursor.selectionStart && charNum <= v.cursor.selectionEnd ||
charNum <= v.cursor.selectionStart && charNum >= v.cursor.selectionEnd) {
lineStyle = tcell.StyleDefault
lineStyle = lineStyle.Reverse(true)
lineStyle = tcell.StyleDefault.Reverse(true)
if _, ok := colorscheme["selection"]; ok {
lineStyle = colorscheme["selection"]
}
} else {
lineStyle = highlightStyle
}