-
Notifications
You must be signed in to change notification settings - Fork 98
Highlight matching line #290
Conversation
😞 Have you tried using the theme variables that are available? |
Can you throw me a bit more of a tip? I see how I could get the loaded themes, and presumably figure out the active theme and from there the style. But I don't see how to set the style. StyleManager has no setter methods. |
|
You should be able to directly reference variables declared in https://github.com/atom/atom/blob/master/static/variables/ui-variables.less. Each theme then overrides those variables. Choose one that you think matches the purpose. |
|
Any other comments/questions on this? |
|
This looks good to me. @ungb maybe you could take this for a quick test run? |
|
Atom 1.19 renders the line number gutter even if line numbers are off. This also allows this modification to work even when line numbers are off. |
|
Any decision on this? |
|
Hey @seattlevine, I've just tested this and everything looks good to me! I tested this with line numbers on and off off atom/atom in master. I've reached out to the team for review and will let you know what I hear back. |
|
@seattlevine Thanks for adding this new enhancement. One of the concerning things is having this on by default since it changes the default behavior. I'll merge this change if we can have the default set to false for now. Please let me know if you can make that change. If not, let me know and I can help and get this PR merged. |
|
Sure. Off by default is fine. Go ahead and make that change.
Thanks.
|
|
Ah - misread that - you were looking for me to make that change. I'll do it soon. |
|
OK - all set. |
|
Thanks for making these changes @seattlevine! |
|
@seattlevine I'll add a comment to that issue and close it out once this change is in atom core. currently. We're working on fixing #314 before we update atom/atom to use the latest from bracket-matcher. |
|
The highlight uses 'text-color-subtle', so you can set that to what you like. |
|
Are you suggesting I need to fork a default theme for it to be readable? |
|
|
Yes I did do that but I still think this is a problem: a default package should work at least with all default themes. I think using a text color variable for a background is not a great idea. |
|
/cc: @simurai |
|
Love this! But I also had the issue where the line number was super hard to read. Quickly coded up this solution to make the line number readable no matter if I'm using a light or dark theme (I switch between the two sometimes depending on the ambient light in the room). .line-number.bracket-matcher {
& when (luminance(@syntax-background-color) <= 50%) {
background-color: lighten(average(@syntax-background-color, @syntax-selection-color), 10%);
}
& when (luminance(@syntax-background-color) > 50%) {
background-color: darken(average(@syntax-background-color, @syntax-selection-color), 10%);
}
} |





Requirements
Description of the Change
bracket-matcher already creates markers and decorates them. This pull request adds a highlight decoration to the line-number gutter if it is there.
Alternate Designs
I attempted to merge #180 into the current code base, but that is way out of date and there were modifications I did not understand. This is the first package I've worked with in Atom, and my first time w/ CoffeeScript, so I kept it simple.
Benefits
If you happen to have long blocks of code, you can more easily find the matching bracket.
Possible Drawbacks
Applicable Issues
#97