Excerpts from William Morgan's message of Sun Aug 23 10:55:59 -0700 2009: > Reformatted excerpts from Carl Worth's message of 2009-08-19: > > Specifically, scroll as little as possible to get the current message > > to just fit on the right side. > > Is this the same as setting loose_alignment to true, and the > IDEAL_*_CONTENTs to 0?
I don't think so.
Doing that, (at least as in the below patch, for example), always puts
the current message flush left. And that can result in later messages
in the threads, (not descendants of the current thread though), being
cut off on the left. (And all this with dozens of empty columns on the
right of my terminal.) That's precisely the behavior I was getting
before my patch and which I'm trying to change.
What I want instead is for the message to appear in its "natural"
position (according to the threading), unless that would cause the
message to be cut off on the right. In which case, we jump to the
minimum column such that:
1. We don't cut any of the current message off on the left
2. We display all of the message on the right, (if possible
without violating point 1).
I believe that what I've coded achieves that. The two open questions I
still have are:
A. Is there some simpler way to achieve the result I want with
some of the existing code?
B. If not, is some of the existing code rendered obsolete with
my code in place?
As for (B), for example, with my code in place I don't think there's
any need for a notion of "ideal context". The ideal context is the
natural position of the thread.
And I still haven't figured out what loose_alignment means and which
actions will cause loose vs. non-loose layout.
-Carl
diff --git a/lib/sup/modes/thread-view-mode.rb
b/lib/sup/modes/thread-view-mode.rb
index dfe30ff..b7bbc7c 100644
--- a/lib/sup/modes/thread-view-mode.rb
+++ b/lib/sup/modes/thread-view-mode.rb
@@ -401,9 +401,9 @@ EOS
end
end
- IDEAL_TOP_CONTEXT = 3 # try and give 3 rows of top context
- IDEAL_LEFT_CONTEXT = 4 # try and give 4 columns of left context
- def jump_to_message m, loose_alignment=false
+ IDEAL_TOP_CONTEXT = 0 # don't bother trying to give any rows of top context
+ IDEAL_LEFT_CONTEXT = 0 # don't bother trying to give any columns of left
context
+ def jump_to_message m, loose_alignment=true
l = @layout[m]
left = l.depth * INDENT_SPACES
right = left + l.width
signature.asc
Description: PGP signature
_______________________________________________ sup-talk mailing list [email protected] http://rubyforge.org/mailman/listinfo/sup-talk
