-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Add not zero check on tab-width. #7094
Comments
Hi! I am trying to get to a point where I could replicate the crash and debug the editor, but I am facing a problem. I am unable to change the tab-width. I am new to Helix, so I might do something wrong. I configured tab-width to 2 in the [[language]]
name = "rust'
indent = { tab-width = 2, unit = " " } Then I reopened the editor (built in debug mode, if it matters), then I opened some Rust source file. The problem is that when I try to indent some selection using the |
@Niketin If this is your EXACT config, then your |
I am sorry @ravsii, it is not the exact config because something weird happened to the text when I copy&pasted it from terminal. The config should be this, with correct double quotations and without that weird brown highlighted text (if you can see it). [[language]]
name = "rust"
indent = { tab-width = 2, unit = " " } |
@Niketin I guess this is a rust-only issue, probably because of the I'd suggest trying js,ts or some other web-related stuff. Working fine in svelte for example. (reproduced the crash as well) |
It's likely that your |
it might be picking it up and the auto-indentation detection is just overriding the setting cause the document uses spaces to indent, see src: helix/helix-view/src/document.rs Lines 888 to 891 in 9238054
|
The linked pr (#7178) makes it an error to have a non zero tab-width in your config which solves this issue without needing any custom logic |
I think it is in the right place, @kirawi. It's located in
I believe @gabydd this is why I couldn't reproduce the problem.
@apanloco's instructions worked! |
If set tab-width to zero, helix will crash (divided by zero). The error might occured from the helix-core/grapheme.rs.
Although it's a bit weird to set tab-width to zero (or even negative numbers), presenting the tab-width as 1 and alerting instead of panic would be better, IMO.
The text was updated successfully, but these errors were encountered: