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
Moved Text Editor config var into commands.ts #7350
Conversation
After further testing od my previous pr jupyterlab#7332 I discovered that the core issue was that config was a var not a const. So the commands were using the value of config at creation in thier updates rather than it's value at runtime.
Thanks for making a pull request to JupyterLab! To try out this branch on binder, follow this link: |
This still doesn't work for me. Again, I think it has to do with the View menu commands changing the editor instance config, not the global current config used for all editors (see #7295 (comment)) |
@jasongrout did you completely clean your build like I mentioned in the Issue? I'm just trying to figure out why you're see different results than my team and I. If you could share the steps you took to test this it would help me figure things out. As for the comment you linked. The View Menu commands do only change the current instance and do not update the settings registry like other commands, but if that was the origin of the bug then it would also exist in v1.1.4 which it doesn't. We can change that as well but it wouldn't fix the bug |
Looks good and works for me. Thanks! |
@meeseeksdev backport to 1.x |
…0-on-1.x Backport PR #7350 on branch 1.x (Moved Text Editor config var into commands.ts)
References
This addresses the issue in #7295 and replaces the previous pr #7332
Code changes
After further testing of my previous pr #7332 I discovered that the core issue was that
config
was avar
not aconst
and was updated through out the life of an editor. So the commands were using the value of config at creation, as it was passed to their creation functions, in their updates rather than its value when the command is triggered.I solved this by moving the config var and the helper functions that interact with it into
commands.ts
User-facing changes
The setting for
Line Numbers
,Word Wrap
, andMatch Brackets
are no longer reset to their default found inCodeEditor.defaultConfig
when a change toeditorConfig
in thesettingRegistry
is made (eg. changing tab or font sizes).