mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-10 06:40:24 +09:00
Add colored current line number option
This commit is contained in:
@@ -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++
|
||||
}
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user