From 0707386452711db7b0d58fff7e13dd2f28e1db3e Mon Sep 17 00:00:00 2001 From: Roi Martin Date: Tue, 17 May 2016 22:40:24 +0200 Subject: [PATCH] Fix #50: highlight for wrapped lines --- view.go | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/view.go b/view.go index bc2f088..176ab9e 100644 --- a/view.go +++ b/view.go @@ -104,8 +104,23 @@ func (v *View) setRune(x, y int, ch rune) error { return errors.New("invalid point") } + var ( + ry, rcy int + err error + ) + if v.Highlight { + _, ry, err = v.realPosition(x, y) + if err != nil { + return err + } + _, rcy, err = v.realPosition(v.cx, v.cy) + if err != nil { + return err + } + } + var fgColor, bgColor Attribute - if v.Highlight && y == v.cy { + if v.Highlight && ry == rcy { fgColor = v.SelFgColor bgColor = v.SelBgColor } else {