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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clip cursor width when soft-wrap is on and cursor is at the end of a line #16943

Merged
merged 1 commit into from Mar 20, 2018

Conversation

Projects
None yet
2 participants
@as-cii
Member

as-cii commented Mar 13, 2018

Description of the Change

This pull request prevents the parent tile from disabling sub-pixel anti-aliasing by clipping the cursor width to be fully contained within the editor when soft-wrap is on and the cursor is at the end of a line. For some reason, adding overflow: hidden to the cursor container element doesn't solve the issue, so we're adding this workaround instead.

Alternate Designs

Unclear.

Verification Process

  • Enable soft-wrap
  • Keep writing until reaching the end of the line (without wrapping to the next line)
  • Notice how sub pixel anti-aliasing doesn't break anymore
Before After
before after

Applicable Issues

Fixes #16889

/cc: @Ben3eeE @50Wliu can you confirm this pull request fixes it? Thanks! 馃檱

Clip cursor width when soft-wrap is on and cursor is at the end of line
This prevents the parent tile from disabling sub-pixel anti-aliasing.
For some reason, adding `overflow: hidden` to the cursor container
element doesn't solve the issue, so we're adding this workaround
instead.
@Ben3eeE

This comment has been minimized.

Member

Ben3eeE commented Mar 13, 2018

@as-cii I can still reproduce this issue when the cursor is on the very edge of the window.

Before:
Subpixel AA is lost when the cursor is near the edge of the window
subpixel aa loss softwrap before

After:
I can move the cursor to this position but when adding another a subpixel AA is lost
subpixel aa loss softwrap after

@Ben3eeE

This comment has been minimized.

Member

Ben3eeE commented Mar 13, 2018

Possibly unrelated but I also noticed that changing tabs when the cursor is in this position causes the editor to scroll horizontally:

scrolled with soft wrap

@as-cii

This comment has been minimized.

Member

as-cii commented Mar 20, 2018

@Ben3eeE thanks for the feedback! 馃挴 We should pair on this sometime, as I can't reproduce the problem anymore on my machine unfortunately.

@Ben3eeE

This comment has been minimized.

Member

Ben3eeE commented Mar 20, 2018

@as-cii What do you think about merging this for now but not closing the issue? This PR does make it a lot better and the issue I mentioned in #16943 (comment) can be reproduced on master so it's unrelated to this PR.

I'm up for pairing to fix these two issues.

@as-cii

This comment has been minimized.

Member

as-cii commented Mar 20, 2018

Sounds good, thanks for the feedback @Ben3eeE! Can you open a separate issue describing the problem?

@as-cii as-cii merged commit d5c74c7 into master Mar 20, 2018

3 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@as-cii as-cii deleted the as-fix-subpixel-aa-when-soft-wrap-is-on branch Mar 20, 2018

@Ben3eeE

This comment has been minimized.

Member

Ben3eeE commented Mar 20, 2018

Opened #16996
Reopened #16889 and moved it to the backlog

@Ben3eeE Ben3eeE referenced this pull request Mar 20, 2018

Closed

Loss of subpixel AA on soft-wrapped line #16889

1 of 1 task complete

@jasonrudolph jasonrudolph referenced this pull request May 8, 2018

Merged

Upgrade to Electron 2.0.0 #17273

60 of 60 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment