From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.213.7.146 with SMTP id d18cs49724ebd; Tue, 12 Jan 2010 12:36:20 -0800 (PST) Received: by 10.224.44.211 with SMTP id b19mr10729218qaf.45.1263328579749; Tue, 12 Jan 2010 12:36:19 -0800 (PST) Return-Path: Received: from rubyforge.org (rubyforge.org [205.234.109.19]) by mx.google.com with ESMTP id 6si2905839qwk.31.2010.01.12.12.36.19; Tue, 12 Jan 2010 12:36:19 -0800 (PST) Received-SPF: pass (google.com: domain of sup-devel-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) client-ip=205.234.109.19; Authentication-Results: mx.google.com; spf=pass (google.com: domain of sup-devel-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) smtp.mail=sup-devel-bounces@rubyforge.org; dkim=neutral (body hash did not verify) header.i=@gmail.com Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 17BD31779943; Tue, 12 Jan 2010 15:36:19 -0500 (EST) Received: from mail-yw0-f183.google.com (mail-yw0-f183.google.com [209.85.211.183]) by rubyforge.org (Postfix) with ESMTP id A2A4F177993D for ; Tue, 12 Jan 2010 15:36:17 -0500 (EST) Received: by ywh13 with SMTP id 13so54640824ywh.29 for ; Tue, 12 Jan 2010 12:36:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:content-type:subject:from:to :date:message-id:user-agent:content-transfer-encoding; bh=BGPyhDAPIW04LbjG2jIFoJPoPKKIFaRkC7Zkc/+AUsY=; b=I5BsmTic7/1UqA4idvFbQj5OBx14f6Hwb06g3OwKlDSXZIw1lkNQsopEQRpbUAmDwp juoa8I28zMJe+uKfdVH4sTZP5942Q00L59XiNSDqm66t6VjYR1w41cVWQhfGLzZoM73E ejcr7mfOnYFzuliIi3GtTd8cWzwx8oswdOyQc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=content-type:subject:from:to:date:message-id:user-agent :content-transfer-encoding; b=M0eBfgaV2BjFOoRqNhFtlDLTI0wGcMTe+eP7xzunCZvUijaE+IO7kkp3eOrcuSA06R FoGAsngwfH0xVh8+Qh5WdypB7Y+Lxdi+t1q2xCQNW9e8ASq2aPubAUwWQP9XFIIf9qY/ /1h+hSTX6bR/SF8Vg96ERtgQN3D8yhnbt6y4E= Received: by 10.150.27.6 with SMTP id a6mr8146949yba.74.1263328576087; Tue, 12 Jan 2010 12:36:16 -0800 (PST) Received: from localhost (c-76-98-110-216.hsd1.nj.comcast.net [76.98.110.216]) by mx.google.com with ESMTPS id 35sm11168721yxh.69.2010.01.12.12.36.14 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 12 Jan 2010 12:36:15 -0800 (PST) From: Eric Sherman To: sup-devel Date: Tue, 12 Jan 2010 15:36:13 -0500 Message-Id: <1263328554-sup-8440@changeling.local> User-Agent: Sup/git Subject: [sup-devel] [PATCHv2] [issue44] cursor sticks to thread X-BeenThere: sup-devel@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: Sup developer discussion List-Id: Sup developer discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: sup-devel-bounces@rubyforge.org Errors-To: sup-devel-bounces@rubyforge.org This is much more concise version, using set_cursor_pos instead of cursor_up and cursor_down. The cursor will track the thread it is on when that thread is moved up or down on the screen as threads are added or removed from the view. --- lib/sup/modes/thread-index-mode.rb | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/lib/sup/modes/thread-index-mode.rb b/lib/sup/modes/thread-index-mode.rb index a5bd344..40f622b 100644 --- a/lib/sup/modes/thread-index-mode.rb +++ b/lib/sup/modes/thread-index-mode.rb @@ -219,12 +219,14 @@ EOS end def update + old_cursor_thread = cursor_thread @mutex.synchronize do ## let's see you do THIS in python @threads = @ts.threads.select { |t| !@hidden_threads[t] }.sort_by { |t| [t.date, t.first.id] }.reverse @size_widgets = @threads.map { |t| size_widget_for_thread t } @size_widget_width = @size_widgets.max_of { |w| w.display_length } end + set_cursor_pos @threads.index(old_cursor_thread)||curpos regen_text end -- 1.6.6 _______________________________________________ Sup-devel mailing list Sup-devel@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-devel