From f6ccaadc0c6659fe52970c0d8900e0cc8e8ab7f8 Mon Sep 17 00:00:00 2001 From: aerth Date: Fri, 12 May 2017 16:32:24 -0700 Subject: [PATCH] use space for indentchar if empty, fixes #660 --- cmd/micro/cellview.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/micro/cellview.go b/cmd/micro/cellview.go index 0b5782f8..2cab7a08 100644 --- a/cmd/micro/cellview.go +++ b/cmd/micro/cellview.go @@ -67,7 +67,12 @@ type CellView struct { func (c *CellView) Draw(buf *Buffer, top, height, left, width int) { tabsize := int(buf.Settings["tabsize"].(float64)) softwrap := buf.Settings["softwrap"].(bool) - indentchar := []rune(buf.Settings["indentchar"].(string))[0] + indentrunes := []rune(buf.Settings["indentchar"].(string)) + // if empty indentchar settings, use space + if indentrunes == nil || len(indentrunes) == 0 { + indentrunes = []rune(" ") + } + indentchar := indentrunes[0] start := buf.Cursor.Y if buf.Settings["syntax"].(bool) && buf.syntaxDef != nil {