Method: Deleted#split_at_org!

Defined in:
lib/merge3.rb

#split_at_org!(pos) ⇒ Object



725
726
727
728
729
730
731
732
733
734
735
736
# File 'lib/merge3.rb', line 725

def split_at_org! pos
  raise "position not in chunk #{pos} : #{self}" unless org_includes?( pos )
  left_length = pos - @from 
  right_length = org_stop - pos 
  right = Deleted.new( @start + left_length , pos , @str[left_length, @length]  )
  raise "Back to the right drawingboard #{self} , #{right} :#{pos}" if right.length != right_length
  @str = @str[0, left_length]
  @length = @str.length 
  raise "Back to the left drawingboard #{self} , #{right} :#{pos} :#{left_length}" if @length != left_length
  raise "Error nil string =#{start} length=#{length} str=-#{@str}=" if @str.nil?
  return right
end