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

workspace settings.json gets overwritten by template #19

Closed
omnoms opened this issue Apr 1, 2020 · 2 comments · Fixed by #54
Closed

workspace settings.json gets overwritten by template #19

omnoms opened this issue Apr 1, 2020 · 2 comments · Fixed by #54
Labels
🐛 Bug Something isn't working

Comments

@omnoms
Copy link
Contributor

omnoms commented Apr 1, 2020

Describe the bug

Switching between presentation mode and editing the slides often/quickly enough can cause the settings.json in the workspace to be overwritten by some template. And what is "quickly enough" seems to vary.

This template is inserted instead into the settings.json

{"//a":"This theme is familiar to devs","!a":"You need to install this theme","workbench.colorTheme":"GitHub Clean White","//b":"Minor tweaks to improve contrast & make cursor stands out","workbench.colorCustomizations":{"editorCursor.background":"#ffffff","editorCursor.foreground":"#0000bb","editor.lineHighlightBackground":"#f0f0f0","editor.selectionBackground":"#aaeeff"},"//c":"Clean the screen from unnecessary elements","workbench.statusBar.visible":false,"workbench.activityBar.visible":false,"editor.minimap.enabled":false,"//d":"Just rely on the tabs on top to keep full screen width","explorer.openEditors.visible":0,"//e":"Mimic GitHub style","editor.renderWhitespace":"none","editor.renderIndentGuides":false,"//f":"This is GitHub font style","!f":"You need to install this font on your machine","editor.fontFamily":"Inter","terminal.integrated.fontFamily":"Inter","//h":"Make the text big enough to be comfortable","editor.fontWeight":"600","editor.fontSize":24,"terminal.integrated.fontWeight":"800","terminal.integrated.fontSize":28,"//i":"Rely on a simple shell, avoid fancy configuration","!i":"It's even better if you add `export PS1='\\$ '` to your .bash_profile","terminal.integrated.shell.linux":"/bin/bash","terminal.integrated.shell.osx":"/bin/bash","//j":"Prevent the editor to magically edit code on save","editor.formatOnSave":false,"//k":"Disable preview so we can open all files at once","workbench.editor.enablePreview":false,"slides.previewMarkdownFiles":true}

How to reproduce

Switch "quickly" enough between presentation and editing mode.

Expected behavior

Not to get my workspace settings.json to be overwritten.

Additional information

Slides version: 3.2.1
VSCODE

  • Version: 1.43.2 (user setup)
  • Commit: 0ba0ca52957102ca3527cf479571617f0de6ed50
  • Date: 2020-03-24T07:38:38.248Z
  • Electron: 7.1.11
  • Chrome: 78.0.3904.130
  • Node.js: 12.8.1
  • V8: 7.8.279.23-electron.0
  • OS: Windows_NT x64 10.0.18363
@omnoms omnoms added the 🐛 Bug Something isn't working label Apr 1, 2020
@nicoespeon
Copy link
Owner

Thanks for reporting. That's really not cool indeed 😓

Plus, that shouldn't happen. But I can see how a race condition could appear here and mess things up.

I'll need to think about how to make that robust enough. Or at least, detect if settings are incorrect when we're not in presentation mode. The original settings are usually save in a cache, so the extension could restore them (that's what it normally does when you exit presentation mode).

@darkclouder
Copy link

darkclouder commented Aug 6, 2022

+1 would be a great extension but this issue just messes things up just by itself without any pre-existing settings.json for me.

When I go in presentation mode, the settings.json is created and I need to save it before the presentation mode even takes effect. Then I change the theme because the default theme doesn't exist for me so that results in a weird combination of light and dark mode
Once I get back out of presentation, the settings.json is empty again, hence losing my settings I wanted for the presentation.

Edit: ok, I set the theme in the global settings, but it's still not nice that I need to save settings.json first for it to take effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants