Don't draw cursorline at cursor position
Fixes
If the cursorline is drawn at the cursor's position, then the cursor
doesn't display. I'm not really sure why this is a problem with the
gnome terminal, it didn't seem to happen on earlier versions.
@@ -850,11 +850,13 @@ func (v *View) DisplayView() {
lastX := 0
var realLoc Loc
var visualLoc Loc
+ var cx, cy int
if lastChar != nil {
lastX = xOffset + lastChar.visualLoc.X + lastChar.width
if tabs[curTab].CurView == v.Num && !v.Cursor.HasSelection() &&
v.Cursor.Y == lastChar.realLoc.Y && v.Cursor.X == lastChar.realLoc.X+1 {
screen.ShowCursor(lastX, yOffset+lastChar.visualLoc.Y)
+ cx, cy = lastX, yOffset+lastChar.visualLoc.Y
}
realLoc = Loc{lastChar.realLoc.X, realLineN}
visualLoc = Loc{lastX - xOffset, lastChar.visualLoc.Y}
@@ -862,6 +864,7 @@ func (v *View) DisplayView() {
if tabs[curTab].CurView == v.Num && !v.Cursor.HasSelection() &&
v.Cursor.Y == realLineN {
screen.ShowCursor(xOffset, yOffset+visualLineN)
+ cx, cy = xOffset, yOffset+visualLineN
}
lastX = xOffset
realLoc = Loc{0, realLineN}
@@ -886,10 +889,12 @@ func (v *View) DisplayView() {
style := GetColor("cursor-line")
fg, _, _ := style.Decompose()
style = style.Background(fg)
+ if !(tabs[curTab].CurView == v.Num && !v.Cursor.HasSelection() && i == cx && yOffset+visualLineN == cy) {
screen.SetContent(i, yOffset+visualLineN, ' ', nil, style)
}
}
}
+ }
if v.x != 0 && visualLineN < v.Height {
dividerStyle := defStyle
