mirror of
https://github.com/Hopiu/micro.git
synced 2026-04-06 16:00:58 +00:00
Merge pull request #209 from onodera-punpun/coloredline
Add colored current line number option
This commit is contained in:
commit
1e26aaed3c
2 changed files with 10 additions and 1 deletions
|
|
@ -582,9 +582,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)
|
||||
|
||||
|
|
@ -595,7 +599,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"
|
||||
|
|
|
|||
Loading…
Reference in a new issue