mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-25 18:07:07 +09:00
Add 'scrollbarchar' option (#2342)
This lets you specify a character that will get used for rendering the scrollbar. Co-authored-by: Zachary Yedidia <zyedidia@gmail.com>
This commit is contained in:
committed by
GitHub
parent
9593c2a720
commit
ffa7f987b6
@@ -353,6 +353,9 @@ var DefaultGlobalOnlySettings = map[string]interface{}{
|
|||||||
"multiopen": "tab",
|
"multiopen": "tab",
|
||||||
"parsecursor": false,
|
"parsecursor": false,
|
||||||
"paste": false,
|
"paste": false,
|
||||||
|
"savehistory": true,
|
||||||
|
"scrollbarchar": "|",
|
||||||
|
"sucmd": "sudo",
|
||||||
"pluginchannels": []string{"https://raw.githubusercontent.com/micro-editor/plugin-channel/master/channel.json"},
|
"pluginchannels": []string{"https://raw.githubusercontent.com/micro-editor/plugin-channel/master/channel.json"},
|
||||||
"pluginrepos": []string{},
|
"pluginrepos": []string{},
|
||||||
"savehistory": true,
|
"savehistory": true,
|
||||||
|
|||||||
@@ -767,8 +767,14 @@ func (w *BufWindow) displayScrollBar() {
|
|||||||
scrollBarStyle = style
|
scrollBarStyle = style
|
||||||
}
|
}
|
||||||
|
|
||||||
|
scrollBarChar := config.GetGlobalOption("scrollbarchar").(string)
|
||||||
|
if util.CharacterCountInString(scrollBarChar) != 1 {
|
||||||
|
scrollBarChar = "|"
|
||||||
|
}
|
||||||
|
scrollBarRune := []rune(scrollBarChar)
|
||||||
|
|
||||||
for y := barstart; y < util.Min(barstart+barsize, w.Y+w.bufHeight); y++ {
|
for y := barstart; y < util.Min(barstart+barsize, w.Y+w.bufHeight); y++ {
|
||||||
screen.SetContent(scrollX, y, '|', nil, scrollBarStyle)
|
screen.SetContent(scrollX, y, scrollBarRune[0], nil, scrollBarStyle)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -311,6 +311,10 @@ Here are the available options:
|
|||||||
|
|
||||||
default value: `false`
|
default value: `false`
|
||||||
|
|
||||||
|
* `scrollbarchar`: specifies the character used for displaying the scrollbar
|
||||||
|
|
||||||
|
default value: `|`
|
||||||
|
|
||||||
* `scrollmargin`: margin at which the view starts scrolling when the cursor
|
* `scrollmargin`: margin at which the view starts scrolling when the cursor
|
||||||
approaches the edge of the view.
|
approaches the edge of the view.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user