On Sun, Feb 07, 2010 at 02:28:06PM -0800, Micah Cowan wrote:
> Nicholas Marriott wrote:
> > Hi
> > 
> > Thanks for the diff,
> > 
> > n retains the sense of the last search (repeats in the same direction), so 
> > this
> > is to reverse the sense of the last search?
> 
> Well, it's to search in the reverse of the last actually typed search.
> So, if you searched up, n will continue searching up. N will search
> down, but it doesn't reverse the sense in a permanent way; it just
> searches the opposite of the current "sense". So continued Ns keep
> searching the same direction, and an n will go back to the original sense.

Yes, that's what I meant, it searches in reverse of the sense of the last
search, not including repeats.

> 
> > 
> >> +                  if ((data->searchtype == WINDOW_COPY_SEARCHUP)
> >> +                      == (cmd == MODEKEYCOPY_SEARCHAGAIN))
> > 
> > This should be &&, I expect.
> 
> Well, no, because if it were &&, then it would search down when the
> original sense was down, regardless of whether the cmd is
> MODEKEYCOPY_SEARCHAGAIN or MODEKEYCOPY_SEARCHREVERSE. If both inner
> clauses are false (we're not searching up but the command's not
> SEARCHAGAIN), I want the net result to be true (search up).

I've forgotten what the original diff did if this expression was true and I
can't find it right now, but I don't think the expression is very clear.

> 
> > I think I would rather have a separate if in each case, eg:
> > 
> >                 case WINDOW_COPY_SEARCHUP:
> >                     if (cmd == MODEKEYCOPY_SEARCHAGAIN)
> >                             window_copy_search_up(wp, data->searchstr);
> >                     else
> >                             window_copy_search_down(wp, data->searchstr);   
> >                 
> >                     break;
> > 
> > And similar for WINDOW_COPY_SEARCHDOWN.
> 
> Fair enough. I imagine you don't need me to reroll the patch for that,
> right?

If you could it would be great, but let me know if you don't have time and I'll
do it.

> 
> -- 
> Micah J. Cowan
> http://micah.cowan.name/

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to