From dc15d0f641fde6ef77e68f2b67762b62da0b3447 Mon Sep 17 00:00:00 2001 From: Ante Kresic Date: Mon, 9 May 2016 12:10:47 +0200 Subject: [PATCH] [completer] Fix bug which causes integer divide by zero panicking when input buffer is empty (#54) * [completer] Fixes issue #53 * Changing check to candidateSource --- complete.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/complete.go b/complete.go index 52035a3..c767377 100644 --- a/complete.go +++ b/complete.go @@ -66,7 +66,7 @@ func (o *opCompleter) OnComplete() { buf := o.op.buf rs := buf.Runes() - if o.IsInCompleteMode() && runes.Equal(rs, o.candidateSource) { + if o.IsInCompleteMode() && o.candidateSource != nil && runes.Equal(rs, o.candidateSource) { o.EnterCompleteSelectMode() o.doSelect() return