Skip to content
This repository has been archived by the owner on Nov 26, 2023. It is now read-only.

Breaks when entering "inputs" #32

Open
pmf-ids opened this issue Jan 18, 2022 · 0 comments
Open

Breaks when entering "inputs" #32

pmf-ids opened this issue Jan 18, 2022 · 0 comments

Comments

@pmf-ids
Copy link

pmf-ids commented Jan 18, 2022

When calling jiq with

echo 1 | jiq -n

it opens up fine, displaying

[jq]> .

1

with the cursor being next to the dot. Clearing the dot and entering inputs makes jiq crash as soon as the last letter s is hit, with the message

panic: runtime error: slice bounds out of range [:-1]

goroutine 1 [running]:
github.com/fiatjaf/jiq.(*Engine).makeCandidates(0xc0001d2000)
	/home/fiatjaf/comp/jiq/engine.go:212 +0x585
github.com/fiatjaf/jiq.(*Engine).Run(0xc0001d2000, 0x0)
	/home/fiatjaf/comp/jiq/engine.go:70 +0x165
main.run(0xc0001d2000, 0xc00000e000, 0xc000010050)
	/home/fiatjaf/comp/jiq/cmd/jiq/jiq.go:59 +0x32
main.main()
	/home/fiatjaf/comp/jiq/cmd/jiq/jiq.go:55 +0x18d

Tested on jiq version 0.7.1-3-g5dec899

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant