On Jul 23, 3:59 pm, Nick_H <[email protected]> wrote: > I'm working with Leo 4.7.1 final (build 3005, dated 26 Feb 2010) and > just noticed a bug in propagate_changed_lines within leoShadow.py. > I haven't worked out the complete fix for this, but thought I'd > mention it now so that others don't stumble over it unawares. > It's the handling of the 'replace' tag (new code dated 7 Jan 2010) > which does not handle the case when the number of new lines is > different from the number of old lines. In fact the number of new > lines can be either greater or less than the number of old lines, so > the code needs a little more complexity to deal with this. Currently > it only replaces the same number of lines as were in the old file. > There's an added twist in that if sentinels occur in the middle of the > old lines, it won't be clear how to distribute the new lines on either > side of the sentinels. > I'll comment further when I've thought about this some more, but for > now, this is just a road cone to mark the spot. > > Best regards > > Nick
After a little more thought, I suspect that the simple approach is likely to be the best, at least initially. I'd suggest placing a condition (if new_public_lines_rdr.index() < new_j) on the copying of new public lines to new private lines, then finishing off with a loop copied from the 'insert' tag above -- (while new_public_lines_rdr.index() < new_j ...). I'm not in a position to get involved with direct editing of the code within SourceForge, but I contribute these thoughts in the hope that an active contributor may be able to make something of them. Best regards, again Nick -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en.
