1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-15 18:56:22 +00:00

new feature: auto detect snippet language

only try to detect after pasting and mode has not been set and default snippet language is "Auto Detect"
This commit is contained in:
HarlanLuo
2019-01-01 16:23:15 +08:00
parent 05da826c24
commit deb2cd0156
5 changed files with 104 additions and 7 deletions

View File

@@ -481,6 +481,7 @@ class UiTab extends React.Component {
ref='editorSnippetDefaultLanguage'
onChange={(e) => this.handleUIChange(e)}
>
<option key='Auto Detect' value='Auto Detect'>Auto Detect</option>
{
_.sortBy(CodeMirror.modeInfo.map(mode => mode.name)).map(name => (<option key={name} value={name}>{name}</option>))
}