[completer] Fix bug which causes integer divide by zero panicking when input buffer is empty (#54)

* [completer] Fixes issue #53

* Changing check to candidateSource
This commit is contained in:
Ante Kresic 2016-05-09 12:10:47 +02:00 committed by chzyer
parent 8fbe9eac1a
commit dc15d0f641
1 changed files with 1 additions and 1 deletions

View File

@ -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