Include newlines in selection

This commit is contained in:
Zachary Yedidia
2016-03-23 17:15:10 -04:00
parent ab69812440
commit 9afb1257b4

View File

@@ -424,6 +424,18 @@ func (v *View) Display() {
charNum++
x++
}
if v.cursor.HasSelection() &&
(charNum >= v.cursor.selectionStart && charNum <= v.cursor.selectionEnd ||
charNum <= v.cursor.selectionStart && charNum >= v.cursor.selectionEnd) {
selectStyle := tcell.StyleDefault.Reverse(true)
if _, ok := colorscheme["selection"]; ok {
selectStyle = colorscheme["selection"]
}
v.s.SetContent(x+tabchars, lineN, ' ', nil, selectStyle)
}
x = 0
st, ok := v.matches[charNum]
if ok {