Skip to content

Autocomplete on empty input panics #159

Open
@penberg

Description

@penberg
→  panic: runtime error: index out of range [-1]

goroutine 6 [running]:
github.com/libsql/libsql-shell-go/internal/suggester.SuggestCompletion({0x140000a0000?, 0x101b1ea40?})
	/Users/penberg/src/tursodatabase/libsql-shell-go/internal/suggester/suggester.go:14 +0x290
github.com/libsql/libsql-shell-go/internal/shell.(*shellAutoCompleter).Do(0x14000286170, {0x101b1ea40?, 0x1400007bc08?, 0x10122f76c?}, 0x0)
	/Users/penberg/src/tursodatabase/libsql-shell-go/internal/shell/shell.go:143 +0x4c
github.com/chzyer/readline.(*opCompleter).OnComplete(0x140002bab60)
	/Users/penberg/go/pkg/mod/github.com/chzyer/[email protected]/complete.go:87 +0x128
github.com/chzyer/readline.(*Operation).ioloop(0x140002baa80)
	/Users/penberg/go/pkg/mod/github.com/chzyer/[email protected]/operation.go:180 +0xa3c
created by github.com/chzyer/readline.NewOperation in goroutine 1
	/Users/penberg/go/pkg/mod/github.com/chzyer/[email protected]/operation.go:88 +0x2d4
exit status 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions