adding an option to delete arbitrary operations
This commit is contained in:
		
							parent
							
								
									672696ef86
								
							
						
					
					
						commit
						d93aa8a2ba
					
				
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							@ -59,6 +59,10 @@ module.exports = (HB)->
 | 
				
			|||||||
    deleteAllObservers: ()->
 | 
					    deleteAllObservers: ()->
 | 
				
			||||||
      @event_listeners = []
 | 
					      @event_listeners = []
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    delete: ()->
 | 
				
			||||||
 | 
					      (new types.Delete undefined, @).execute()
 | 
				
			||||||
 | 
					      null
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    #
 | 
					    #
 | 
				
			||||||
    # Fire an event.
 | 
					    # Fire an event.
 | 
				
			||||||
    # TODO: Do something with timeouts. You don't want this to fire for every operation (e.g. insert).
 | 
					    # TODO: Do something with timeouts. You don't want this to fire for every operation (e.g. insert).
 | 
				
			||||||
 | 
				
			|||||||
@ -127,6 +127,7 @@ module.exports = (HB)->
 | 
				
			|||||||
        o = @beginning.next_cl
 | 
					        o = @beginning.next_cl
 | 
				
			||||||
        result = []
 | 
					        result = []
 | 
				
			||||||
        while o isnt @end
 | 
					        while o isnt @end
 | 
				
			||||||
 | 
					          if not o.isDeleted()
 | 
				
			||||||
            result.push o.val()
 | 
					            result.push o.val()
 | 
				
			||||||
          o = o.next_cl
 | 
					          o = o.next_cl
 | 
				
			||||||
        result
 | 
					        result
 | 
				
			||||||
@ -183,7 +184,7 @@ module.exports = (HB)->
 | 
				
			|||||||
          break
 | 
					          break
 | 
				
			||||||
        d = (new types.Delete undefined, o).execute()
 | 
					        d = (new types.Delete undefined, o).execute()
 | 
				
			||||||
        o = o.next_cl
 | 
					        o = o.next_cl
 | 
				
			||||||
        while not (o instanceof types.Delimiter) and o.isDeleted()
 | 
					        while (not (o instanceof types.Delimiter)) or o.isDeleted()
 | 
				
			||||||
          o = o.next_cl
 | 
					          o = o.next_cl
 | 
				
			||||||
        delete_ops.push d._encode()
 | 
					        delete_ops.push d._encode()
 | 
				
			||||||
      @
 | 
					      @
 | 
				
			||||||
 | 
				
			|||||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user