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: auto_show function logic #707

Merged
merged 1 commit into from
Dec 21, 2024
Merged

fix: auto_show function logic #707

merged 1 commit into from
Dec 21, 2024

Conversation

guill
Copy link
Contributor

@guill guill commented Dec 21, 2024

This code was reduced by a line before merging PR #697, but it's now hitting the case where the Lua 'ternary' doesn't behave like a proper ternary operator. Specifically, when the auto_show function returns false, the result of

auto_show = type(auto_show) == "function" and auto_show(...) or auto_show

becomes

auto_show = (true and false) or <function>

which is the truthy function reference itself.

This code was reduced by a line before merging PR Saghen#697, but it's now
hitting the case where the Lua 'ternary' doesn't behave like a proper
ternary operator. Specifically, when the `auto_show` function returns
false, the result of
```lua
auto_show = type(auto_show) == "function" and auto_show(...) or auto_show
```
becomes
```lua
auto_show = (true and false) or <function>
```
which is the truthy function reference itself.
@Saghen Saghen merged commit 4ef6d1e into Saghen:main Dec 21, 2024
@Saghen
Copy link
Owner

Saghen commented Dec 21, 2024

Thank you!

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