Add indent character option

This commit is contained in:
Camille Scholtz
2016-05-17 17:17:18 +02:00
parent 5ba6ff042c
commit a0d4123731
6 changed files with 14 additions and 1 deletions

View File

@@ -74,6 +74,7 @@ func DefaultSettings() map[string]interface{} {
return map[string]interface{}{
"colorscheme": "default",
"tabsize": float64(4),
"indentchar": "|",
"autoindent": true,
"syntax": true,
"tabsToSpaces": false,

View File

@@ -545,7 +545,12 @@ func (v *View) DisplayView() {
}
if ch == '\t' {
screen.SetContent(x+tabchars, lineN, ' ', nil, lineStyle)
lineIndentStyle := defStyle
if style, ok := colorscheme["indent-line"]; ok {
lineIndentStyle = style
}
indentChar := []rune(settings["indentchar"].(string))
screen.SetContent(x+tabchars, lineN, indentChar[0], nil, lineIndentStyle)
tabSize := int(settings["tabsize"].(float64))
for i := 0; i < tabSize-1; i++ {
tabchars++