- // Now we actually draw the line
- colN := 0
- strWidth := 0
- tabSize := int(v.Buf.Settings["tabsize"].(float64))
- for _, ch := range line {
- if v.Buf.Settings["softwrap"].(bool) {
- if screenX-v.x >= v.width {
- screenY++
- for i := 0; i < v.lineNumOffset; i++ {
- screen.SetContent(v.x+i, screenY, ' ', nil, lineNumStyle)
- }
- screenX = v.x + v.lineNumOffset
- }
- }
-
- if tabs[curTab].curView == v.Num && !v.Cursor.HasSelection() && v.Cursor.Y == curLineN && colN == v.Cursor.X {
- v.DisplayCursor(screenX-v.leftCol, screenY)
- }
-
- lineStyle := defStyle
-
- if v.Buf.Settings["syntax"].(bool) {
- // Syntax highlighting is enabled
- highlightStyle = v.matches[viewLine][colN]
- }
-
- if v.Cursor.HasSelection() &&
- (charNum.GreaterEqual(v.Cursor.CurSelection[0]) && charNum.LessThan(v.Cursor.CurSelection[1]) ||
- charNum.LessThan(v.Cursor.CurSelection[0]) && charNum.GreaterEqual(v.Cursor.CurSelection[1])) {
- // The current character is selected
- lineStyle = defStyle.Reverse(true)
-
- if style, ok := colorscheme["selection"]; ok {
- lineStyle = style
- }
- } else {
- lineStyle = highlightStyle
- }