Navigation Menu

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 set_background_opacity with increment/decrement #1147

Merged
merged 1 commit into from Nov 17, 2018
Merged

Fix set_background_opacity with increment/decrement #1147

merged 1 commit into from Nov 17, 2018

Conversation

kdarkhan
Copy link
Contributor

There is a logic error in set_background_opacity which breaks increment/decrement handling.
This commit fixes it.

@maximbaz
Copy link
Contributor

Can you describe this logic error? It's not obvious to me even now 🙂

@kdarkhan
Copy link
Contributor Author

kdarkhan commented Nov 17, 2018

Sure. Putting this into my config

map kitty_mod+9    set_background_opacity +0.1
map kitty_mod+8    set_background_opacity -0.1

I would expect the first shortcut to increment, and second to decrement the current opacity.
However because
opacity = background_opacity_of(os_window_id)
overrides the passed in opacity parameter, and later
opacity += float(opacity) just doubles the effective opacity instead of incrementing/decrementing it.

@kovidgoyal kovidgoyal merged commit 55e4761 into kovidgoyal:master Nov 17, 2018
@kdarkhan kdarkhan deleted the fix-set-background-opacity branch November 17, 2018 11:59
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.

None yet

3 participants