Skip to content

Commit

Permalink
Add NoopCompleter
Browse files Browse the repository at this point in the history
  • Loading branch information
XSAM committed Jun 9, 2020
1 parent d043be0 commit 33748ac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,9 @@ func NewCompletionManager(completer Completer, max uint16) *CompletionManager {
verticalScroll: 0,
}
}

var _ Completer = NoopCompleter

func NoopCompleter(_ Document) []Suggest {
return nil
}
6 changes: 6 additions & 0 deletions completion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,9 @@ func TestFormatText(t *testing.T) {
}
}
}

func TestNoopCompleter(t *testing.T) {
if NoopCompleter(Document{}) != nil {
t.Errorf("NoopCompleter should return nil")
}
}

0 comments on commit 33748ac

Please sign in to comment.