Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using SKIM as a library immediately crashes unless tabstop is set #205

Closed
SirVer opened this issue Jul 30, 2019 · 2 comments
Closed

Using SKIM as a library immediately crashes unless tabstop is set #205

SirVer opened this issue Jul 30, 2019 · 2 comments

Comments

@SirVer
Copy link
Contributor

SirVer commented Jul 30, 2019

The crash looks like this:

> thread '<unnamed>' panicked at 'attempt to calculate the remainder with a divisor of zero', /cargo/registry/src/github.jparrowsec.cn-1ecc6299db9ec823/skim-0.6.8/src/util.rs:174:23

The line takes the modulo of tabstop, which is set to zero by default (I believe this should just be 8 and this bug is gone). It only changes its value, when Options::tabstop is set here, interestingly the default of 8 is used here should parsing fail.

Hence, the workaround for library users currently is:

let options = SkimOptionsBuilder::default()
   .tabstop(Some("8"))
lotabout added a commit that referenced this issue Aug 2, 2019
fix #205 tabstop of selection was initialized to 0
@pierrechevalier83
Copy link

Hey, @lotabout, would you mind releasing a new minor version of skim to crates.io so consumers of this library don't have to workaround this bug in their codebase, as I had to here: https://github.com/pierrechevalier83/find_unicode/blob/bd18b4bf6d0a2d187abcb4c1cf478a192b198f5e/src/main.rs#L64?

@lotabout
Copy link
Collaborator

@pierrechevalier83 Sure, just done.

makovich pushed a commit to makovich/skim that referenced this issue May 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants