From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.90.92.18 with SMTP id p18cs12137agb; Sun, 4 Oct 2009 14:20:41 -0700 (PDT) Received: by 10.224.52.144 with SMTP id i16mr2668594qag.210.1254691241060; Sun, 04 Oct 2009 14:20:41 -0700 (PDT) Return-Path: Received: from rubyforge.org (rubyforge.org [205.234.109.19]) by mx.google.com with ESMTP id 42si3158514qyk.64.2009.10.04.14.20.40; Sun, 04 Oct 2009 14:20:41 -0700 (PDT) Received-SPF: pass (google.com: domain of sup-talk-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-talk-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) smtp.mail=sup-talk-bounces@rubyforge.org Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 9B9FE1858285; Sun, 4 Oct 2009 17:20:40 -0400 (EDT) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by rubyforge.org (Postfix) with SMTP id 06FA51858202 for ; Sun, 4 Oct 2009 16:55:57 -0400 (EDT) Received: (qmail invoked by alias); 04 Oct 2009 20:55:56 -0000 Received: from mawercer.at.xencon.net (EHLO mail.gmx.net) [83.246.111.127] by mail.gmx.net (mp034) with SMTP; 04 Oct 2009 22:55:56 +0200 X-Authenticated: #9006135 X-Provags-ID: V01U2FsdGVkX19LsvoVaxpL9iPjFUVGqL9o260FC1uP1gsNL71n8j TQiZbn9GRLzZI5 Received: by mail.gmx.net (sSMTP sendmail emulation); Sun, 04 Oct 2009 22:55:42 +0200 From: Marc Weber To: sup-talk In-reply-to: <1254602805-sup-2900@nixos> References: <1254602805-sup-2900@nixos> Date: Sun, 04 Oct 2009 22:55:42 +0200 Message-Id: <1254689522-sup-2800@nixos> User-Agent: Sup/git X-Y-GMX-Trusted: 0 X-FuHaFi: 0.6 Subject: Re: [sup-talk] next search in buffer view.. X-BeenThere: sup-talk@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: User & developer discussion of Sup 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-talk-bounces@rubyforge.org Errors-To: sup-talk-bounces@rubyforge.org Mmh. Maybe its not that a bad idea to keep the search mode. However it would be nice to provide the last search term as default. This minimal patch adds this feature. However the search_query_input should be global. So where is the place to add this "last-search-term" ? Isn't it already present in the ask history? Can you give me a hint to find it faster? Marc Weber diff --git a/lib/sup/modes/scroll-mode.rb b/lib/sup/modes/scroll-mode.rb index c131425..a97f13c 100644 --- a/lib/sup/modes/scroll-mode.rb +++ b/lib/sup/modes/scroll-mode.rb @@ -35,6 +35,7 @@ class ScrollMode < Mode @slip_rows = opts[:slip_rows] || 0 # when we pgup/pgdown, # how many lines do we keep? @twiddles = opts.member?(:twiddles) ? opts[:twiddles] : true + @search_query_input = "" @search_query = nil @search_line = nil @status = "" @@ -81,9 +82,10 @@ class ScrollMode < Mode end def search_in_buffer - query = BufferManager.ask :search, "search in buffer: " + query = BufferManager.ask :search, "search in buffer: ", @search_query_input return if query.nil? || query.empty? @search_query = Regexp.escape query + @search_query_input = query continue_search_in_buffer end _______________________________________________ sup-talk mailing list sup-talk@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-talk