Add a default language setting
This commit introduces the ability to set and use a default programming language for new editor blocks. Key changes include:
- Adding a sorted list of languages and a
defaultLanguagesetting in the configuration. - Propagating the
defaultLanguagesetting to relevant components and functions. - Enabling users to select and update the default language in the settings UI.
This fixes #61
I would wait to merge #85 before merging this, so it can already be up to date with the various block creation possibilities. Maybe also #102 in order to unify the settings.
As for the text reverting back to plain text, I guess we could only append -a at the end of a new block if the default language is set to Plain Text.
I think it makes sense to be able to change the default mode for newly created blocks but still have auto-detection turned on for them (but we should have a setting for this).
I also think it makes sense for an auto block that is emptied (e.g. uses presses Ctrl-A Backspace) to change its language back to the default. Therefore, I think we should make sure that we revert back to the default - instead of always text - to resolve the issue of blocks getting reverted back to Plain Text (if that is the issue, I haven't confirmed it).
Isn't the issue that it reverts to Plain Text too early, while there aren't enough characters for the "syntax matcher" to work properly ?
Isn't the issue that it reverts to Plain Text too early, while there aren't enough characters for the "syntax matcher" to work properly ?
When a block is "cleared" (e.g. the user press Ctrl-A Backspace) I think it makes sense that the block reverts back to the default mode immediately (for auto blocks that is).