* [sup-talk] next search in buffer view..
@ 2009-10-03 20:49 Marc Weber
2009-10-04 20:55 ` Marc Weber
0 siblings, 1 reply; 3+ messages in thread
From: Marc Weber @ 2009-10-03 20:49 UTC (permalink / raw)
To: sup-talk
buffer.rb
def handle_input c
if @focus_buf
if @focus_buf.mode.in_search? && c != CONTINUE_IN_BUFFER_SEARCH_KEY[0]
@focus_buf.mode.cancel_search!
@focus_buf.mark_dirty
end
@focus_buf.mode.handle_input c
end
end
Why is the search canceled when typing any other char?
That's really annoying because there are some mails I have to use the
same search multiple times. However I also have to scroll up /down to
see enough context.
So why has this been implemented? Is it safe to remove that if
statement?
Seems to work for me.
It would be better if the next search would continue from the current
line rather than the last search result.
I'd like to see 'N' (search backward) as well.
If you like these ideas I'm going to supply a patch.
Comments?
Marc Weber
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [sup-talk] next search in buffer view..
2009-10-03 20:49 [sup-talk] next search in buffer view Marc Weber
@ 2009-10-04 20:55 ` Marc Weber
2009-10-06 16:35 ` William Morgan
0 siblings, 1 reply; 3+ messages in thread
From: Marc Weber @ 2009-10-04 20:55 UTC (permalink / raw)
To: sup-talk
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [sup-talk] next search in buffer view..
2009-10-04 20:55 ` Marc Weber
@ 2009-10-06 16:35 ` William Morgan
0 siblings, 0 replies; 3+ messages in thread
From: William Morgan @ 2009-10-06 16:35 UTC (permalink / raw)
To: sup-talk
Reformatted excerpts from Marc Weber's message of 2009-10-04:
> 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?
Probably the best place is to make it a class variable, i.e.
@@search_query_input. Then it will be shared across all buffers with
modes that have search functionality.
--
William <wmorgan-sup@masanjin.net>
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-10-06 16:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-03 20:49 [sup-talk] next search in buffer view Marc Weber
2009-10-04 20:55 ` Marc Weber
2009-10-06 16:35 ` William Morgan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox