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.

> 
>> +                    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 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?

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

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to