<commit_before>var CodeCommand = function() {

    var $chatForm = $("#chatForm");
    var $codeForm = $("#codeForm");
    var $inputMessage = $("#inputMessage");
    var $codeInput = $("#codeInput")

    ChatCommand.on("receiveMessage", function (chatMessage) {
        if (chatMessage.isCode){
            var $lastMessage = $(".messageBlock .message p").last();
            $lastMessage.wrap("<pre></pre>");
            hljs.highlightBlock($lastMessage[0]);
        }
    });

    $("#codeSubmit").click(function(){
        toggleInputMode();

        var code = $codeInput.val().trim();

        if (code) {
            ChatCommand.emit('newMessage', {
                messageContent: code,
                userEmail: ChatCommand.getUserEmail(),
                isCode: true
            });
            $codeInput.val("");
            $inputMessage.focus();
        }
    });

    function toggleInputMode() {
        $chatForm.toggle();
        $codeForm.toggle();
        $codeInput.focus();
    }

    return {
        execute: function (code) {
            toggleInputMode();
        }
    }

}();<commit_msg>fixed refresh problem with !code, resolves #53<commit_after>var CodeCommand = function() {

    var $chatForm = $("#chatForm");
    var $codeForm = $("#codeForm");
    var $inputMessage = $("#inputMessage");
    var $codeInput = $("#codeInput")

    ChatCommand.on("receiveMessage", function (chatMessage) {
        if (chatMessage.isCode){
            var $lastMessage = $(".messageBlock .message p").last();
            $lastMessage.wrap("<pre></pre>");
            hljs.highlightBlock($lastMessage[0]);
        }
    });

    $("#codeSubmit").click(function(event){
        toggleInputMode();

        var code = $codeInput.val().trim();

        if (code) {
            ChatCommand.emit('newMessage', {
                messageContent: code,
                userEmail: ChatCommand.getUserEmail(),
                isCode: true
            });
            $codeInput.val("");
            $inputMessage.focus();
        }

        event.preventDefault();
    });

    function toggleInputMode() {
        $chatForm.toggle();
        $codeForm.toggle();
        $codeInput.focus();
    }

    return {
        execute: function (code) {
            toggleInputMode();
        }
    }

}();
{'fraction_non_alphanumeric': 0.16095444685466379, 'fraction_numerical': 0.0017353579175704988, 'mean_word_length': 1.9564102564102563, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2130470', 'n_tokens_mistral': 637, 'n_tokens_neox': 611, 'n_words': 113}