         # Handle events on codemirror
         # Return true if we want code mirror to ignore the event
         handle_keypress: (editor, event) =>
+            if @ignored_next_keyup is true
+                if event?.type is 'keyup' and event?.which isnt 9
+                    @ignored_next_keyup = false
+                return true
+
             @prototype.focus_on_codemirror = true
 
             # Let's hide the tooltip if the user just clicked on the textarea. We'll only display later the suggestions if there are (no description)

        # Write the suggestion in the code mirror
        write_suggestion: (args) =>
            suggestion_to_write = args.suggestion_to_write
            if suggestion_to_write[suggestion_to_write.length-1] is '(' and @count_not_closed_brackets('(') >= 0
                @codemirror.setValue @query_first_part+suggestion_to_write+')'+@query_last_part
            else
                @codemirror.setValue @query_first_part+suggestion_to_write+@query_last_part
    
            @codemirror.focus() # Useful if the user used the mouse to select a suggestion
            @codemirror.setCursor


            @current_suggestions = []
            @current_element = ''
            @written_suggestion = null
            @cursor_for_auto_completion = @codemirror.getCursor()

            result =
