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

                                @show_suggestion()
                                return true
                            else
                                # Switch throught the suggestions
                                if event.shiftKey
                                    @current_highlighted_suggestion--

        # 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
                @written_suggestion = suggestion_to_write+')'
            else
                @codemirror.setValue @query_first_part+suggestion_to_write+@query_last_part
                @written_suggestion = suggestion_to_write
    
            @codemirror.focus() # Useful if the user used the mouse to select a suggestion
            @codemirror.setCursor
