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

Apply zoom and editorfont updates without needing to restart #1109

Merged
merged 2 commits into from Jan 10, 2019

Conversation

Projects
None yet
2 participants
@CalebJohn
Copy link
Contributor

CalebJohn commented Jan 8, 2019

fixes #1106

This looks like a lot of changes but mostly it just moves a lot of the code into the addExtraStyles function.
Most notable is the changes to line 207-211 of theme.js

@laurent22

This comment has been minimized.

Copy link
Owner

laurent22 commented Jan 9, 2019

Thanks, very useful change as always. Only remark is that if the theme cache now depends on the zoom and font size, the cache key should be derived from it. For example:

const cacheKey = [theme, zoomRatio, editorFontSize].join('-');
if (cacheKey[cacheKey]) // etc...

That way we don't need to have extra checks within the if condition - either the cache is a match or it's not. Then below:

themeCache_[cacheKey] = output;
return themeCache_[cacheKey];

@CalebJohn CalebJohn force-pushed the CalebJohn:no-restart branch from 396a5b3 to a4e559d Jan 9, 2019

@CalebJohn CalebJohn force-pushed the CalebJohn:no-restart branch from a4e559d to 31be14a Jan 9, 2019

@CalebJohn

This comment has been minimized.

Copy link
Contributor

CalebJohn commented Jan 9, 2019

Excellent suggestion, I've updated now (using exactly what you described).

@laurent22

This comment has been minimized.

Copy link
Owner

laurent22 commented Jan 10, 2019

Perfect, thanks @CalebJohn!

@laurent22 laurent22 merged commit b4e9fb1 into laurent22:master Jan 10, 2019

1 check passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details

@CalebJohn CalebJohn deleted the CalebJohn:no-restart branch Jan 10, 2019

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