Skip to content

Instantly share code, notes, and snippets.

@jarod022
Created March 2, 2012 16:08
Show Gist options
  • Save jarod022/1959360 to your computer and use it in GitHub Desktop.
Save jarod022/1959360 to your computer and use it in GitHub Desktop.
Highlighting the current gutter for CordeMirror
function highlightingCurrentGutter(editor){
var $collection_pre = $(editor.getGutterElement()).find('pre');
$collection_pre.removeClass('active-gutter');
$($collection_pre[editor.getCursor().line]).addClass('active-gutter');
}
/* exemple d'utilisation */
html_editor = CodeMirror.fromTextArea(html_code, {
lineNumbers: true,
matchBrackets: true,
onCursorActivity: function() { highlightingCurrentGutter(html_editor); },
mode:
{
name: 'xml',
json: true
},
indentUnit: 2,
theme: 'html',
onKeyEvent: sendCodeToRendu
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment