Add colored current line number option

This commit is contained in:
Camille Scholtz
2016-08-15 22:35:40 +02:00
parent 92c28d81b9
commit e38e1c9dff
2 changed files with 10 additions and 1 deletions

View File

@@ -656,9 +656,13 @@ func (v *View) DisplayView() {
if settings["ruler"] == true {
// Write the line number
lineNumStyle := defStyle
curLineNumStyle := defStyle
if style, ok := colorscheme["line-number"]; ok {
lineNumStyle = style
}
if style, ok := colorscheme["current-line-number"]; ok {
curLineNumStyle = style
}
lineNum := strconv.Itoa(curLineN + 1)
@@ -669,7 +673,11 @@ func (v *View) DisplayView() {
}
// Write the actual line number
for _, ch := range lineNum {
v.drawCell(screenX, screenY, ch, nil, lineNumStyle)
if curLineN == v.Cursor.Y {
v.drawCell(screenX, screenY, ch, nil, curLineNumStyle)
} else {
v.drawCell(screenX, screenY, ch, nil, lineNumStyle)
}
screenX++
}

View File

@@ -10,6 +10,7 @@ color-link error ",brightred"
color-link todo ",brightyellow"
color-link indent-char "black"
color-link line-number "yellow"
color-link current-line-number "red"
color-link gutter-error ",red"
color-link gutter-warning "red"
color-link cursor-line "white"