Fixes crash when editing, apparently when comment spans on multiple text nodes.
authorgibus
Thu, 31 Jan 2013 14:52:48 +0100
changeset 496 c3df46754007
parent 495 f86b611f1876
child 497 b478eb3f1a0d
Fixes crash when editing, apparently when comment spans on multiple text nodes.
src/cm/utils/comment_positioning.py
--- a/src/cm/utils/comment_positioning.py	Mon Jan 28 13:47:29 2013 +0100
+++ b/src/cm/utils/comment_positioning.py	Thu Jan 31 14:52:48 2013 +0100
@@ -65,8 +65,10 @@
     for cc in commentList:        
         if cc.valid:
             for id in xrange(len(span_starts_new.keys())):
-                start = span_starts_new.get(id)
+                if (span_starts_new.get(id)):
+                start = span_starts_new.get(id, 0)
                 end = span_starts_new.get(id+1, sys.maxint)
+                if (not(start) and cc.computed_start_offset >= start and cc.computed_start_offset < end):
 
                 # adjust start                
                 if cc.computed_start_offset >= start and cc.computed_start_offset < end: