/**
 * New paste page
 * --------------
 */
$(function(){

    var ace_editor = $('.editor').data('ace_editor');

    if (!ace_editor)
    {
        return;
    }

    /**
     * ### Switching source syntax in ACE
     */
    $('.type-specific.source :input[name$="[syntax]"]')
        .bind('change.ace', function(){
            ace_editor.setOption('mode', $(this).val());
        })
        .trigger('change.ace')
    ;


    /**
     * ### Switching colour scheme in ACE
     */
    $('.type-specific.source :input[name$="[colour_scheme]"]')
        .bind('change.ace', function(){
            ace_editor.setOption(
                'theme',
                $(this).val()
                    .replace(/ace-/, '')
                    .replace(/-/g, '_')
            );
        })
        .trigger('change.ace')
    ;


    /**
     * ### Toggling line numbers in ACE
     */
    $('.type-specific.source :input[name$="[line_numbers]"]')
        .bind('change.ace', function(){
            ace_editor.setOption('gutter', $(this).is(':checked') ? 'true' : 'false');
        })
        .trigger('change.ace')
    ;

});


@@ -288,32 +288,44 @@
 bind('change.ace
+ keydown.ace
 ', function()%7B%0A 
@@ -311,34 +311,36 @@
 n.ace', function
+ 
 ()
+ 
 %7B%0A            ac
@@ -570,32 +570,44 @@
 bind('change.ace
+ keydown.ace
 ', function()%7B%0A 
@@ -593,34 +593,36 @@
 n.ace', function
+ 
 ()
+ 
 %7B%0A            ac

change ACE theme ans hightlight also on keydown