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

gui: attempt to auto-reset color pairs even when full #1258

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sim642
Copy link
Member

@sim642 sim642 commented Oct 3, 2018

Previously if color pairs fill up because all pairs are rendered at once and auto-reset therefore fails, weechat will never try to auto-reset again and manual reset is necessary.

This attempts to auto-reset even a full table, in case now less pairs are visible and the reset will be successful.

For testing I wrote this script to spam a huge number of color combinations into a single buffer to fill up all the ncurses color pairs: https://gist.github.com/sim642/dde23725f23907bc960fce308ecda4f1.
Running the script messes up bar colors etc and switching to a different buffer, which doesn't need all those color pairs should auto reset and fix the color pairs again, but it doesn't. This PR changes that and attempts auto color reset when the pairs are already completely full.

On at least two occasions in the recent months this issue has been brought up in #weechat, which seems to have been caused by such color pair spam. One would expect color pair auto reset to eventually fix the colors but it didn't because nothing was attempted when the limit was already over.

Happy Hacktoberfest!

Previously if color pairs fill up because all pairs are rendered at once
and auto-reset therefore fails, weechat will never try to auto-reset
again and manual reset is necessary.

This attempts to auto-reset even a full table, in case now less pairs
are visible and the reset will be successful.
@flashcode flashcode added the bug Unexpected problem or unintended behavior label Oct 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants