Skip to content

Commit

Permalink
Fix #50: highlight for wrapped lines
Browse files Browse the repository at this point in the history
  • Loading branch information
jroimartin committed May 17, 2016
1 parent 4901994 commit 0707386
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion view.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 0707386

Please sign in to comment.