# HG changeset patch # User gibus # Date 1359640368 -3600 # Node ID c3df46754007a55856ee184bfd465b1e1582bf5b # Parent f86b611f1876afd1855d3b587859a241fff58887 Fixes crash when editing, apparently when comment spans on multiple text nodes. diff -r f86b611f1876 -r c3df46754007 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: