@@ -62,13 +62,12 @@ define(function (require, exports, module) {
6262 */
6363 function _getAllColorsAndLineNums ( editor ) {
6464
65- const cm = editor . _codeMirror ;
66- const nLen = cm . lineCount ( ) ;
65+ const nLen = editor . lineCount ( ) ;
6766 const aColors = [ ] ;
6867
6968 // match colors and push into an array
7069 for ( let i = 0 ; i < nLen ; i ++ ) {
71- let lineText = cm . getLine ( i ) ;
70+ let lineText = editor . getLine ( i ) ;
7271
7372 if ( ( lineText . indexOf ( '/*' ) !== - 1 ) || ( lineText . indexOf ( '*/' ) !== - 1 ) ) {
7473 continue ;
@@ -147,25 +146,24 @@ define(function (require, exports, module) {
147146
148147 /**
149148 * To move the cursor to the color text and display the color quick edit
150- * @param {Editor } codem the codemirror instance
149+ * @param {CodeMirror } codeMirror the codemirror instance
151150 * @param {Number } lineNumber the line number that is clicked
152151 * @param {String } gutter the gutter name
153152 */
154- function colorIconClicked ( codem , lineNumber , gutter ) {
153+ function colorIconClicked ( codeMirror , lineNumber , gutter ) {
155154 const editor = EditorManager . getActiveEditor ( ) ;
156- const cm = editor . _codeMirror ;
157155
158- if ( gutter === 'CodeMirror-linenumbers' ) {
156+ if ( gutter === GUTTER_NAME ) {
159157
160158 let colorValue ;
161159
162- for ( let i of codem . colorGutters ) {
160+ for ( let i of codeMirror . colorGutters ) {
163161 if ( i . lineNumber === lineNumber ) {
164162 colorValue = i . colorValues [ 0 ] ;
165163 }
166164 }
167165
168- const lineText = cm . getLine ( lineNumber ) ;
166+ const lineText = editor . getLine ( lineNumber ) ;
169167 const colorIndex = lineText . indexOf ( colorValue ) ;
170168
171169 if ( colorIndex !== - 1 ) {
@@ -196,8 +194,8 @@ define(function (require, exports, module) {
196194 editor . clearGutter ( GUTTER_NAME ) ; // clear color markers
197195 _addDummyGutterMarkerIfNotExist ( editor , editor . getCursorPos ( ) . line ) ;
198196
199- cm . on ( "gutterClick" , ( codem , lineNumber , gutter ) => {
200- colorIconClicked ( codem , lineNumber , gutter ) ;
197+ cm . on ( "gutterClick" , ( codeMirror , lineNumber , gutter ) => {
198+ colorIconClicked ( codeMirror , lineNumber , gutter ) ;
201199 } ) ;
202200
203201 // Only add markers if enabled
0 commit comments