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

Moved Text Editor config var into commands.ts #7350

Merged
merged 1 commit into from Oct 15, 2019

Conversation

ajbozarth
Copy link
Contributor

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 a var not a const 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, and Match Brackets are no longer reset to their default found in CodeEditor.defaultConfig when a change to editorConfig in the settingRegistry is made (eg. changing tab or font sizes).

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.
@jupyterlab-dev-mode
Copy link

Thanks for making a pull request to JupyterLab!

To try out this branch on binder, follow this link: Binder

@jasongrout jasongrout added the tag:Backport This PR is slated to be backported after it is merged. label Oct 13, 2019
@jasongrout jasongrout added this to the 2.0 milestone Oct 13, 2019
@jasongrout
Copy link
Contributor

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 jasongrout removed the tag:Backport This PR is slated to be backported after it is merged. label Oct 14, 2019
@ajbozarth
Copy link
Contributor Author

@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

@jasongrout
Copy link
Contributor

Looks good and works for me. Thanks!

@jasongrout jasongrout merged commit 4fab41a into jupyterlab:master Oct 15, 2019
@jasongrout
Copy link
Contributor

@meeseeksdev backport to 1.x

meeseeksmachine pushed a commit to meeseeksmachine/jupyterlab that referenced this pull request Oct 15, 2019
jasongrout added a commit that referenced this pull request Oct 15, 2019
…0-on-1.x

Backport PR #7350 on branch 1.x (Moved Text Editor config var into commands.ts)
@ajbozarth ajbozarth deleted the bugfixv2 branch October 15, 2019 04:23
@lock lock bot added the status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label Nov 14, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Nov 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants