Skip to content

Commit 0ffd247

Browse files
committed
Explicitly require textmate theme
Apparently Ace (Brace) editor uses TextMate color scheme by default and we used to rely on this. However, if no theme is imported explicitly, Ace will try to dynamically fetch it and will end up with 404 error in browser's console, since we don't have the file and everything in bundled in one file.
1 parent 3ae2df2 commit 0ffd247

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/components/NewSnippet.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import Tags from 'react-tagging-input';
55

66
import brace from 'brace';
77
import 'brace/ext/modelist';
8+
import 'brace/theme/textmate';
89

910
import Title from './common/Title';
1011
import ListBoxWithSearch from './ListBoxWithSearch';
@@ -107,6 +108,7 @@ class NewSnippet extends React.Component {
107108
width="100%"
108109
height="100%"
109110
focus
111+
theme="textmate"
110112
setOptions={{
111113
showFoldWidgets: false,
112114
useWorker: false,

src/components/Snippet.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import React from 'react';
22
import { connect } from 'react-redux';
33
import AceEditor from 'react-ace';
44

5+
import 'brace/theme/textmate';
6+
57
import Title from './common/Title';
68
import Spinner from './common/Spinner';
79
import * as actions from '../actions';
@@ -76,6 +78,7 @@ class Snippet extends React.Component {
7678
mode={snippet.get('syntax')}
7779
width="100%"
7880
height="100%"
81+
theme="textmate"
7982
setOptions={{
8083
readOnly: true,
8184
highlightActiveLine: false,

0 commit comments

Comments
 (0)