Fix issue with cursorline
@@ -131,10 +131,10 @@ func (c *CellView) Draw(buf *Buffer, top, height, left, width int) {
c.lines[viewLine][viewCol] = &Char{Loc{viewCol, viewLine}, Loc{colN, lineN}, char, char, curStyle, 1}
}
if char == '\t' {
- width := tabsize - (viewCol+left)%tabsize
+ charWidth := tabsize - (viewCol+left)%tabsize
if viewCol >= 0 {
c.lines[viewLine][viewCol].drawChar = indentchar
- c.lines[viewLine][viewCol].width = width
+ c.lines[viewLine][viewCol].width = charWidth
indentStyle := curStyle
if group, ok := colorscheme["indent-char"]; ok {
@@ -144,21 +144,21 @@ func (c *CellView) Draw(buf *Buffer, top, height, left, width int) {
c.lines[viewLine][viewCol].style = indentStyle
}
- for i := 1; i < width; i++ {
+ for i := 1; i < charWidth; i++ {
viewCol++
- if viewCol >= 0 && viewCol < width {
+ if viewCol >= 0 && viewCol < lineLength {
c.lines[viewLine][viewCol] = &Char{Loc{viewCol, viewLine}, Loc{colN, lineN}, char, ' ', curStyle, 1}
}
}
viewCol++
} else if runewidth.RuneWidth(char) > 1 {
- width := runewidth.RuneWidth(char)
+ charWidth := runewidth.RuneWidth(char)
if viewCol >= 0 {
- c.lines[viewLine][viewCol].width = width
+ c.lines[viewLine][viewCol].width = charWidth
}
- for i := 1; i < width; i++ {
+ for i := 1; i < charWidth; i++ {
viewCol++
- if viewCol >= 0 && viewCol < width {
+ if viewCol >= 0 && viewCol < lineLength {
c.lines[viewLine][viewCol] = &Char{Loc{viewCol, viewLine}, Loc{colN, lineN}, char, ' ', curStyle, 1}
}
}
