- if style, ok := colorscheme["selection"]; ok {
- lineIndentStyle = style
- }
- }
- if v.Buf.Settings["cursorline"].(bool) && tabs[curTab].curView == v.Num && !v.Cursor.HasSelection() && v.Cursor.Y == curLineN {
- if style, ok := colorscheme["cursor-line"]; ok {
- fg, _, _ := style.Decompose()
- lineIndentStyle = lineIndentStyle.Background(fg)
- }
- }
- // Here we get the indent char
- indentChar := []rune(v.Buf.Settings["indentchar"].(string))
- if screenX-v.x-v.leftCol >= v.lineNumOffset {
- v.drawCell(screenX-v.leftCol, screenY, indentChar[0], nil, lineIndentStyle)
- }
- // Now the tab has to be displayed as a bunch of spaces
- visLoc := strWidth
- remainder := tabSize - (visLoc % tabSize)
- for i := 0; i < remainder-1; i++ {
- screenX++
- if screenX-v.x-v.leftCol >= v.lineNumOffset {
- v.drawCell(screenX-v.leftCol, screenY, ' ', nil, lineStyle)
- }
- }
- } else if runewidth.RuneWidth(ch) > 1 {
- if screenX-v.x-v.leftCol >= v.lineNumOffset {
- v.drawCell(screenX, screenY, ch, nil, lineStyle)
+ lastX := 0
+ var realLoc Loc
+ var visualLoc Loc
+ var cx, cy int
+ if lastChar != nil {
+ lastX = xOffset + lastChar.visualLoc.X + lastChar.width
+ for i, c := range v.Buf.cursors {
+ v.Cursor = c
+ if tabs[curTab].CurView == v.Num && !v.Cursor.HasSelection() &&
+ v.Cursor.Y == lastChar.realLoc.Y && v.Cursor.X == lastChar.realLoc.X+1 {
+ ShowMultiCursor(lastX, yOffset+lastChar.visualLoc.Y, i)
+ cx, cy = lastX, yOffset+lastChar.visualLoc.Y