From a1b688f0702e364286832346ba3094577cb00941 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Sun, 9 Dec 2018 21:51:54 +1100 Subject: bump gocui fork to convert tabs to spaces --- vendor/github.com/jesseduffield/gocui/view.go | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'vendor') diff --git a/vendor/github.com/jesseduffield/gocui/view.go b/vendor/github.com/jesseduffield/gocui/view.go index 939d1bdfa..6b80b9050 100644 --- a/vendor/github.com/jesseduffield/gocui/view.go +++ b/vendor/github.com/jesseduffield/gocui/view.go @@ -148,7 +148,6 @@ func (v *View) setRune(x, y int, ch rune, fgColor, bgColor Attribute) error { if x < 0 || x >= maxX || y < 0 || y >= maxY { return errors.New("invalid point") } - var ( ry, rcy int err error @@ -270,12 +269,19 @@ func (v *View) parseInput(ch rune) []cell { if isEscape { return nil } - c := cell{ - fgColor: v.ei.curFgColor, - bgColor: v.ei.curBgColor, - chr: ch, + repeatCount := 1 + if ch == '\t' { + ch = ' ' + repeatCount = 4 + } + for i := 0; i < repeatCount; i++ { + c := cell{ + fgColor: v.ei.curFgColor, + bgColor: v.ei.curBgColor, + chr: ch, + } + cells = append(cells, c) } - cells = append(cells, c) } return cells -- cgit v1.2.3