                         query_after_cursor += query_lines[i]
             @query_last_part = query_after_cursor
 
+            @current_element = '' # Initialize @current_element. We need it for tabs (when the user loop over ALL suggestions)
             stack = @extract_data_from_query
                 query: query_before_cursor
                 position: 0

                lineNumbers: true
                lineWrapping: true
                matchBrackets: true
            @codemirror.on 'blur', @on_blur
            @codemirror.on 'gutterClick', @handle_gutter_click


                else if event.which is 9
                    event.preventDefault()
                    if event.type is 'keydown'
                        if @current_suggestions?.length > 0
                            if @$('.suggestion_name_list').css('display') is 'none'
                                @show_suggestion()
                                return true
                            else
                                # Switch throught the suggestions
                                if event.shiftKey
                                    @current_highlighted_suggestion--
                                    if @current_highlighted_suggestion < -1
                                        @current_highlighted_suggestion = @current_suggestions.length-1
                                    else if @current_highlighted_suggestion < 0
                                        @show_suggestion_without_moving()
                                        @remove_highlight_suggestion()
                                        @write_suggestion
                                            suggestion_to_write: @current_element
                                        @ignore_tab_keyup = true # If we are switching suggestion, we don't want to do anything else related to tab
                                        return true
                                else
                                    @current_highlighted_suggestion++
                                    if @current_highlighted_suggestion >= @current_suggestions.length
                                        @show_suggestion_without_moving()
                                        @remove_highlight_suggestion()
                                        @write_suggestion
                                            suggestion_to_write: @current_element
                                        @ignore_tab_keyup = true # If we are switching suggestion, we don't want to do anything else related to tab
                                        @current_highlighted_suggestion = -1
                                        return true
                                if @current_suggestions[@current_highlighted_suggestion]?
                                    @show_suggestion_without_moving()
                                    @highlight_suggestion @current_highlighted_suggestion # Highlight the current suggestion
                                    @write_suggestion
                                        suggestion_to_write: @current_suggestions[@current_highlighted_suggestion] # Auto complete with the highlighted suggestion
                                    @ignore_tab_keyup = true # If we are switching suggestion, we don't want to do anything else related to tab
                                    return true
                # If the user hit enter and (Ctrl or Shift)
                else if event.which is 13 and (event.shiftKey or event.ctrlKey or event.metaKey)
                    @hide_suggestion_and_description()
