         # This means that in case of multiple return, only the first one is in
         # history. A letter such as 'a' doesn't increase the history.
 
+        console.log '== keyDownCb() : shortcut', shortcut, '_lastKey', @_lastKey, 'isAction', @_shortcut.isAction, 'newPosition', @newPosition
         if @_lastKey != shortcut and \
                shortcut in ['-return', '-backspace', '-suppr',
                             'CtrlShift-down', 'CtrlShift-up',
                             'CtrlShift-left', 'CtrlShift-right',
-                            'Ctrl-V', '-space', '-other']
+                            'Ctrl-V']
+            console.log 'cas1'
             @_addHistory()
 
+        else if @_lastKey == '-space' && shortcut != '-space'
+            console.log 'cas2'
+            @_addHistory()
+
+        else if @newPosition and !@_shortcut.isAction and shortcut != 'Ctrl-Y' and shortcut != 'Ctrl-Z'
+            console.log 'cas3'
+            @_addHistory()
 
         @_lastKey = shortcut
 

            if @_hotString.isPreparing
                @_hotString.reset(false)
            @_forceUndo()

    _forceUndo : () ->
        h = @_history
        # if we are in an unsaved state
        if h.index == h.history.length-1


        # 6- add the list of task modified since last addHistory()
        h.modifiedTask.push @_tasksModifSinceLastHistory
        # console.log '  last h.modifiedTask', h.modifiedTask[@HISTORY_SIZE]
        @_tasksModifSinceLastHistory = {}

        # 7- update the index
        h.index = @HISTORY_SIZE - 1
