mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-30 06:37:14 +09:00
Add indent character option
This commit is contained in:
@@ -74,6 +74,7 @@ func DefaultSettings() map[string]interface{} {
|
|||||||
return map[string]interface{}{
|
return map[string]interface{}{
|
||||||
"colorscheme": "default",
|
"colorscheme": "default",
|
||||||
"tabsize": float64(4),
|
"tabsize": float64(4),
|
||||||
|
"indentchar": "|",
|
||||||
"autoindent": true,
|
"autoindent": true,
|
||||||
"syntax": true,
|
"syntax": true,
|
||||||
"tabsToSpaces": false,
|
"tabsToSpaces": false,
|
||||||
|
|||||||
@@ -545,7 +545,12 @@ func (v *View) DisplayView() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ch == '\t' {
|
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))
|
tabSize := int(settings["tabsize"].(float64))
|
||||||
for i := 0; i < tabSize-1; i++ {
|
for i := 0; i < tabSize-1; i++ {
|
||||||
tabchars++
|
tabchars++
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ color-link special "magenta"
|
|||||||
color-link ignore "default"
|
color-link ignore "default"
|
||||||
color-link error ",brightred"
|
color-link error ",brightred"
|
||||||
color-link todo ",brightyellow"
|
color-link todo ",brightyellow"
|
||||||
|
color-link indent-line "black"
|
||||||
color-link line-number "yellow"
|
color-link line-number "yellow"
|
||||||
color-link gutter-error ",red"
|
color-link gutter-error ",red"
|
||||||
color-link gutter-warning "red"
|
color-link gutter-warning "red"
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ color-link underlined "#D33682,#002833"
|
|||||||
color-link error "bold #CB4B16,#002833"
|
color-link error "bold #CB4B16,#002833"
|
||||||
color-link todo "bold #D33682,#002833"
|
color-link todo "bold #D33682,#002833"
|
||||||
color-link statusline "#003541,#839496"
|
color-link statusline "#003541,#839496"
|
||||||
|
color-link indent-line "#586E75,#002833"
|
||||||
color-link line-number "#586E75,#003541"
|
color-link line-number "#586E75,#003541"
|
||||||
color-link gutter-error "#003541,#CB4B16"
|
color-link gutter-error "#003541,#CB4B16"
|
||||||
color-link gutter-warning "#CB4B16,#002833"
|
color-link gutter-warning "#CB4B16,#002833"
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ color-link underlined "magenta"
|
|||||||
color-link error "bold brightred"
|
color-link error "bold brightred"
|
||||||
color-link todo "bold magenta"
|
color-link todo "bold magenta"
|
||||||
color-link statusline "black,brightblue"
|
color-link statusline "black,brightblue"
|
||||||
|
color-link indent-line "black"
|
||||||
color-link line-number "brightgreen,black"
|
color-link line-number "brightgreen,black"
|
||||||
color-link gutter-error "black,brightred"
|
color-link gutter-error "black,brightred"
|
||||||
color-link gutter-warning "brightred,default"
|
color-link gutter-warning "brightred,default"
|
||||||
|
|||||||
@@ -178,6 +178,10 @@ Here are the options that you can set:
|
|||||||
|
|
||||||
default value: `4`
|
default value: `4`
|
||||||
|
|
||||||
|
* `indentchar`: sets the indention chacrater
|
||||||
|
|
||||||
|
default value: `|`
|
||||||
|
|
||||||
* `syntax`: turns syntax on or off
|
* `syntax`: turns syntax on or off
|
||||||
|
|
||||||
default value: `on`
|
default value: `on`
|
||||||
|
|||||||
Reference in New Issue
Block a user