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

[Feature Request] Bracket Pair Colorization: Force unique opening color #131029

Open
Stanzilla opened this issue Aug 17, 2021 · 11 comments
Open

[Feature Request] Bracket Pair Colorization: Force unique opening color #131029

Stanzilla opened this issue Aug 17, 2021 · 11 comments
Assignees
Labels
bracket-pair-colorization feature-request Request for new features or functionality
Milestone

Comments

@Stanzilla
Copy link

This would be porting over said feature from Bracket Pair Colorizer 2

"bracket-pair-colorizer-2.forceUniqueOpeningColor"
image
image

@vscodebot
Copy link

vscodebot bot commented Aug 17, 2021

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@hediet
Copy link
Member

hediet commented Aug 17, 2021

How does this feature work? Why "opening"? Do you have an example that demonstrates why it is useful?
What about ()[]()?

@Stanzilla
Copy link
Author

Basically it makes sure that each bracket pair is a different color instead of only having a color switch when they start nesting.

@NatoBoram
Copy link

It would be nice to have it along with "bracket-pair-colorizer-2.forceIterationColorCycle".

forceIterationColorCycle

@hediet hediet modified the milestones: Backlog, March 2022 Mar 7, 2022
@hediet
Copy link
Member

hediet commented Mar 7, 2022

What's the difference between forceUniqueOpeningColor and forceIterationColorCycle?
Are really both settings needed?

@Stanzilla
Copy link
Author

image

I'm used to opening color but I guess could get used to color cycle

@hediet
Copy link
Member

hediet commented Mar 7, 2022

So forceUniqueOpeningColor just cycles between the first and second color, while forceIterationColorCycle cycles between all colors?
It seems to me they both solve the same issue - thus I only would like to implement one of them.

@Nahor
Copy link

Nahor commented Mar 7, 2022

IMHO, forceIteration has the drawback that the last nested pair might be the same color of the outer pair. With forceUnique, there is a way to ensure that the inner and outer pairs have different colors (I can't remember if it was implemented that way in the original extension though).

@hediet hediet modified the milestones: March 2022, April 2022 Mar 24, 2022
@hediet
Copy link
Member

hediet commented Mar 30, 2022

I still don't understand the behavior of the extension with forceUniqueOpeningColor:

image


I think a setting editor.bracketPairColorization.distinguishAdjacentPairs: boolean might be cleaner.
It would ensure that no adjacent pairs get the same color (which is not the case for the screenshot).

Unfortunately, this could happen then:

( () () () )  -  brackets
r gg bb rr r  -  computed colors

The last two closing brackets have the same color.
We could just avoid the parent color, but we have to see how that works with independentColorPoolPerBracketType.
Probably a bracket pair should then avoid the color of the closest ancestor with the same type.

@Nahor
Copy link

Nahor commented Mar 30, 2022

The original extension was a bit buggy and some corner cases were broken. I don't remember the exact scenario but I do remember that in some cases, consecutive brackets could have the same colors, although my memory was between a parent and its last child (...or maybe I was using forceIteration rather than forceUnique...?🤔).

We could just avoid the parent color

+1 on that, although I would even like it better if the pair would take the same color has the parent when the parent has no other characters but that pair (😛, I'm still hoping it will happen one day).

@hediet hediet modified the milestones: April 2022, May 2022 Apr 29, 2022
@hediet hediet modified the milestones: May 2022, June 2022 Jun 2, 2022
@hediet hediet modified the milestones: June 2022, July 2022 Jul 1, 2022
@hediet hediet modified the milestones: July 2022, August 2022, On Deck Jul 29, 2022
@clari7744
Copy link

clari7744 commented Jan 16, 2024

I'd like to bring attention back to this issue since this is the only thing I've found in my searching and it seems to have fallen by the wayside a bit, and just wanted to add in that I would also like to see the forceIteration setting come to the native feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bracket-pair-colorization feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

6 participants
@Stanzilla @Nahor @hediet @NatoBoram @clari7744 and others