Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: Marc Weber <marco-oweber@gmx.de>
To: sup-talk <sup-talk@rubyforge.org>
Subject: Re: [sup-talk] next search in buffer view..
Date: Sun, 04 Oct 2009 22:55:42 +0200	[thread overview]
Message-ID: <1254689522-sup-2800@nixos> (raw)
In-Reply-To: <1254602805-sup-2900@nixos>

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


  reply	other threads:[~2009-10-04 21:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-03 20:49 Marc Weber
2009-10-04 20:55 ` Marc Weber [this message]
2009-10-06 16:35   ` William Morgan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1254689522-sup-2800@nixos \
    --to=marco-oweber@gmx.de \
    --cc=sup-talk@rubyforge.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox