[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sup-devel] [PATCH] Use multiple body arrays when calling before-edit for each reply type



Hi Rich,

Excerpts from Rich Lane's message of Fr Mär 12 05:20:52 +0100 2010:
> lib/sup/modes/reply-mode.rb:
> > +      @bodies[k] = Array.new(body)
> 
> Why is the body in an array?
That was left over while refactoring. It isn’t necessary.

> The idiomatic way to write this is:
> self.body = @bodies[@type_selector.val] unless @edited
Alright, changed.

> lib/sup/modes/reply-mode.rb:
> > +    if new_body != @bodies[@type_selector.val]
> > +      @bodies[@type_selector.val] = new_body
> > +      @edited = true
> > +    end
> 
> Is there a reason we can't do this unconditionally?
Yes, I wanted to avoid setting the @edited flag if the user exited the editor
without making any changes. That way, he can benefit from the changing bodies
for a longer time.

Updated patch attached.

Best regards,
Michael

Attachment: 0001-Use-multiple-body-arrays-when-calling-before-edit-fo.patch
Description: Binary data

_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel