-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
align gutter png icon position with line number #5611
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5611 +/- ##
=======================================
Coverage 86.89% 86.89%
=======================================
Files 594 594
Lines 43143 43158 +15
Branches 7150 7150
=======================================
+ Hits 37489 37504 +15
Misses 5654 5654
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@nightwing @akoreman let me know if you have any concerns about moving the background to another element. I've checked the codebase but it doesn't seem the target element is used for anything except for showing errors in folded block (which is not affected by this change). |
I think the one concern would be what would happen if people currently have a custom theme theme set the background image to On the other hand, this is a bullet we might need to bite at some point and accept that for these rare use cases people will have to make a change, but in that case, would it be better to just fully deprecate the PNG icons and fully go for the new SVG ones? |
Yeah, it's not like their app won't run but this scenario you've described is certainly possible. It might be even worse since it will be implicit.
This would be breaking on the interface level as we'd need to deal with the API property we have. If we remove it it's kind of a breaking change, and if we just ignore the passed value it's also kind of a breaking change. It might be wise to save such moves until the next major version :) |
I've updated the PR to calculate the background position based on the font size and icon size in the currently used container. Value for line height is 1.2, which is the same as Not the prettiest solution, and if we think it's too risky I'm OK to discard it completely, this issue is not super important. FYI @akoreman |
@nightwing I've checked the codebase and it seems like css variables are not used anywhere yet. Is there a reason for this? They seem well-supported across browsers. |
Issue #, if available:
#5380
Description of changes:
Moving the background which sets the gutter png icons from
.ace_gutter-cell.ace_error
to.ace_gutter-cell.ace_error .ace_icon
. It's the same container used for displaying annotations in folded block.Initially I've tested a naive fix for this by moving the background position to top instead of center (same positioning would be achived with
background-position: 2px -1px;
instead ofbackground-position: 2px center;
). It looked OK on default font size, but with font size changing it did not keep up the alignment with line numbers (see screenshot below). Solution implemented in this PR keeps the icons aligned with line numbers regardless of font size.To test this open https://raw.githack.com/ajaxorg/ace/fix-gutter-icon-position/kitchen-sink.html, set the soft wrap to 40 and type long enough and wrong enough to see annotations in a multiline row,
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Pull Request Checklist:
ace.d.ts
) and its references: