@@ -29,6 +29,7 @@ import 'codemirror/addon/search/jump-to-line';
2929import 'codemirror/addon/edit/matchbrackets' ;
3030import 'codemirror/addon/edit/closebrackets' ;
3131import 'codemirror/addon/selection/mark-selection' ;
32+ import 'codemirror-colorpicker' ;
3233
3334import { JSHINT } from 'jshint' ;
3435import { CSSLint } from 'csslint' ;
@@ -124,6 +125,10 @@ class Editor extends React.Component {
124125 '-W041' : false ,
125126 esversion : 7
126127 }
128+ } ,
129+ colorpicker : {
130+ type : 'sketch' ,
131+ mode : 'edit'
127132 }
128133 } ) ;
129134
@@ -149,7 +154,12 @@ class Editor extends React.Component {
149154 [ `${ metaKey } -F` ] : 'findPersistent' ,
150155 [ `${ metaKey } -G` ] : 'findPersistentNext' ,
151156 [ `Shift-${ metaKey } -G` ] : 'findPersistentPrev' ,
152- [ replaceCommand ] : 'replace'
157+ [ replaceCommand ] : 'replace' ,
158+ // Cassie Tarakajian: If you don't set a default color, then when you
159+ // choose a color, it deletes characters inline. This is a
160+ // hack to prevent that.
161+ [ `${ metaKey } -K` ] : ( cm , event ) =>
162+ cm . state . colorpicker . popup_color_picker ( { length : 0 } )
153163 } ) ;
154164
155165 this . initializeDocuments ( this . props . files ) ;
0 commit comments