From a0d4123731ef48b4bcf48cb6d3eef5e2cbe070b4 Mon Sep 17 00:00:00 2001 From: Camille Scholtz Date: Tue, 17 May 2016 17:17:18 +0200 Subject: [PATCH 1/3] Add indent character option --- cmd/micro/settings.go | 1 + cmd/micro/view.go | 7 ++++++- runtime/colorschemes/default.micro | 1 + runtime/colorschemes/solarized-tc.micro | 1 + runtime/colorschemes/solarized.micro | 1 + runtime/help/help.md | 4 ++++ 6 files changed, 14 insertions(+), 1 deletion(-) diff --git a/cmd/micro/settings.go b/cmd/micro/settings.go index 01aa72ef..eca3c9fc 100644 --- a/cmd/micro/settings.go +++ b/cmd/micro/settings.go @@ -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, diff --git a/cmd/micro/view.go b/cmd/micro/view.go index f44ee174..aef6b89f 100644 --- a/cmd/micro/view.go +++ b/cmd/micro/view.go @@ -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++ diff --git a/runtime/colorschemes/default.micro b/runtime/colorschemes/default.micro index 24100871..4903f875 100644 --- a/runtime/colorschemes/default.micro +++ b/runtime/colorschemes/default.micro @@ -8,6 +8,7 @@ color-link special "magenta" color-link ignore "default" color-link error ",brightred" color-link todo ",brightyellow" +color-link indent-line "black" color-link line-number "yellow" color-link gutter-error ",red" color-link gutter-warning "red" diff --git a/runtime/colorschemes/solarized-tc.micro b/runtime/colorschemes/solarized-tc.micro index 8880745b..2f9224fa 100644 --- a/runtime/colorschemes/solarized-tc.micro +++ b/runtime/colorschemes/solarized-tc.micro @@ -10,6 +10,7 @@ color-link underlined "#D33682,#002833" color-link error "bold #CB4B16,#002833" color-link todo "bold #D33682,#002833" color-link statusline "#003541,#839496" +color-link indent-line "#586E75,#002833" color-link line-number "#586E75,#003541" color-link gutter-error "#003541,#CB4B16" color-link gutter-warning "#CB4B16,#002833" diff --git a/runtime/colorschemes/solarized.micro b/runtime/colorschemes/solarized.micro index c87de884..64a634b7 100644 --- a/runtime/colorschemes/solarized.micro +++ b/runtime/colorschemes/solarized.micro @@ -9,6 +9,7 @@ color-link underlined "magenta" color-link error "bold brightred" color-link todo "bold magenta" color-link statusline "black,brightblue" +color-link indent-line "black" color-link line-number "brightgreen,black" color-link gutter-error "black,brightred" color-link gutter-warning "brightred,default" diff --git a/runtime/help/help.md b/runtime/help/help.md index f18a5461..05f4b25b 100644 --- a/runtime/help/help.md +++ b/runtime/help/help.md @@ -178,6 +178,10 @@ Here are the options that you can set: default value: `4` +* `indentchar`: sets the indention chacrater + + default value: `|` + * `syntax`: turns syntax on or off default value: `on` From 9b984b168066bfd6f6c89b479a88f376b29e68ee Mon Sep 17 00:00:00 2001 From: Camille Date: Tue, 17 May 2016 17:21:47 +0200 Subject: [PATCH 2/3] Fix typo --- runtime/help/help.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/help/help.md b/runtime/help/help.md index 05f4b25b..005e5e25 100644 --- a/runtime/help/help.md +++ b/runtime/help/help.md @@ -178,7 +178,7 @@ Here are the options that you can set: default value: `4` -* `indentchar`: sets the indention chacrater +* `indentchar`: sets the indentation character default value: `|` From 93927cf0f5be354b4f1378a64792655a9c8ab488 Mon Sep 17 00:00:00 2001 From: Camille Scholtz Date: Tue, 17 May 2016 18:09:49 +0200 Subject: [PATCH 3/3] Rename indent-line to indent-char, change default value from `|` to ` ` --- cmd/micro/settings.go | 2 +- cmd/micro/view.go | 2 +- runtime/colorschemes/default.micro | 2 +- runtime/colorschemes/solarized-tc.micro | 2 +- runtime/colorschemes/solarized.micro | 2 +- runtime/help/help.md | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/micro/settings.go b/cmd/micro/settings.go index eca3c9fc..bc3e56f8 100644 --- a/cmd/micro/settings.go +++ b/cmd/micro/settings.go @@ -74,7 +74,7 @@ func DefaultSettings() map[string]interface{} { return map[string]interface{}{ "colorscheme": "default", "tabsize": float64(4), - "indentchar": "|", + "indentchar": " ", "autoindent": true, "syntax": true, "tabsToSpaces": false, diff --git a/cmd/micro/view.go b/cmd/micro/view.go index aef6b89f..0fb7074a 100644 --- a/cmd/micro/view.go +++ b/cmd/micro/view.go @@ -546,7 +546,7 @@ func (v *View) DisplayView() { if ch == '\t' { lineIndentStyle := defStyle - if style, ok := colorscheme["indent-line"]; ok { + if style, ok := colorscheme["indent-char"]; ok { lineIndentStyle = style } indentChar := []rune(settings["indentchar"].(string)) diff --git a/runtime/colorschemes/default.micro b/runtime/colorschemes/default.micro index 4903f875..a05315a9 100644 --- a/runtime/colorschemes/default.micro +++ b/runtime/colorschemes/default.micro @@ -8,7 +8,7 @@ color-link special "magenta" color-link ignore "default" color-link error ",brightred" color-link todo ",brightyellow" -color-link indent-line "black" +color-link indent-char "black" color-link line-number "yellow" color-link gutter-error ",red" color-link gutter-warning "red" diff --git a/runtime/colorschemes/solarized-tc.micro b/runtime/colorschemes/solarized-tc.micro index 2f9224fa..1cdb9f31 100644 --- a/runtime/colorschemes/solarized-tc.micro +++ b/runtime/colorschemes/solarized-tc.micro @@ -10,7 +10,7 @@ color-link underlined "#D33682,#002833" color-link error "bold #CB4B16,#002833" color-link todo "bold #D33682,#002833" color-link statusline "#003541,#839496" -color-link indent-line "#586E75,#002833" +color-link indent-char "#586E75,#002833" color-link line-number "#586E75,#003541" color-link gutter-error "#003541,#CB4B16" color-link gutter-warning "#CB4B16,#002833" diff --git a/runtime/colorschemes/solarized.micro b/runtime/colorschemes/solarized.micro index 64a634b7..0edcfb4e 100644 --- a/runtime/colorschemes/solarized.micro +++ b/runtime/colorschemes/solarized.micro @@ -9,7 +9,7 @@ color-link underlined "magenta" color-link error "bold brightred" color-link todo "bold magenta" color-link statusline "black,brightblue" -color-link indent-line "black" +color-link indent-char "black" color-link line-number "brightgreen,black" color-link gutter-error "black,brightred" color-link gutter-warning "brightred,default" diff --git a/runtime/help/help.md b/runtime/help/help.md index 005e5e25..8e06dede 100644 --- a/runtime/help/help.md +++ b/runtime/help/help.md @@ -180,7 +180,7 @@ Here are the options that you can set: * `indentchar`: sets the indentation character - default value: `|` + default value: ` ` * `syntax`: turns syntax on or off