             @_readHtml()
             # 4 - update the index
             @_history.index -= 1
+            console.log 'undo', @_history.index
 
     ### -------------------------------------------------------------------------
     #  reDo :
     # Redo a undo-ed action
     ###
     reDo : () ->
+        
         # if there is an action to redo
         if @redoPossible()
             # restore newPosition

                    @updateCurrentSelIsStartIsEnd()
                    @_return()
                    @newPosition = false
                    throw 666
                    e.preventDefault()
                when '-backspace'
                    @updateCurrentSelIsStartIsEnd()

     * No effect if the url popover is displayed
    ###
    _addHistory : () ->
        console.log '_addHistory' , @_history.historyPos.length, @_history.historyPos
        # do nothing if urlpopover is on, otherwise its html will also be 
        # serialized in the history.
        if @isUrlPopoverOn
            return

        # 0- prepare history arrays in case of some undo habe been done
        if @_history.index < 99
            i = 99 - @_history.index
            while i--
                @_history.historySelect.pop()
                @_history.historyScroll.pop()
                @_history.historyPos.pop()
                @_history.history.pop()
                @_history.historySelect.unshift(undefined)
                @_history.historyScroll.unshift(undefined)
                @_history.historyPos.unshift(undefined)
                @_history.history.unshift(undefined)

        # 1- mark selection
        savedSel = @saveEditorSelection()
        
        # 2- save html selection
        @_history.historySelect.push savedSel
        
        # 3- save scrollbar position
        savedScroll =
            xcoord: @linesDiv.scrollTop
            ycoord: @linesDiv.scrollLeft
        @_history.historyScroll.push savedScroll
        
        # 4- save newPosition flag
        @_history.historyPos.push @newPosition
        
        # 5- add the html content with markers to the history
        @_history.history.push @linesDiv.innerHTML
        
        # 6- update the index
        # @_history.index = @_history.history.length - 1
        @_history.index = 99

        # 7- if history is too long, drop 10 last positions
        @_history.historySelect.shift()
        @_history.historyScroll.shift()
        @_history.historyPos.shift()
        @_history.history.shift()


    ### -------------------------------------------------------------------------
    #  undoPossible
    # Return true only if unDo can be called
    ###
    undoPossible : () ->
        i = @_history.index
        return (i > 0 && @_history.historyPos[i] != undefined )

    ### -------------------------------------------------------------------------
    #  redoPossible
