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

fix: error when window width is extremely small #44

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

eki3z
Copy link
Contributor

@eki3z eki3z commented Sep 11, 2024

The function window-max-chars-per-line may return -1 if the width of the current window is extremely small. When -1 is passed as the width value to make-list, it results in an error. We must ensure that the value is non-negative before passing it.

@eki3z eki3z force-pushed the fix/error-of-max-char-minus-one branch from 82fdc98 to 207983a Compare September 11, 2024 14:56
@purcell
Copy link
Owner

purcell commented Sep 11, 2024

Thanks, good catch! Would you mind moving the (max ...) so that it applies to the (window-max-chars-per-line) call a few lines above? I think it would make it clearer where the -1 might come from. (If it's not convenient for you to do so, I can also make the change on your behalf, just let me know.)

@eki3z eki3z force-pushed the fix/error-of-max-char-minus-one branch from 207983a to ac65c88 Compare September 11, 2024 15:21
The function window-max-chars-per-line may return -1 if the width of the current
window is extremely small. When -1 is passed as the width value to make-list, it
results in an error. We must ensure that the value is non-negative before passing it.
@eki3z eki3z force-pushed the fix/error-of-max-char-minus-one branch from ac65c88 to 6ba6789 Compare September 11, 2024 15:23
@eki3z
Copy link
Contributor Author

eki3z commented Sep 11, 2024

@purcell finished, please check it !

@purcell
Copy link
Owner

purcell commented Sep 11, 2024

Perfect, thanks!

@purcell purcell merged commit 4a20d4a into purcell:master Sep 11, 2024
9 checks passed
@eki3z eki3z deleted the fix/error-of-max-char-minus-one branch September 11, 2024 21:17
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

Successfully merging this pull request may close these issues.

2 participants