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
ColorScheme.SetAttribute is defunct #2286
Labels
Comments
I think i'm figuring out. New docs: /// <summary>
///
/// </summary>
/// <remarks>
/// <para>
/// If <see cref="Application"/> is not initialized yet and <see cref="_preparingScheme"/> is set to <see langword="false"/>
/// then the attribute is returned as is (because it's not possible to modify a Scheme wihtout a valid Driver).
/// </para>
/// <para>
/// If <see cref="Application"/> has been initialized and <see cref="_preparingScheme"/> is set to <see langword="true"/> it means
/// <see cref="SetAttribute(Attribute, string)"/> is being called recursively and the attribute is returned as is.
/// </para>
/// <para>
/// Otherwise, the attribute returned is created by Driver.MakeAttribute, using the
/// foreground and background colors of the attribute.
/// </para>
/// </remarks>
/// <param name="attribute">THe attribute to set.</param>
/// <param name="callerMemberName">The name of the property (e.g. <see cref="Normal"/> or <see cref="Focus"/>
/// that called the function. This is used to determine how to make the attribute.</param>
/// <returns>The attribute that was set.</returns>
Attribute SetAttribute (Attribute attribute, [CallerMemberName] string callerMemberName = null) |
This was made to create automatic attributes, but since they are been creating on the |
After diving in deeper, I agree! |
tig
changed the title
ColorScheme.SetAttribute uses a static var as a lock
ColorScheme.SetAttribute is defunct
Jan 16, 2023
tig
added a commit
that referenced
this issue
Jan 16, 2023
Fixes #2286 - ColorScheme.SetAttribute is defunct and should be removed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Current code:
Shouldn't
preparingCode
be a lock?While I'm here, the logic in the switch statement has always confused me. I do not understand the intent! It seems arbitrary to be making style decisions in code like this. Can anyone explain clearly?
The text was updated successfully, but these errors were encountered: