]> git.notmuchmail.org Git - sup/commitdiff
made jump_to_message adjust column as well
authorwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Thu, 4 Jan 2007 05:57:08 +0000 (05:57 +0000)
committerwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Thu, 4 Jan 2007 05:57:08 +0000 (05:57 +0000)
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@169 5c8cc53c-5e98-4d25-b20a-d8db53a31250

lib/sup/modes/scroll-mode.rb
lib/sup/modes/thread-view-mode.rb

index d5978b67e3eaa75581d01c61f91a9e4aa3c4825f..34b745a72ec6001423518c876fda0fa0778713c6 100644 (file)
@@ -49,11 +49,13 @@ class ScrollMode < Mode
     buffer.mark_dirty
   end
 
-  def jump_to_left
-    buffer.mark_dirty unless @leftcol == 0
-    @leftcol = 0
+  def jump_to_col col
+    buffer.mark_dirty unless @leftcol == col
+    @leftcol = col
   end
 
+  def jump_to_left; jump_to_col 0; end
+
   ## set top line to l
   def jump_to_line l
     l = l.clamp 0, lines - 1
index 33639ebac167b690a4cc1853248d34d536b7d3fa..64a8ef0202d4bb6a2fb5c9430bdac06840537fbf 100644 (file)
@@ -175,9 +175,10 @@ class ThreadViewMode < LineCursorMode
   end
 
   def jump_to_message m
-    top, bot, prevm, nextm = @messages[m]
+    top, bot, prevm, nextm, depth = @messages[m]
     jump_to_line top unless top >= topline &&
       top <= botline && bot >= topline && bot <= botline
+    jump_to_col depth * 2 # sorry!!!!
     set_cursor_pos top
   end
 
@@ -242,7 +243,9 @@ private
         @message_lines[@text.length + i] = m
       end
 
-      @messages[m] = [@text.length, @text.length + text.length, prev_m, nil]
+      ## sorry i store all this shit in an array. very, very sorry.
+      ## also sorry about the * 2. very, very sorry.
+      @messages[m] = [@text.length, @text.length + text.length, prev_m, nil, depth]
       @messages[prev_m][3] = m if prev_m
       prev_m = m