Add support for more clike languages

main
Jake Dexheimer 7 years ago committed by Jake Dexheimer
parent 93c0214081
commit 7bfa2ef621

@ -61,7 +61,7 @@ class Carbon extends React.Component {
LANGUAGE_MODE_HASH[detectedLanguage] || LANGUAGE_NAME_HASH[detectedLanguage]
if (languageMode) {
this.setState({ language: languageMode.mime ? languageMode.mime : languageMode.mode })
this.setState({ language: languageMode.mime || languageMode.mode })
}
} else {
this.setState({ language: props.config.language })

@ -79,7 +79,21 @@ export const LANGUAGES = [
},
{
name: 'C',
mode: 'clike'
mode: 'clike',
mime: 'text/x-csrc',
short: 'c'
},
{
name: 'C++',
mode: 'clike',
mime: 'text/x-c++src',
short: 'cpp'
},
{
name: 'C#',
mode: 'clike',
mime: 'text/x-csharp',
short: 'cs'
},
{
name: 'Clojure',
@ -157,6 +171,12 @@ export const LANGUAGES = [
name: 'HTML',
mode: 'htmlmixed'
},
{
name: 'Java',
mode: 'clike',
mime: 'text/x-java',
short: 'java'
},
{
name: 'JavaScript',
mode: 'javascript'
@ -200,6 +220,12 @@ export const LANGUAGES = [
mode: 'nimrod',
custom: true
},
{
name: 'Objective C',
mode: 'clike',
mime: 'text/x-objectivec',
short: 'objectivec'
},
{
name: 'Pascal',
mode: 'pascal'
@ -234,7 +260,9 @@ export const LANGUAGES = [
},
{
name: 'Scala',
mode: 'clike'
mode: 'clike',
mime: 'text/x-scala',
short: 'scala'
},
{
name: 'Smalltalk',

@ -112,7 +112,7 @@ class Editor extends React.Component {
<Dropdown
list={LANGUAGES}
onChange={language =>
this.setState({ language: language.mime ? language.mime : language.mode })}
this.setState({ language: language.mime || language.mode })}
/>
<ColorPicker
onChange={color => this.setState({ background: color })}

Loading…
Cancel
Save