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

Configuration edit issues #667

Closed
stdedos opened this issue Dec 1, 2021 · 12 comments
Closed

Configuration edit issues #667

stdedos opened this issue Dec 1, 2021 · 12 comments

Comments

@stdedos
Copy link

stdedos commented Dec 1, 2021

According to https://sublimetext-markdown.github.io/MarkdownEditing/config/#change-configuration

In Main Menu navigate to: Preferences > Package Preferences > MarkdownEditing
In Command Palette look for: Preferences: MarkdownEditing ...

However, both of them open the Sublime-Text-wide settings, not the extension settings.

@deathaxe
Copy link
Member

deathaxe commented Dec 1, 2021

That's correct and expected. All MarkdownEditing related settings are to be added to Packages/User/Preferences.sublime-settings. That's why all of them are prefixed with mde.. As a result all settings can be global/per project/per syntax/per view or different in distraction free mode.

This is described in the very first sentence/paragraph of the linked page.

@stdedos
Copy link
Author

stdedos commented Dec 1, 2021

My bad for reading the page upwards 😅

@stdedos stdedos closed this as completed Dec 1, 2021
@stdedos
Copy link
Author

stdedos commented Dec 1, 2021

One of the reasons I got "confused" with this new kind of settings-handling, was that e.g. MarkdownEditing: Select Color Scheme is not found anywhere in the Preferences > Package Preferences > MarkdownEditing preferences - which I assumed to be the place to find it.

... of course, it being in Packages/User/Markdown.sublime-settings makes more sense, I guess? :/

@deathaxe
Copy link
Member

deathaxe commented Dec 1, 2021

... MarkdownEditing: Select Color Scheme is not found anywhere in ...

The menu item is only visible if a markdown file is open. The command is inherited from base MdeTextCommand, which hides all commands from Command Palette if a view doesn't show a markdown file.

... of course, it being in Packages/User/Markdown.sublime-settings makes more sense, I guess?

No it doesn't, because this is already a syntax specific settings file, which would cause the user settings not to be applied to MultiMarkdown for instance. It would also prevent project specific settings as those are of lower priority than syntax specific ones.

@stdedos
Copy link
Author

stdedos commented Dec 1, 2021

... MarkdownEditing: Select Color Scheme is not found anywhere in ...

The menu item is only visible if a markdown file is open. The command is inherited from base MdeTextCommand, which hides all commands from Command Palette if a view doesn't show a markdown file.

I think the pre-edited response was more fitting (i.e. I was talking about the result of the command, not the command being conditionally hidden)

(but the command being hidden in non-Markdown files was kiiinda confusing too 😅. At least it's done smartly e.g. Settings: MarkdownEditing is not conditional)

@deathaxe
Copy link
Member

deathaxe commented Dec 1, 2021

You talked about "not finding the command in main menu". As the command actually exists in main menu the pre-edited response "Can be added" doesn't fit, technically. It just needs to be made visible unconditionally.

@stdedos
Copy link
Author

stdedos commented Dec 1, 2021

You talked about "not finding the command in main menu".

Maybe I should revise what I've said :-D

-`MarkdownEditing: Select Color Scheme` is not found anywhere in the `Preferences > Package Preferences > MarkdownEditing` preferences
+The result of changing `MarkdownEditing: Select Color Scheme` is not found anywhere in the `Preferences > Package Preferences > MarkdownEditing` preferences (where I'd expect it to be visible)

@deathaxe
Copy link
Member

deathaxe commented Dec 1, 2021

Color schemes are assigned to syntax specific settings (e.g.: Markdown.sublime-settings) as those are not designed for normal source code.

The one and only use of MarkdownEditing: Select Color Scheme is to set color_schem in syntax specific settings. And now that I think about it: that's exactly the reason for the command not to be visible if the active view doesn't display a markdown file. This command would assign one of those color schemes to any (wrong/unwanted) syntax otherwise.

So you'll find the setting when calling Preferences: Edit Settings - Syntax Specific while a markdown file is open.

I could probalby add a mde_edit_settings_syntax_specific command, which displays MDE's Preferences on the left and the Markdown.sublime-settings file on the right, but I can't resolve ST's scattered settings files issues.

@stdedos
Copy link
Author

stdedos commented Dec 1, 2021

No worries then! If it's that complicated/"random" of it working more, then it maybe isn't worth the effort.

Thank you for today's discussions 😄

@0xdevalias
Copy link

0xdevalias commented Dec 11, 2023

That's correct and expected. All MarkdownEditing related settings are to be added to Packages/User/Preferences.sublime-settings. That's why all of them are prefixed with mde.

@deathaxe I'm curious why the main settings were implemented this way, rather than in what seems to be the more standard pattern of having a standalone settings file/user settings file for each plugin (rather than being merged with the main settings).

Personally I prefer this neat 'separation of concerns' rather than needing to clutter up one settings file with unrelated config (which I know isn't a good enough reason to change how it is; but just curious why it was done this way in the first place)

It's also a little confusing that both styles are mixed, as the 'distraction free' settings are in a separate file, not prefixed within the main file.

Edit: Guessing maybe it relates to these?

@deathaxe
Copy link
Member

MarkdownEditing never used package-specific settings. It just changed from syntax-specific to global user settings.

Both Preferences.sublime-settings and Distraction Free.sublime-settings are default settings files defined by Sublime Text.

MarkdownEditing just re-uses those files to locate settings within as this allows all settings to be any of:

  • global
  • project-specific
  • view-specific
  • syntax-specific
  • mode-specific (Distraction Free on/off)

by following ST's default settings files hierarchy (see: https://www.sublimetext.com/docs/settings.html#settings-files)

None of package-specific settings (e.g.: MarkdownEditing.sublime-settings) would satisfy that.

@0xdevalias
Copy link

Hrmm, fair enough. Thanks for the detailed info :)

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

No branches or pull requests

3 participants