Merge pull request #110 from onodera-punpun/indentchar

Add indentation character option(s).
This commit is contained in:
Zachary Yedidia
2016-05-17 12:37:47 -04:00
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

@@ -547,7 +547,12 @@ func (v *View) DisplayView() {
}
if ch == '\t' {
screen.SetContent(x+tabchars, lineN, ' ', nil, lineStyle)
lineIndentStyle := defStyle
if style, ok := colorscheme["indent-char"]; 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++