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

Assign originalFontSize when the Workspace is initialized #19528

Merged
merged 1 commit into from Jun 14, 2019

Conversation

Projects
None yet
2 participants
@nathansobo
Copy link
Contributor

commented Jun 13, 2019

Fixes #19521

When the Workspace is created, we capture the originalFontSize so that we can restore to it via the window:reset-font-size command.

If we tried to capture this font size in the Workspace's constructor, it would always be assigned to the default because the workspace is constructed before the user's settings are loaded. Previously, we attempted to address this by storing the value when the setting editor.fontSize changed, which would happen when the user settings were loaded. Unfortunately, if the user had their font size assigned to the default size, the setting wouldn't change when their settings were loaded, and we'd never end up capturing the originalFontSize.

In this PR, I go with a different approach. Rather than waiting for the font size to change, I break out an initialize method on Workspace that only gets called after the settings have been loaded. This is a pattern we use with other major objects in the application, so I think it blends in reasonably well.

@vinkla

This comment has been minimized.

Copy link
Contributor

commented Jun 14, 2019

This probably also fix #9873. There was a previous attempt to fix this in #19192.

@nathansobo nathansobo force-pushed the ns/fix-font-size-reset branch from d22cafd to d5604bd Jun 14, 2019

@nathansobo nathansobo merged commit 202a6ff into master Jun 14, 2019

1 check passed

Atom Pull Requests #20190614.10 succeeded
Details

@nathansobo nathansobo deleted the ns/fix-font-size-reset branch Jun 14, 2019

nathansobo added a commit that referenced this pull request Jun 14, 2019

Merge pull request #19528 from atom/ns/fix-font-size-reset
Assign originalFontSize when the Workspace is initialized

nathansobo added a commit that referenced this pull request Jun 14, 2019

Merge pull request #19528 from atom/ns/fix-font-size-reset
Assign originalFontSize when the Workspace is initialized
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.