callum-oakley / gotta-go-fast

A command line utility for practicing typing and measuring your WPM and accuracy.
BSD 3-Clause "New" or "Revised" License
285 stars 16 forks source link

"gotta-go-fast: Prelude.!!: negative index" error on paragraph mode #15

Closed MauricioRobayo closed 3 years ago

MauricioRobayo commented 3 years ago

Hi! gotta-go-fast is great, thanks for putting it out there!

I'm getting an error on paragraph mode:

$ gotta-go-fast -p README.md
gotta-go-fast: Prelude.!!: negative index

It's the same error if I use:

$ gotta-go-fast -prw 60 README.md
gotta-go-fast: Prelude.!!: negative index

I have tried with this READEME.md and with this text.

callum-oakley commented 3 years ago

What version are you on? (--version)

It looks like you are hitting a bug that was fixed in version 0.3.0.4. There was an error if you tried to use paragraph mode on a file without any paragraphs of suitable length (configurable with --min-paragraph-len and --max-paragraph-len), but since 0.3.0.4 it just falls back to sampling lines in that case.

Let me know if updating doesn't solve it!

P.S. gogofast looks like a great idea. :)

callum-oakley commented 3 years ago

I just realised I never updated the binary release, so if you downloaded a binary instead of installing from source you're probably on 0.3.0.1... ~I'll push a new release now.~ done 😅

MauricioRobayo commented 3 years ago

Thanks! Yes, indeed I was using a previous version:

$ gotta-go-fast --version
Gotta Go Fast 0.3.0.1

I built it from source since there is no Linux binary on the latest release, working as expected.