dcorking / google-wave-resources

Automatically exported from code.google.com/p/google-wave-resources
0 stars 0 forks source link

insert() at the end of a blip could use append() #814

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
When trying to insert() an element in a blip, it fails when the position of 
insertion is the last position in the blip (or if the blip has no element yet). 
This forces developers to check for the position against the size of the blip.

One solution could be that blip.at(pos).insert() checks if pos is the last 
position in the blip, and calls blip.append() in this case.

Original issue reported on code.google.com by raph...@gmail.com on 25 Jun 2010 at 8:40

GoogleCodeExporter commented 8 years ago
One way around this is to do:

   at(max(len(blip.text)), pos)).insert(...)

which catches the case of trying to insert past the end of the blip.

Original comment by joe.gregorio@gmail.com on 8 Jul 2010 at 12:59